@o3r/components 11.0.0-next.0 → 11.0.0-next.2
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/README.md +5 -1
- package/builders/component-extractor/helpers/component/component-class.extractor.d.ts +1 -1
- package/builders/component-extractor/helpers/component/component-class.extractor.d.ts.map +1 -1
- package/builders/component-extractor/helpers/component/component-class.extractor.js +1 -1
- package/builders/component-extractor/helpers/component/component-class.extractor.js.map +1 -1
- package/builders/component-extractor/helpers/component/component-config.extractor.js.map +1 -1
- package/builders/component-extractor/helpers/component/component.extractor.js.map +1 -1
- package/builders/component-extractor/helpers/component/component.parser.d.ts +1 -0
- package/builders/component-extractor/helpers/component/component.parser.d.ts.map +1 -1
- package/builders/component-extractor/helpers/component/component.parser.js +10 -8
- package/builders/component-extractor/helpers/component/component.parser.js.map +1 -1
- package/builders/component-extractor/index.d.ts.map +1 -1
- package/builders/component-extractor/index.js +4 -4
- package/builders/component-extractor/index.js.map +1 -1
- package/devkit/components-devkit.interface.d.ts +24 -1
- package/devkit/components-devkit.interface.d.ts.map +1 -1
- package/devkit/components-devtools.message.service.d.ts +6 -2
- package/devkit/components-devtools.message.service.d.ts.map +1 -1
- package/devkit/components-devtools.module.d.ts +2 -1
- package/devkit/components-devtools.module.d.ts.map +1 -1
- package/devkit/inspector/otter-inspector.helpers.d.ts.map +1 -1
- package/devkit/inspector/otter-inspector.service.d.ts.map +1 -1
- package/esm2022/core/rendering/helpers.mjs +1 -1
- package/esm2022/devkit/components-devkit.interface.mjs +3 -1
- package/esm2022/devkit/components-devtools.message.service.mjs +26 -7
- package/esm2022/devkit/components-devtools.module.mjs +11 -7
- package/esm2022/devkit/inspector/otter-inspector.helpers.mjs +3 -2
- package/esm2022/devkit/inspector/otter-inspector.service.mjs +2 -3
- package/esm2022/rules-engine/placeholder.action-handler.mjs +18 -14
- package/esm2022/rules-engine/placeholder.rules-engine.effect.mjs +22 -13
- package/esm2022/rules-engine/placeholder.rules-engine.module.mjs +4 -4
- package/esm2022/stores/placeholder-request/placeholder-request.module.mjs +4 -4
- package/esm2022/stores/placeholder-request/placeholder-request.reducer.mjs +1 -1
- package/esm2022/stores/placeholder-request/placeholder-request.state.mjs +1 -1
- package/esm2022/stores/placeholder-request/placeholder-request.sync.mjs +1 -1
- package/esm2022/stores/placeholder-template/placeholder-template.actions.mjs +3 -1
- package/esm2022/stores/placeholder-template/placeholder-template.module.mjs +4 -4
- package/esm2022/stores/placeholder-template/placeholder-template.reducer.mjs +10 -2
- package/esm2022/stores/placeholder-template/placeholder-template.selectors.mjs +2 -1
- package/esm2022/stores/placeholder-template/placeholder-template.state.mjs +1 -1
- package/esm2022/stores/placeholder-template/placeholder-template.sync.mjs +1 -1
- package/esm2022/tools/component-replacement/c11n.directive.mjs +8 -6
- package/esm2022/tools/component-replacement/c11n.helpers.mjs +1 -1
- package/esm2022/tools/component-replacement/c11n.mock.module.mjs +10 -10
- package/esm2022/tools/component-replacement/c11n.module.mjs +5 -5
- package/esm2022/tools/component-replacement/c11n.service.mjs +4 -4
- package/esm2022/tools/pipes/capitalize/capitalize.module.mjs +8 -5
- package/esm2022/tools/pipes/capitalize/capitalize.pipe.mjs +16 -5
- package/esm2022/tools/pipes/duration/duration.module.mjs +8 -5
- package/esm2022/tools/pipes/duration/duration.pipe.mjs +17 -5
- package/esm2022/tools/pipes/keep-white-space/keep-white-space.module.mjs +8 -5
- package/esm2022/tools/pipes/keep-white-space/keep-white-space.pipe.mjs +19 -7
- package/esm2022/tools/pipes/replace-with-bold/replace-with-bold.module.mjs +8 -5
- package/esm2022/tools/pipes/replace-with-bold/replace-with-bold.pipe.mjs +23 -9
- package/esm2022/tools/placeholder/placeholder.component.mjs +11 -13
- package/esm2022/tools/placeholder/placeholder.module.mjs +5 -5
- package/fesm2022/o3r-components-rules-engine.mjs +42 -29
- package/fesm2022/o3r-components-rules-engine.mjs.map +1 -1
- package/fesm2022/o3r-components.mjs +560 -467
- package/fesm2022/o3r-components.mjs.map +1 -1
- package/migration.json +10 -0
- package/package.json +39 -28
- package/rules-engine/placeholder.action-handler.d.ts +7 -6
- package/rules-engine/placeholder.action-handler.d.ts.map +1 -1
- package/rules-engine/placeholder.rules-engine.effect.d.ts.map +1 -1
- package/schemas/placeholder-template.schema.json +9 -1
- package/schematics/cms-adapter/index.d.ts +2 -3
- package/schematics/cms-adapter/index.d.ts.map +1 -1
- package/schematics/cms-adapter/index.js +7 -3
- package/schematics/cms-adapter/index.js.map +1 -1
- package/schematics/ng-add/index.d.ts +1 -1
- package/schematics/ng-add/index.d.ts.map +1 -1
- package/schematics/ng-add/index.js +60 -40
- package/schematics/ng-add/index.js.map +1 -1
- package/schematics/ng-add/schema.d.ts +2 -0
- package/schematics/ng-add/schema.d.ts.map +1 -1
- package/schematics/ng-add/schema.json +5 -0
- package/schematics/ng-update/v10-0/index.d.ts +6 -0
- package/schematics/ng-update/v10-0/index.d.ts.map +1 -0
- package/schematics/ng-update/v10-0/index.js +63 -0
- package/schematics/ng-update/v10-0/index.js.map +1 -0
- package/stores/placeholder-request/placeholder-request.state.d.ts +1 -0
- package/stores/placeholder-request/placeholder-request.state.d.ts.map +1 -1
- package/stores/placeholder-template/placeholder-template.actions.d.ts +6 -1
- package/stores/placeholder-template/placeholder-template.actions.d.ts.map +1 -1
- package/stores/placeholder-template/placeholder-template.reducer.d.ts.map +1 -1
- package/stores/placeholder-template/placeholder-template.selectors.d.ts +1 -0
- package/stores/placeholder-template/placeholder-template.selectors.d.ts.map +1 -1
- package/stores/placeholder-template/placeholder-template.state.d.ts +3 -0
- package/stores/placeholder-template/placeholder-template.state.d.ts.map +1 -1
- package/tools/component-replacement/c11n.directive.d.ts +4 -4
- package/tools/component-replacement/c11n.directive.d.ts.map +1 -1
- package/tools/component-replacement/c11n.helpers.d.ts +2 -2
- package/tools/component-replacement/c11n.helpers.d.ts.map +1 -1
- package/tools/component-replacement/c11n.service.d.ts +3 -3
- package/tools/component-replacement/c11n.service.d.ts.map +1 -1
- package/tools/pipes/capitalize/capitalize.module.d.ts +3 -0
- package/tools/pipes/capitalize/capitalize.module.d.ts.map +1 -1
- package/tools/pipes/capitalize/capitalize.pipe.d.ts +8 -1
- package/tools/pipes/capitalize/capitalize.pipe.d.ts.map +1 -1
- package/tools/pipes/duration/duration.module.d.ts +3 -0
- package/tools/pipes/duration/duration.module.d.ts.map +1 -1
- package/tools/pipes/duration/duration.pipe.d.ts +9 -1
- package/tools/pipes/duration/duration.pipe.d.ts.map +1 -1
- package/tools/pipes/keep-white-space/keep-white-space.module.d.ts +3 -0
- package/tools/pipes/keep-white-space/keep-white-space.module.d.ts.map +1 -1
- package/tools/pipes/keep-white-space/keep-white-space.pipe.d.ts +8 -1
- package/tools/pipes/keep-white-space/keep-white-space.pipe.d.ts.map +1 -1
- package/tools/pipes/replace-with-bold/replace-with-bold.module.d.ts +3 -0
- package/tools/pipes/replace-with-bold/replace-with-bold.module.d.ts.map +1 -1
- package/tools/pipes/replace-with-bold/replace-with-bold.pipe.d.ts +8 -1
- package/tools/pipes/replace-with-bold/replace-with-bold.pipe.d.ts.map +1 -1
- package/tools/placeholder/placeholder.component.d.ts +5 -3
- package/tools/placeholder/placeholder.component.d.ts.map +1 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { of, from,
|
|
2
|
-
import {
|
|
1
|
+
import { of, from, observeOn, animationFrameScheduler, BehaviorSubject, Subscription, firstValueFrom, fromEvent, Subject, ReplaySubject, sample } from 'rxjs';
|
|
2
|
+
import { mergeMap, bufferCount, concatMap, delay, scan, tap, filter, distinctUntilChanged, map, mapTo, switchMap } from 'rxjs/operators';
|
|
3
3
|
import * as i0 from '@angular/core';
|
|
4
|
-
import { InjectionToken, Injectable, Optional, Inject,
|
|
5
|
-
import {
|
|
6
|
-
import * as i1 from '@o3r/logger';
|
|
7
|
-
import * as i1
|
|
8
|
-
import {
|
|
4
|
+
import { InjectionToken, NgModule, Injectable, Optional, Inject, SimpleChange, forwardRef, Directive, Input, Pipe, Component, ChangeDetectionStrategy, ViewEncapsulation } from '@angular/core';
|
|
5
|
+
import { asyncProps, createEntityAsyncRequestAdapter, asyncStoreItemAdapter, asyncEntitySerializer, otterComponentInfoPropertyName, sendOtterMessage, filterMessageContent } from '@o3r/core';
|
|
6
|
+
import * as i1$1 from '@o3r/logger';
|
|
7
|
+
import * as i1 from '@ngrx/store';
|
|
8
|
+
import { createAction, props, on, createReducer, StoreModule, createFeatureSelector, createSelector } from '@ngrx/store';
|
|
9
9
|
import { createEntityAdapter } from '@ngrx/entity';
|
|
10
10
|
import { NgControl, NG_VALUE_ACCESSOR, NG_VALIDATORS } from '@angular/forms';
|
|
11
11
|
import * as i2 from '@angular/common';
|
|
@@ -49,9 +49,323 @@ const isComponentsMessage = (message) => {
|
|
|
49
49
|
return message && (message.dataType === 'requestMessages' ||
|
|
50
50
|
message.dataType === 'connect' ||
|
|
51
51
|
message.dataType === 'selectedComponentInfo' ||
|
|
52
|
+
message.dataType === 'isComponentSelectionAvailable' ||
|
|
53
|
+
message.dataType === 'placeholderMode' ||
|
|
52
54
|
message.dataType === 'toggleInspector');
|
|
53
55
|
};
|
|
54
56
|
|
|
57
|
+
const ACTION_DELETE_ENTITY = '[PlaceholderTemplate] delete entity';
|
|
58
|
+
const ACTION_SET_ENTITY = '[PlaceholderTemplate] set entity';
|
|
59
|
+
const ACTION_TOGGLE_MODE = '[PlaceholderTemplate] toggle mode';
|
|
60
|
+
/** Action to delete a specific entity */
|
|
61
|
+
const deletePlaceholderTemplateEntity = createAction(ACTION_DELETE_ENTITY, props());
|
|
62
|
+
/** Action to clear all placeholderTemplate and fill the store with the payload */
|
|
63
|
+
const setPlaceholderTemplateEntity = createAction(ACTION_SET_ENTITY, props());
|
|
64
|
+
const togglePlaceholderModeTemplate = createAction(ACTION_TOGGLE_MODE, props());
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* PlaceholderTemplate Store adapter
|
|
68
|
+
*/
|
|
69
|
+
const placeholderTemplateAdapter = createEntityAdapter({
|
|
70
|
+
selectId: (model) => model.id
|
|
71
|
+
});
|
|
72
|
+
/**
|
|
73
|
+
* PlaceholderTemplate Store initial value
|
|
74
|
+
*/
|
|
75
|
+
const placeholderTemplateInitialState = placeholderTemplateAdapter.getInitialState({
|
|
76
|
+
mode: 'normal'
|
|
77
|
+
});
|
|
78
|
+
/**
|
|
79
|
+
* List of basic actions for PlaceholderTemplate Store
|
|
80
|
+
*/
|
|
81
|
+
const placeholderTemplateReducerFeatures = [
|
|
82
|
+
on(setPlaceholderTemplateEntity, (state, payload) => placeholderTemplateAdapter.addOne(payload.entity, placeholderTemplateAdapter.removeOne(payload.entity.id, state))),
|
|
83
|
+
on(deletePlaceholderTemplateEntity, (state, payload) => {
|
|
84
|
+
const id = payload.id;
|
|
85
|
+
if (!id || !state.entities[id]) {
|
|
86
|
+
return state;
|
|
87
|
+
}
|
|
88
|
+
return placeholderTemplateAdapter.removeOne(id, state);
|
|
89
|
+
}),
|
|
90
|
+
on(togglePlaceholderModeTemplate, (state, payload) => {
|
|
91
|
+
return {
|
|
92
|
+
...state,
|
|
93
|
+
mode: payload.mode
|
|
94
|
+
};
|
|
95
|
+
})
|
|
96
|
+
];
|
|
97
|
+
/**
|
|
98
|
+
* PlaceholderTemplate Store reducer
|
|
99
|
+
*/
|
|
100
|
+
const placeholderTemplateReducer = createReducer(placeholderTemplateInitialState, ...placeholderTemplateReducerFeatures);
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Name of the PlaceholderTemplate Store
|
|
104
|
+
*/
|
|
105
|
+
const PLACEHOLDER_TEMPLATE_STORE_NAME = 'placeholderTemplate';
|
|
106
|
+
|
|
107
|
+
/** Token of the PlaceholderTemplate reducer */
|
|
108
|
+
const PLACEHOLDER_TEMPLATE_REDUCER_TOKEN = new InjectionToken('Feature PlaceholderTemplate Reducer');
|
|
109
|
+
/** Provide default reducer for PlaceholderTemplate store */
|
|
110
|
+
function getDefaultPlaceholderTemplateReducer() {
|
|
111
|
+
return placeholderTemplateReducer;
|
|
112
|
+
}
|
|
113
|
+
class PlaceholderTemplateStoreModule {
|
|
114
|
+
static forRoot(reducerFactory) {
|
|
115
|
+
return {
|
|
116
|
+
ngModule: PlaceholderTemplateStoreModule,
|
|
117
|
+
providers: [
|
|
118
|
+
{ provide: PLACEHOLDER_TEMPLATE_REDUCER_TOKEN, useFactory: reducerFactory }
|
|
119
|
+
]
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.6", ngImport: i0, type: PlaceholderTemplateStoreModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
123
|
+
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.6", ngImport: i0, type: PlaceholderTemplateStoreModule, imports: [i1.StoreFeatureModule] }); }
|
|
124
|
+
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.6", ngImport: i0, type: PlaceholderTemplateStoreModule, providers: [
|
|
125
|
+
{ provide: PLACEHOLDER_TEMPLATE_REDUCER_TOKEN, useFactory: getDefaultPlaceholderTemplateReducer }
|
|
126
|
+
], imports: [StoreModule.forFeature(PLACEHOLDER_TEMPLATE_STORE_NAME, PLACEHOLDER_TEMPLATE_REDUCER_TOKEN)] }); }
|
|
127
|
+
}
|
|
128
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.6", ngImport: i0, type: PlaceholderTemplateStoreModule, decorators: [{
|
|
129
|
+
type: NgModule,
|
|
130
|
+
args: [{
|
|
131
|
+
imports: [
|
|
132
|
+
StoreModule.forFeature(PLACEHOLDER_TEMPLATE_STORE_NAME, PLACEHOLDER_TEMPLATE_REDUCER_TOKEN)
|
|
133
|
+
],
|
|
134
|
+
providers: [
|
|
135
|
+
{ provide: PLACEHOLDER_TEMPLATE_REDUCER_TOKEN, useFactory: getDefaultPlaceholderTemplateReducer }
|
|
136
|
+
]
|
|
137
|
+
}]
|
|
138
|
+
}] });
|
|
139
|
+
|
|
140
|
+
const ACTION_FAIL_ENTITIES = '[PlaceholderRequest] fail entities';
|
|
141
|
+
const ACTION_SET_ENTITY_FROM_URL = '[PlaceholderRequest] set entity from url';
|
|
142
|
+
const ACTION_CANCEL_REQUEST = '[PlaceholderRequest] cancel request';
|
|
143
|
+
const ACTION_UPDATE_ENTITY = '[PlaceholderRequest] update entity';
|
|
144
|
+
const ACTION_UPDATE_ENTITY_SYNC = '[PlaceholderRequest] update entity sync';
|
|
145
|
+
/** Action to cancel a Request ID registered in the store. Can happen from effect based on a switchMap for instance */
|
|
146
|
+
const cancelPlaceholderRequest = createAction(ACTION_CANCEL_REQUEST, props());
|
|
147
|
+
/** Action to update failureStatus for PlaceholderRequestModels */
|
|
148
|
+
const failPlaceholderRequestEntity = createAction(ACTION_FAIL_ENTITIES, props());
|
|
149
|
+
/** Action to update an entity */
|
|
150
|
+
const updatePlaceholderRequestEntity = createAction(ACTION_UPDATE_ENTITY, props());
|
|
151
|
+
/** Action to update an entity without impact on request id */
|
|
152
|
+
const updatePlaceholderRequestEntitySync = createAction(ACTION_UPDATE_ENTITY_SYNC, props());
|
|
153
|
+
/** Action to update PlaceholderRequest with known IDs, will create the entity with only the url, the call will be created in the effect */
|
|
154
|
+
const setPlaceholderRequestEntityFromUrl = createAction(ACTION_SET_ENTITY_FROM_URL, asyncProps());
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* PlaceholderRequest Store adapter
|
|
158
|
+
*/
|
|
159
|
+
const placeholderRequestAdapter = createEntityAsyncRequestAdapter(createEntityAdapter({
|
|
160
|
+
selectId: (model) => model.id
|
|
161
|
+
}));
|
|
162
|
+
/**
|
|
163
|
+
* PlaceholderRequest Store initial value
|
|
164
|
+
*/
|
|
165
|
+
const placeholderRequestInitialState = placeholderRequestAdapter.getInitialState({
|
|
166
|
+
requestIds: []
|
|
167
|
+
});
|
|
168
|
+
/**
|
|
169
|
+
* Reducers of Placeholder request store that handles the call to the placeholder template URL
|
|
170
|
+
*/
|
|
171
|
+
const placeholderRequestReducerFeatures = [
|
|
172
|
+
on(cancelPlaceholderRequest, (state, action) => {
|
|
173
|
+
const id = action.id;
|
|
174
|
+
if (!id || !state.entities[id]) {
|
|
175
|
+
return state;
|
|
176
|
+
}
|
|
177
|
+
return placeholderRequestAdapter.updateOne({
|
|
178
|
+
id: action.id,
|
|
179
|
+
changes: asyncStoreItemAdapter.resolveRequest(state.entities[id], action.requestId)
|
|
180
|
+
}, asyncStoreItemAdapter.resolveRequest(state, action.requestId));
|
|
181
|
+
}),
|
|
182
|
+
on(updatePlaceholderRequestEntity, (state, action) => {
|
|
183
|
+
const currentEntity = state.entities[action.entity.id];
|
|
184
|
+
const newEntity = asyncStoreItemAdapter.resolveRequest({ ...action.entity, ...asyncStoreItemAdapter.extractAsyncStoreItem(currentEntity) }, action.requestId);
|
|
185
|
+
return placeholderRequestAdapter.updateOne({
|
|
186
|
+
id: newEntity.id,
|
|
187
|
+
changes: newEntity
|
|
188
|
+
}, asyncStoreItemAdapter.resolveRequest(state, action.requestId));
|
|
189
|
+
}),
|
|
190
|
+
on(updatePlaceholderRequestEntitySync, (state, action) => {
|
|
191
|
+
return placeholderRequestAdapter.updateOne({
|
|
192
|
+
id: action.entity.id,
|
|
193
|
+
changes: {
|
|
194
|
+
...action.entity
|
|
195
|
+
}
|
|
196
|
+
}, state);
|
|
197
|
+
}),
|
|
198
|
+
on(setPlaceholderRequestEntityFromUrl, (state, payload) => {
|
|
199
|
+
const currentEntity = state.entities[payload.id];
|
|
200
|
+
// Nothing to update if resolved URLs already match
|
|
201
|
+
if (currentEntity && currentEntity.resolvedUrl === payload.resolvedUrl) {
|
|
202
|
+
return state;
|
|
203
|
+
}
|
|
204
|
+
let newEntity = {
|
|
205
|
+
id: payload.id,
|
|
206
|
+
resolvedUrl: payload.resolvedUrl,
|
|
207
|
+
used: true
|
|
208
|
+
};
|
|
209
|
+
if (currentEntity) {
|
|
210
|
+
newEntity = { ...asyncStoreItemAdapter.extractAsyncStoreItem(currentEntity), ...newEntity };
|
|
211
|
+
}
|
|
212
|
+
return placeholderRequestAdapter.addOne(asyncStoreItemAdapter.addRequest(asyncStoreItemAdapter.initialize(newEntity), payload.requestId), asyncStoreItemAdapter.addRequest(state, payload.requestId));
|
|
213
|
+
}),
|
|
214
|
+
on(failPlaceholderRequestEntity, (state, payload) => {
|
|
215
|
+
return placeholderRequestAdapter.failRequestMany(asyncStoreItemAdapter.resolveRequest(state, payload.requestId), payload && payload.ids, payload.requestId);
|
|
216
|
+
})
|
|
217
|
+
];
|
|
218
|
+
/**
|
|
219
|
+
* PlaceholderRequest Store reducer
|
|
220
|
+
*/
|
|
221
|
+
const placeholderRequestReducer = createReducer(placeholderRequestInitialState, ...placeholderRequestReducerFeatures);
|
|
222
|
+
|
|
223
|
+
/**
|
|
224
|
+
* Name of the PlaceholderRequest Store
|
|
225
|
+
*/
|
|
226
|
+
const PLACEHOLDER_REQUEST_STORE_NAME = 'placeholderRequest';
|
|
227
|
+
|
|
228
|
+
/** Token of the PlaceholderRequest reducer */
|
|
229
|
+
const PLACEHOLDER_REQUEST_REDUCER_TOKEN = new InjectionToken('Feature PlaceholderRequest Reducer');
|
|
230
|
+
/** Provide default reducer for PlaceholderRequest store */
|
|
231
|
+
function getDefaultplaceholderRequestReducer() {
|
|
232
|
+
return placeholderRequestReducer;
|
|
233
|
+
}
|
|
234
|
+
class PlaceholderRequestStoreModule {
|
|
235
|
+
static forRoot(reducerFactory) {
|
|
236
|
+
return {
|
|
237
|
+
ngModule: PlaceholderRequestStoreModule,
|
|
238
|
+
providers: [
|
|
239
|
+
{ provide: PLACEHOLDER_REQUEST_REDUCER_TOKEN, useFactory: reducerFactory }
|
|
240
|
+
]
|
|
241
|
+
};
|
|
242
|
+
}
|
|
243
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.6", ngImport: i0, type: PlaceholderRequestStoreModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
244
|
+
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.6", ngImport: i0, type: PlaceholderRequestStoreModule, imports: [i1.StoreFeatureModule] }); }
|
|
245
|
+
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.6", ngImport: i0, type: PlaceholderRequestStoreModule, providers: [
|
|
246
|
+
{ provide: PLACEHOLDER_REQUEST_REDUCER_TOKEN, useFactory: getDefaultplaceholderRequestReducer }
|
|
247
|
+
], imports: [StoreModule.forFeature(PLACEHOLDER_REQUEST_STORE_NAME, PLACEHOLDER_REQUEST_REDUCER_TOKEN)] }); }
|
|
248
|
+
}
|
|
249
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.6", ngImport: i0, type: PlaceholderRequestStoreModule, decorators: [{
|
|
250
|
+
type: NgModule,
|
|
251
|
+
args: [{
|
|
252
|
+
imports: [
|
|
253
|
+
StoreModule.forFeature(PLACEHOLDER_REQUEST_STORE_NAME, PLACEHOLDER_REQUEST_REDUCER_TOKEN)
|
|
254
|
+
],
|
|
255
|
+
providers: [
|
|
256
|
+
{ provide: PLACEHOLDER_REQUEST_REDUCER_TOKEN, useFactory: getDefaultplaceholderRequestReducer }
|
|
257
|
+
]
|
|
258
|
+
}]
|
|
259
|
+
}] });
|
|
260
|
+
|
|
261
|
+
const selectPlaceholderRequestState = createFeatureSelector(PLACEHOLDER_REQUEST_STORE_NAME);
|
|
262
|
+
const { selectEntities: selectEntities$1 } = placeholderRequestAdapter.getSelectors();
|
|
263
|
+
/** Select the dictionary of PlaceholderRequest entities */
|
|
264
|
+
const selectPlaceholderRequestEntities = createSelector(selectPlaceholderRequestState, (state) => state && selectEntities$1(state));
|
|
265
|
+
/**
|
|
266
|
+
* Select a specific PlaceholderRequest entity using a raw url as id
|
|
267
|
+
* @param rawUrl
|
|
268
|
+
*/
|
|
269
|
+
const selectPlaceholderRequestEntityUsage = (rawUrl) => createSelector(selectPlaceholderRequestState, (state) => {
|
|
270
|
+
return state?.entities[rawUrl] ? state?.entities[rawUrl].used : undefined;
|
|
271
|
+
});
|
|
272
|
+
|
|
273
|
+
const placeholderRequestStorageSerializer = asyncEntitySerializer;
|
|
274
|
+
const placeholderRequestStorageDeserializer = (rawObject) => {
|
|
275
|
+
if (!rawObject || !rawObject.ids) {
|
|
276
|
+
return placeholderRequestInitialState;
|
|
277
|
+
}
|
|
278
|
+
const storeObject = placeholderRequestAdapter.getInitialState(rawObject);
|
|
279
|
+
for (const id of rawObject.ids) {
|
|
280
|
+
storeObject.entities[id] = rawObject.entities[id];
|
|
281
|
+
}
|
|
282
|
+
return storeObject;
|
|
283
|
+
};
|
|
284
|
+
const placeholderRequestStorageSync = {
|
|
285
|
+
serialize: placeholderRequestStorageSerializer,
|
|
286
|
+
deserialize: placeholderRequestStorageDeserializer
|
|
287
|
+
};
|
|
288
|
+
|
|
289
|
+
const { selectEntities } = placeholderTemplateAdapter.getSelectors();
|
|
290
|
+
const selectPlaceholderTemplateState = createFeatureSelector(PLACEHOLDER_TEMPLATE_STORE_NAME);
|
|
291
|
+
/** Select the dictionary of PlaceholderTemplate entities */
|
|
292
|
+
const selectPlaceholderTemplateEntities = createSelector(selectPlaceholderTemplateState, (state) => state && selectEntities(state));
|
|
293
|
+
/**
|
|
294
|
+
* Select a specific PlaceholderTemplate
|
|
295
|
+
* @param placeholderId
|
|
296
|
+
*/
|
|
297
|
+
const selectPlaceholderTemplateEntity = (placeholderId) => createSelector(selectPlaceholderTemplateState, (state) => state?.entities[placeholderId]);
|
|
298
|
+
/**
|
|
299
|
+
* Select the ordered rendered placeholder template full data (url, priority etc.) for a given placeholderId
|
|
300
|
+
* Return undefined if the placeholder is not found
|
|
301
|
+
* Returns {orderedRenderedTemplates: undefined, isPending: true} if any of the request is still pending
|
|
302
|
+
* @param placeholderId
|
|
303
|
+
*/
|
|
304
|
+
const selectSortedTemplates = (placeholderId) => createSelector(selectPlaceholderTemplateEntity(placeholderId), selectPlaceholderRequestState, (placeholderTemplate, placeholderRequestState) => {
|
|
305
|
+
if (!placeholderTemplate || !placeholderRequestState) {
|
|
306
|
+
return;
|
|
307
|
+
}
|
|
308
|
+
// The isPending will be considered true if any of the Url is still pending
|
|
309
|
+
let isPending = false;
|
|
310
|
+
const templates = [];
|
|
311
|
+
placeholderTemplate.urlsWithPriority.forEach(urlWithPriority => {
|
|
312
|
+
const placeholderRequest = placeholderRequestState.entities[urlWithPriority.rawUrl];
|
|
313
|
+
if (placeholderRequest) {
|
|
314
|
+
// If one of the items is pending, we will wait to display all contents at the same time
|
|
315
|
+
isPending = isPending || placeholderRequest.isPending;
|
|
316
|
+
// Templates in failure will be ignored from the list
|
|
317
|
+
if (!placeholderRequest.isFailure) {
|
|
318
|
+
templates.push({
|
|
319
|
+
rawUrl: urlWithPriority.rawUrl,
|
|
320
|
+
resolvedUrl: placeholderRequest.resolvedUrl,
|
|
321
|
+
priority: urlWithPriority.priority,
|
|
322
|
+
renderedTemplate: placeholderRequest.renderedTemplate
|
|
323
|
+
});
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
});
|
|
327
|
+
// No need to perform sorting if still pending
|
|
328
|
+
if (isPending) {
|
|
329
|
+
return { orderedTemplates: undefined, isPending };
|
|
330
|
+
}
|
|
331
|
+
// Sort templates by priority
|
|
332
|
+
const orderedTemplates = templates.sort((template1, template2) => {
|
|
333
|
+
return (template2.priority - template1.priority) || 1;
|
|
334
|
+
}).filter(templateData => !!templateData.renderedTemplate);
|
|
335
|
+
return { orderedTemplates, isPending };
|
|
336
|
+
});
|
|
337
|
+
/**
|
|
338
|
+
* Select the ordered rendered templates for a given placeholderId
|
|
339
|
+
* Return undefined if the placeholder is not found
|
|
340
|
+
* Returns {orderedRenderedTemplates: undefined, isPending: true} if any of the request is still pending
|
|
341
|
+
* @param placeholderId
|
|
342
|
+
* @deprecated Please use {@link selectSortedTemplates} instead
|
|
343
|
+
*/
|
|
344
|
+
const selectPlaceholderRenderedTemplates = (placeholderId) => createSelector(selectSortedTemplates(placeholderId), (placeholderData) => {
|
|
345
|
+
if (!placeholderData) {
|
|
346
|
+
return;
|
|
347
|
+
}
|
|
348
|
+
return {
|
|
349
|
+
orderedRenderedTemplates: placeholderData.orderedTemplates?.map(placeholder => placeholder.renderedTemplate),
|
|
350
|
+
isPending: placeholderData.isPending
|
|
351
|
+
};
|
|
352
|
+
});
|
|
353
|
+
const selectPlaceholderTemplateMode = createSelector(selectPlaceholderTemplateState, (state) => state.mode);
|
|
354
|
+
|
|
355
|
+
const placeholderTemplateStorageDeserializer = (rawObject) => {
|
|
356
|
+
if (!rawObject || !rawObject.ids) {
|
|
357
|
+
return placeholderTemplateInitialState;
|
|
358
|
+
}
|
|
359
|
+
const storeObject = placeholderTemplateAdapter.getInitialState(rawObject);
|
|
360
|
+
for (const id of rawObject.ids) {
|
|
361
|
+
storeObject.entities[id] = rawObject.entities[id];
|
|
362
|
+
}
|
|
363
|
+
return storeObject;
|
|
364
|
+
};
|
|
365
|
+
const placeholderTemplateStorageSync = {
|
|
366
|
+
deserialize: placeholderTemplateStorageDeserializer
|
|
367
|
+
};
|
|
368
|
+
|
|
55
369
|
const OTTER_COMPONENTS_DEVTOOLS_DEFAULT_OPTIONS = {
|
|
56
370
|
isActivatedOnBootstrap: false
|
|
57
371
|
};
|
|
@@ -162,7 +476,8 @@ const getOtterLikeComponentInfo = (componentClassInstance, host) => {
|
|
|
162
476
|
const translations = getTranslations(host);
|
|
163
477
|
const analytics = getAnalyticEvents(host);
|
|
164
478
|
return {
|
|
165
|
-
|
|
479
|
+
// Cannot use anymore `constructor.name` else all components are named `_a`
|
|
480
|
+
componentName: componentClassInstance.constructor.ɵcmp?.debugInfo?.className || componentClassInstance.constructor.name,
|
|
166
481
|
configId,
|
|
167
482
|
translations,
|
|
168
483
|
analytics
|
|
@@ -260,8 +575,7 @@ class OtterInspectorService {
|
|
|
260
575
|
this.inspectorDiv.style.height = `${rect.height}px`;
|
|
261
576
|
this.inspectorDiv.style.top = `${rect.top}px`;
|
|
262
577
|
this.inspectorDiv.style.left = `${rect.left}px`;
|
|
263
|
-
|
|
264
|
-
this.inspectorDiv.firstChild.textContent = `<${this.selectedComponent.component.constructor.name}>`;
|
|
578
|
+
this.inspectorDiv.firstChild.textContent = `<${this.selectedComponent.componentName}>`;
|
|
265
579
|
}
|
|
266
580
|
}
|
|
267
581
|
unHighlight() {
|
|
@@ -335,8 +649,9 @@ class OtterInspectorService {
|
|
|
335
649
|
}
|
|
336
650
|
|
|
337
651
|
class ComponentsDevtoolsMessageService {
|
|
338
|
-
constructor(logger, options) {
|
|
652
|
+
constructor(logger, store, options) {
|
|
339
653
|
this.logger = logger;
|
|
654
|
+
this.store = store;
|
|
340
655
|
this.subscriptions = new Subscription();
|
|
341
656
|
this.sendMessage = (sendOtterMessage);
|
|
342
657
|
this.options = {
|
|
@@ -360,405 +675,122 @@ class ComponentsDevtoolsMessageService {
|
|
|
360
675
|
}
|
|
361
676
|
async sendCurrentSelectedComponent() {
|
|
362
677
|
const selectComponentInfo = await firstValueFrom(this.inspectorService.otterLikeComponentInfoToBeSent$);
|
|
363
|
-
if (selectComponentInfo) {
|
|
364
|
-
this.sendMessage('selectedComponentInfo', selectComponentInfo);
|
|
365
|
-
}
|
|
366
|
-
}
|
|
367
|
-
/**
|
|
368
|
-
* Function to trigger a re-send a requested messages to the Otter Chrome DevTools extension
|
|
369
|
-
* @param only restricted list of messages to re-send
|
|
370
|
-
*/
|
|
371
|
-
handleReEmitRequest(only) {
|
|
372
|
-
if (!only || only.includes('selectedComponentInfo')) {
|
|
373
|
-
void this.sendCurrentSelectedComponent();
|
|
374
|
-
}
|
|
375
|
-
}
|
|
376
|
-
/**
|
|
377
|
-
* Function to handle the incoming messages from Otter Chrome DevTools extension
|
|
378
|
-
* @param event Event coming from the Otter Chrome DevTools extension
|
|
379
|
-
* @param message
|
|
380
|
-
*/
|
|
381
|
-
async handleEvents(message) {
|
|
382
|
-
this.logger.debug('Message handling by the components service', message);
|
|
383
|
-
switch (message.dataType) {
|
|
384
|
-
case 'connect': {
|
|
385
|
-
await this.connectPlugin();
|
|
386
|
-
break;
|
|
387
|
-
}
|
|
388
|
-
case 'requestMessages': {
|
|
389
|
-
this.handleReEmitRequest(message.only);
|
|
390
|
-
break;
|
|
391
|
-
}
|
|
392
|
-
case 'toggleInspector': {
|
|
393
|
-
this.inspectorService.toggleInspector(message.isRunning);
|
|
394
|
-
break;
|
|
395
|
-
}
|
|
396
|
-
default: {
|
|
397
|
-
this.logger.warn('Message ignored by the components service', message);
|
|
398
|
-
}
|
|
399
|
-
}
|
|
400
|
-
}
|
|
401
|
-
/** @inheritDoc */
|
|
402
|
-
activate() {
|
|
403
|
-
this.subscriptions.add(fromEvent(window, 'message').pipe(filterMessageContent(isComponentsMessage)).subscribe((e) => this.handleEvents(e)));
|
|
404
|
-
this.inspectorService.prepareInspector();
|
|
405
|
-
this.subscriptions.add(this.inspectorService.otterLikeComponentInfoToBeSent$
|
|
406
|
-
.pipe(filter((info) => !!info)).subscribe((info) => this.sendMessage('selectedComponentInfo', info)));
|
|
407
|
-
}
|
|
408
|
-
/** @inheritDoc */
|
|
409
|
-
ngOnDestroy() {
|
|
410
|
-
this.subscriptions.unsubscribe();
|
|
411
|
-
}
|
|
412
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: ComponentsDevtoolsMessageService, deps: [{ token: i1.LoggerService }, { token: OTTER_COMPONENTS_DEVTOOLS_OPTIONS, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
413
|
-
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: ComponentsDevtoolsMessageService, providedIn: 'root' }); }
|
|
414
|
-
}
|
|
415
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: ComponentsDevtoolsMessageService, decorators: [{
|
|
416
|
-
type: Injectable,
|
|
417
|
-
args: [{
|
|
418
|
-
providedIn: 'root'
|
|
419
|
-
}]
|
|
420
|
-
}], ctorParameters: () => [{ type: i1.LoggerService }, { type: undefined, decorators: [{
|
|
421
|
-
type: Optional
|
|
422
|
-
}, {
|
|
423
|
-
type: Inject,
|
|
424
|
-
args: [OTTER_COMPONENTS_DEVTOOLS_OPTIONS]
|
|
425
|
-
}] }] });
|
|
426
|
-
|
|
427
|
-
class ComponentsDevtoolsModule {
|
|
428
|
-
/**
|
|
429
|
-
* Initialize Otter Devtools
|
|
430
|
-
* @param options
|
|
431
|
-
*/
|
|
432
|
-
static instrument(options) {
|
|
433
|
-
return {
|
|
434
|
-
ngModule: ComponentsDevtoolsModule,
|
|
435
|
-
providers: [
|
|
436
|
-
{ provide: OTTER_COMPONENTS_DEVTOOLS_OPTIONS, useValue: { ...OTTER_COMPONENTS_DEVTOOLS_DEFAULT_OPTIONS, ...options }, multi: false },
|
|
437
|
-
ComponentsDevtoolsMessageService
|
|
438
|
-
]
|
|
439
|
-
};
|
|
440
|
-
}
|
|
441
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: ComponentsDevtoolsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
442
|
-
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.0.8", ngImport: i0, type: ComponentsDevtoolsModule, imports: [StoreModule] }); }
|
|
443
|
-
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: ComponentsDevtoolsModule, providers: [
|
|
444
|
-
{ provide: OTTER_COMPONENTS_DEVTOOLS_OPTIONS, useValue: OTTER_COMPONENTS_DEVTOOLS_DEFAULT_OPTIONS },
|
|
445
|
-
ComponentsDevtoolsMessageService
|
|
446
|
-
], imports: [StoreModule] }); }
|
|
447
|
-
}
|
|
448
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: ComponentsDevtoolsModule, decorators: [{
|
|
449
|
-
type: NgModule,
|
|
450
|
-
args: [{
|
|
451
|
-
imports: [
|
|
452
|
-
StoreModule
|
|
453
|
-
],
|
|
454
|
-
providers: [
|
|
455
|
-
{ provide: OTTER_COMPONENTS_DEVTOOLS_OPTIONS, useValue: OTTER_COMPONENTS_DEVTOOLS_DEFAULT_OPTIONS },
|
|
456
|
-
ComponentsDevtoolsMessageService
|
|
457
|
-
]
|
|
458
|
-
}]
|
|
459
|
-
}] });
|
|
460
|
-
|
|
461
|
-
const ACTION_DELETE_ENTITY = '[PlaceholderTemplate] delete entity';
|
|
462
|
-
const ACTION_SET_ENTITY = '[PlaceholderTemplate] set entity';
|
|
463
|
-
/** Action to delete a specific entity */
|
|
464
|
-
const deletePlaceholderTemplateEntity = createAction(ACTION_DELETE_ENTITY, props());
|
|
465
|
-
/** Action to clear all placeholderTemplate and fill the store with the payload */
|
|
466
|
-
const setPlaceholderTemplateEntity = createAction(ACTION_SET_ENTITY, props());
|
|
467
|
-
|
|
468
|
-
/**
|
|
469
|
-
* PlaceholderTemplate Store adapter
|
|
470
|
-
*/
|
|
471
|
-
const placeholderTemplateAdapter = createEntityAdapter({
|
|
472
|
-
selectId: (model) => model.id
|
|
473
|
-
});
|
|
474
|
-
/**
|
|
475
|
-
* PlaceholderTemplate Store initial value
|
|
476
|
-
*/
|
|
477
|
-
const placeholderTemplateInitialState = placeholderTemplateAdapter.getInitialState();
|
|
478
|
-
/**
|
|
479
|
-
* List of basic actions for PlaceholderTemplate Store
|
|
480
|
-
*/
|
|
481
|
-
const placeholderTemplateReducerFeatures = [
|
|
482
|
-
on(setPlaceholderTemplateEntity, (state, payload) => placeholderTemplateAdapter.addOne(payload.entity, placeholderTemplateAdapter.removeOne(payload.entity.id, state))),
|
|
483
|
-
on(deletePlaceholderTemplateEntity, (state, payload) => {
|
|
484
|
-
const id = payload.id;
|
|
485
|
-
if (!id || !state.entities[id]) {
|
|
486
|
-
return state;
|
|
487
|
-
}
|
|
488
|
-
return placeholderTemplateAdapter.removeOne(id, state);
|
|
489
|
-
})
|
|
490
|
-
];
|
|
491
|
-
/**
|
|
492
|
-
* PlaceholderTemplate Store reducer
|
|
493
|
-
*/
|
|
494
|
-
const placeholderTemplateReducer = createReducer(placeholderTemplateInitialState, ...placeholderTemplateReducerFeatures);
|
|
495
|
-
|
|
496
|
-
/**
|
|
497
|
-
* Name of the PlaceholderTemplate Store
|
|
498
|
-
*/
|
|
499
|
-
const PLACEHOLDER_TEMPLATE_STORE_NAME = 'placeholderTemplate';
|
|
500
|
-
|
|
501
|
-
/** Token of the PlaceholderTemplate reducer */
|
|
502
|
-
const PLACEHOLDER_TEMPLATE_REDUCER_TOKEN = new InjectionToken('Feature PlaceholderTemplate Reducer');
|
|
503
|
-
/** Provide default reducer for PlaceholderTemplate store */
|
|
504
|
-
function getDefaultPlaceholderTemplateReducer() {
|
|
505
|
-
return placeholderTemplateReducer;
|
|
506
|
-
}
|
|
507
|
-
class PlaceholderTemplateStoreModule {
|
|
508
|
-
static forRoot(reducerFactory) {
|
|
509
|
-
return {
|
|
510
|
-
ngModule: PlaceholderTemplateStoreModule,
|
|
511
|
-
providers: [
|
|
512
|
-
{ provide: PLACEHOLDER_TEMPLATE_REDUCER_TOKEN, useFactory: reducerFactory }
|
|
513
|
-
]
|
|
514
|
-
};
|
|
515
|
-
}
|
|
516
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: PlaceholderTemplateStoreModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
517
|
-
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.0.8", ngImport: i0, type: PlaceholderTemplateStoreModule, imports: [i1$1.StoreFeatureModule] }); }
|
|
518
|
-
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: PlaceholderTemplateStoreModule, providers: [
|
|
519
|
-
{ provide: PLACEHOLDER_TEMPLATE_REDUCER_TOKEN, useFactory: getDefaultPlaceholderTemplateReducer }
|
|
520
|
-
], imports: [StoreModule.forFeature(PLACEHOLDER_TEMPLATE_STORE_NAME, PLACEHOLDER_TEMPLATE_REDUCER_TOKEN)] }); }
|
|
521
|
-
}
|
|
522
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: PlaceholderTemplateStoreModule, decorators: [{
|
|
523
|
-
type: NgModule,
|
|
524
|
-
args: [{
|
|
525
|
-
imports: [
|
|
526
|
-
StoreModule.forFeature(PLACEHOLDER_TEMPLATE_STORE_NAME, PLACEHOLDER_TEMPLATE_REDUCER_TOKEN)
|
|
527
|
-
],
|
|
528
|
-
providers: [
|
|
529
|
-
{ provide: PLACEHOLDER_TEMPLATE_REDUCER_TOKEN, useFactory: getDefaultPlaceholderTemplateReducer }
|
|
530
|
-
]
|
|
531
|
-
}]
|
|
532
|
-
}] });
|
|
533
|
-
|
|
534
|
-
const ACTION_FAIL_ENTITIES = '[PlaceholderRequest] fail entities';
|
|
535
|
-
const ACTION_SET_ENTITY_FROM_URL = '[PlaceholderRequest] set entity from url';
|
|
536
|
-
const ACTION_CANCEL_REQUEST = '[PlaceholderRequest] cancel request';
|
|
537
|
-
const ACTION_UPDATE_ENTITY = '[PlaceholderRequest] update entity';
|
|
538
|
-
const ACTION_UPDATE_ENTITY_SYNC = '[PlaceholderRequest] update entity sync';
|
|
539
|
-
/** Action to cancel a Request ID registered in the store. Can happen from effect based on a switchMap for instance */
|
|
540
|
-
const cancelPlaceholderRequest = createAction(ACTION_CANCEL_REQUEST, props());
|
|
541
|
-
/** Action to update failureStatus for PlaceholderRequestModels */
|
|
542
|
-
const failPlaceholderRequestEntity = createAction(ACTION_FAIL_ENTITIES, props());
|
|
543
|
-
/** Action to update an entity */
|
|
544
|
-
const updatePlaceholderRequestEntity = createAction(ACTION_UPDATE_ENTITY, props());
|
|
545
|
-
/** Action to update an entity without impact on request id */
|
|
546
|
-
const updatePlaceholderRequestEntitySync = createAction(ACTION_UPDATE_ENTITY_SYNC, props());
|
|
547
|
-
/** Action to update PlaceholderRequest with known IDs, will create the entity with only the url, the call will be created in the effect */
|
|
548
|
-
const setPlaceholderRequestEntityFromUrl = createAction(ACTION_SET_ENTITY_FROM_URL, asyncProps());
|
|
549
|
-
|
|
550
|
-
/**
|
|
551
|
-
* PlaceholderRequest Store adapter
|
|
552
|
-
*/
|
|
553
|
-
const placeholderRequestAdapter = createEntityAsyncRequestAdapter(createEntityAdapter({
|
|
554
|
-
selectId: (model) => model.id
|
|
555
|
-
}));
|
|
556
|
-
/**
|
|
557
|
-
* PlaceholderRequest Store initial value
|
|
558
|
-
*/
|
|
559
|
-
const placeholderRequestInitialState = placeholderRequestAdapter.getInitialState({
|
|
560
|
-
requestIds: []
|
|
561
|
-
});
|
|
562
|
-
/**
|
|
563
|
-
* Reducers of Placeholder request store that handles the call to the placeholder template URL
|
|
564
|
-
*/
|
|
565
|
-
const placeholderRequestReducerFeatures = [
|
|
566
|
-
on(cancelPlaceholderRequest, (state, action) => {
|
|
567
|
-
const id = action.id;
|
|
568
|
-
if (!id || !state.entities[id]) {
|
|
569
|
-
return state;
|
|
570
|
-
}
|
|
571
|
-
return placeholderRequestAdapter.updateOne({
|
|
572
|
-
id: action.id,
|
|
573
|
-
changes: asyncStoreItemAdapter.resolveRequest(state.entities[id], action.requestId)
|
|
574
|
-
}, asyncStoreItemAdapter.resolveRequest(state, action.requestId));
|
|
575
|
-
}),
|
|
576
|
-
on(updatePlaceholderRequestEntity, (state, action) => {
|
|
577
|
-
const currentEntity = state.entities[action.entity.id];
|
|
578
|
-
const newEntity = asyncStoreItemAdapter.resolveRequest({ ...action.entity, ...asyncStoreItemAdapter.extractAsyncStoreItem(currentEntity) }, action.requestId);
|
|
579
|
-
return placeholderRequestAdapter.updateOne({
|
|
580
|
-
id: newEntity.id,
|
|
581
|
-
changes: newEntity
|
|
582
|
-
}, asyncStoreItemAdapter.resolveRequest(state, action.requestId));
|
|
583
|
-
}),
|
|
584
|
-
on(updatePlaceholderRequestEntitySync, (state, action) => {
|
|
585
|
-
return placeholderRequestAdapter.updateOne({
|
|
586
|
-
id: action.entity.id,
|
|
587
|
-
changes: {
|
|
588
|
-
...action.entity
|
|
589
|
-
}
|
|
590
|
-
}, state);
|
|
591
|
-
}),
|
|
592
|
-
on(setPlaceholderRequestEntityFromUrl, (state, payload) => {
|
|
593
|
-
const currentEntity = state.entities[payload.id];
|
|
594
|
-
// Nothing to update if resolved URLs already match
|
|
595
|
-
if (currentEntity && currentEntity.resolvedUrl === payload.resolvedUrl) {
|
|
596
|
-
return state;
|
|
678
|
+
if (selectComponentInfo) {
|
|
679
|
+
this.sendMessage('selectedComponentInfo', selectComponentInfo);
|
|
597
680
|
}
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
681
|
+
}
|
|
682
|
+
sendIsComponentSelectionAvailable() {
|
|
683
|
+
this.sendMessage('isComponentSelectionAvailable', { available: !!window.ng });
|
|
684
|
+
}
|
|
685
|
+
/**
|
|
686
|
+
* Function to trigger a re-send a requested messages to the Otter Chrome DevTools extension
|
|
687
|
+
* @param only restricted list of messages to re-send
|
|
688
|
+
*/
|
|
689
|
+
handleReEmitRequest(only) {
|
|
690
|
+
if (!only) {
|
|
691
|
+
void this.sendCurrentSelectedComponent();
|
|
692
|
+
this.sendIsComponentSelectionAvailable();
|
|
693
|
+
return;
|
|
605
694
|
}
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
695
|
+
if (only.includes('selectedComponentInfo')) {
|
|
696
|
+
void this.sendCurrentSelectedComponent();
|
|
697
|
+
}
|
|
698
|
+
if (only.includes('isComponentSelectionAvailable')) {
|
|
699
|
+
this.sendIsComponentSelectionAvailable();
|
|
700
|
+
}
|
|
701
|
+
}
|
|
702
|
+
/**
|
|
703
|
+
* Function to handle the incoming messages from Otter Chrome DevTools extension
|
|
704
|
+
* @param event Event coming from the Otter Chrome DevTools extension
|
|
705
|
+
* @param message
|
|
706
|
+
*/
|
|
707
|
+
async handleEvents(message) {
|
|
708
|
+
this.logger.debug('Message handling by the components service', message);
|
|
709
|
+
switch (message.dataType) {
|
|
710
|
+
case 'connect': {
|
|
711
|
+
await this.connectPlugin();
|
|
712
|
+
break;
|
|
713
|
+
}
|
|
714
|
+
case 'requestMessages': {
|
|
715
|
+
this.handleReEmitRequest(message.only);
|
|
716
|
+
break;
|
|
717
|
+
}
|
|
718
|
+
case 'toggleInspector': {
|
|
719
|
+
this.inspectorService.toggleInspector(message.isRunning);
|
|
720
|
+
break;
|
|
721
|
+
}
|
|
722
|
+
case 'placeholderMode': {
|
|
723
|
+
this.store.dispatch(togglePlaceholderModeTemplate({ mode: message.mode }));
|
|
724
|
+
break;
|
|
725
|
+
}
|
|
726
|
+
default: {
|
|
727
|
+
this.logger.warn('Message ignored by the components service', message);
|
|
728
|
+
}
|
|
729
|
+
}
|
|
730
|
+
}
|
|
731
|
+
/** @inheritDoc */
|
|
732
|
+
activate() {
|
|
733
|
+
this.subscriptions.add(fromEvent(window, 'message').pipe(filterMessageContent(isComponentsMessage)).subscribe((e) => this.handleEvents(e)));
|
|
734
|
+
this.inspectorService.prepareInspector();
|
|
735
|
+
this.subscriptions.add(this.inspectorService.otterLikeComponentInfoToBeSent$
|
|
736
|
+
.pipe(filter((info) => !!info)).subscribe((info) => this.sendMessage('selectedComponentInfo', info)));
|
|
737
|
+
}
|
|
738
|
+
/** @inheritDoc */
|
|
739
|
+
ngOnDestroy() {
|
|
740
|
+
this.subscriptions.unsubscribe();
|
|
741
|
+
}
|
|
742
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.6", ngImport: i0, type: ComponentsDevtoolsMessageService, deps: [{ token: i1$1.LoggerService }, { token: i1.Store }, { token: OTTER_COMPONENTS_DEVTOOLS_OPTIONS, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
743
|
+
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.6", ngImport: i0, type: ComponentsDevtoolsMessageService, providedIn: 'root' }); }
|
|
627
744
|
}
|
|
628
|
-
|
|
629
|
-
|
|
745
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.6", ngImport: i0, type: ComponentsDevtoolsMessageService, decorators: [{
|
|
746
|
+
type: Injectable,
|
|
747
|
+
args: [{
|
|
748
|
+
providedIn: 'root'
|
|
749
|
+
}]
|
|
750
|
+
}], ctorParameters: () => [{ type: i1$1.LoggerService }, { type: i1.Store }, { type: undefined, decorators: [{
|
|
751
|
+
type: Optional
|
|
752
|
+
}, {
|
|
753
|
+
type: Inject,
|
|
754
|
+
args: [OTTER_COMPONENTS_DEVTOOLS_OPTIONS]
|
|
755
|
+
}] }] });
|
|
756
|
+
|
|
757
|
+
class ComponentsDevtoolsModule {
|
|
758
|
+
/**
|
|
759
|
+
* Initialize Otter Devtools
|
|
760
|
+
* @param options
|
|
761
|
+
*/
|
|
762
|
+
static instrument(options) {
|
|
630
763
|
return {
|
|
631
|
-
ngModule:
|
|
764
|
+
ngModule: ComponentsDevtoolsModule,
|
|
632
765
|
providers: [
|
|
633
|
-
{ provide:
|
|
766
|
+
{ provide: OTTER_COMPONENTS_DEVTOOLS_OPTIONS, useValue: { ...OTTER_COMPONENTS_DEVTOOLS_DEFAULT_OPTIONS, ...options }, multi: false },
|
|
767
|
+
ComponentsDevtoolsMessageService
|
|
634
768
|
]
|
|
635
769
|
};
|
|
636
770
|
}
|
|
637
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.
|
|
638
|
-
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
771
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.6", ngImport: i0, type: ComponentsDevtoolsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
772
|
+
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.6", ngImport: i0, type: ComponentsDevtoolsModule, imports: [StoreModule,
|
|
773
|
+
PlaceholderTemplateStoreModule] }); }
|
|
774
|
+
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.6", ngImport: i0, type: ComponentsDevtoolsModule, providers: [
|
|
775
|
+
{ provide: OTTER_COMPONENTS_DEVTOOLS_OPTIONS, useValue: OTTER_COMPONENTS_DEVTOOLS_DEFAULT_OPTIONS },
|
|
776
|
+
ComponentsDevtoolsMessageService
|
|
777
|
+
], imports: [StoreModule,
|
|
778
|
+
PlaceholderTemplateStoreModule] }); }
|
|
642
779
|
}
|
|
643
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.
|
|
780
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.6", ngImport: i0, type: ComponentsDevtoolsModule, decorators: [{
|
|
644
781
|
type: NgModule,
|
|
645
782
|
args: [{
|
|
646
783
|
imports: [
|
|
647
|
-
StoreModule
|
|
784
|
+
StoreModule,
|
|
785
|
+
PlaceholderTemplateStoreModule
|
|
648
786
|
],
|
|
649
787
|
providers: [
|
|
650
|
-
{ provide:
|
|
788
|
+
{ provide: OTTER_COMPONENTS_DEVTOOLS_OPTIONS, useValue: OTTER_COMPONENTS_DEVTOOLS_DEFAULT_OPTIONS },
|
|
789
|
+
ComponentsDevtoolsMessageService
|
|
651
790
|
]
|
|
652
791
|
}]
|
|
653
792
|
}] });
|
|
654
793
|
|
|
655
|
-
const selectPlaceholderRequestState = createFeatureSelector(PLACEHOLDER_REQUEST_STORE_NAME);
|
|
656
|
-
const { selectEntities: selectEntities$1 } = placeholderRequestAdapter.getSelectors();
|
|
657
|
-
/** Select the dictionary of PlaceholderRequest entities */
|
|
658
|
-
const selectPlaceholderRequestEntities = createSelector(selectPlaceholderRequestState, (state) => state && selectEntities$1(state));
|
|
659
|
-
/**
|
|
660
|
-
* Select a specific PlaceholderRequest entity using a raw url as id
|
|
661
|
-
* @param rawUrl
|
|
662
|
-
*/
|
|
663
|
-
const selectPlaceholderRequestEntityUsage = (rawUrl) => createSelector(selectPlaceholderRequestState, (state) => {
|
|
664
|
-
return state?.entities[rawUrl] ? state?.entities[rawUrl].used : undefined;
|
|
665
|
-
});
|
|
666
|
-
|
|
667
|
-
const placeholderRequestStorageSerializer = asyncEntitySerializer;
|
|
668
|
-
const placeholderRequestStorageDeserializer = (rawObject) => {
|
|
669
|
-
if (!rawObject || !rawObject.ids) {
|
|
670
|
-
return placeholderRequestInitialState;
|
|
671
|
-
}
|
|
672
|
-
const storeObject = placeholderRequestAdapter.getInitialState(rawObject);
|
|
673
|
-
for (const id of rawObject.ids) {
|
|
674
|
-
storeObject.entities[id] = rawObject.entities[id];
|
|
675
|
-
}
|
|
676
|
-
return storeObject;
|
|
677
|
-
};
|
|
678
|
-
const placeholderRequestStorageSync = {
|
|
679
|
-
serialize: placeholderRequestStorageSerializer,
|
|
680
|
-
deserialize: placeholderRequestStorageDeserializer
|
|
681
|
-
};
|
|
682
|
-
|
|
683
|
-
const { selectEntities } = placeholderTemplateAdapter.getSelectors();
|
|
684
|
-
const selectPlaceholderTemplateState = createFeatureSelector(PLACEHOLDER_TEMPLATE_STORE_NAME);
|
|
685
|
-
/** Select the dictionary of PlaceholderTemplate entities */
|
|
686
|
-
const selectPlaceholderTemplateEntities = createSelector(selectPlaceholderTemplateState, (state) => state && selectEntities(state));
|
|
687
|
-
/**
|
|
688
|
-
* Select a specific PlaceholderTemplate
|
|
689
|
-
* @param placeholderId
|
|
690
|
-
*/
|
|
691
|
-
const selectPlaceholderTemplateEntity = (placeholderId) => createSelector(selectPlaceholderTemplateState, (state) => state?.entities[placeholderId]);
|
|
692
|
-
/**
|
|
693
|
-
* Select the ordered rendered placeholder template full data (url, priority etc.) for a given placeholderId
|
|
694
|
-
* Return undefined if the placeholder is not found
|
|
695
|
-
* Returns {orderedRenderedTemplates: undefined, isPending: true} if any of the request is still pending
|
|
696
|
-
* @param placeholderId
|
|
697
|
-
*/
|
|
698
|
-
const selectSortedTemplates = (placeholderId) => createSelector(selectPlaceholderTemplateEntity(placeholderId), selectPlaceholderRequestState, (placeholderTemplate, placeholderRequestState) => {
|
|
699
|
-
if (!placeholderTemplate || !placeholderRequestState) {
|
|
700
|
-
return;
|
|
701
|
-
}
|
|
702
|
-
// The isPending will be considered true if any of the Url is still pending
|
|
703
|
-
let isPending = false;
|
|
704
|
-
const templates = [];
|
|
705
|
-
placeholderTemplate.urlsWithPriority.forEach(urlWithPriority => {
|
|
706
|
-
const placeholderRequest = placeholderRequestState.entities[urlWithPriority.rawUrl];
|
|
707
|
-
if (placeholderRequest) {
|
|
708
|
-
// If one of the items is pending, we will wait to display all contents at the same time
|
|
709
|
-
isPending = isPending || placeholderRequest.isPending;
|
|
710
|
-
// Templates in failure will be ignored from the list
|
|
711
|
-
if (!placeholderRequest.isFailure) {
|
|
712
|
-
templates.push({
|
|
713
|
-
rawUrl: urlWithPriority.rawUrl,
|
|
714
|
-
resolvedUrl: placeholderRequest.resolvedUrl,
|
|
715
|
-
priority: urlWithPriority.priority,
|
|
716
|
-
renderedTemplate: placeholderRequest.renderedTemplate
|
|
717
|
-
});
|
|
718
|
-
}
|
|
719
|
-
}
|
|
720
|
-
});
|
|
721
|
-
// No need to perform sorting if still pending
|
|
722
|
-
if (isPending) {
|
|
723
|
-
return { orderedTemplates: undefined, isPending };
|
|
724
|
-
}
|
|
725
|
-
// Sort templates by priority
|
|
726
|
-
const orderedTemplates = templates.sort((template1, template2) => {
|
|
727
|
-
return (template2.priority - template1.priority) || 1;
|
|
728
|
-
}).filter(templateData => !!templateData.renderedTemplate);
|
|
729
|
-
return { orderedTemplates, isPending };
|
|
730
|
-
});
|
|
731
|
-
/**
|
|
732
|
-
* Select the ordered rendered templates for a given placeholderId
|
|
733
|
-
* Return undefined if the placeholder is not found
|
|
734
|
-
* Returns {orderedRenderedTemplates: undefined, isPending: true} if any of the request is still pending
|
|
735
|
-
* @param placeholderId
|
|
736
|
-
* @deprecated Please use {@link selectSortedTemplates} instead
|
|
737
|
-
*/
|
|
738
|
-
const selectPlaceholderRenderedTemplates = (placeholderId) => createSelector(selectSortedTemplates(placeholderId), (placeholderData) => {
|
|
739
|
-
if (!placeholderData) {
|
|
740
|
-
return;
|
|
741
|
-
}
|
|
742
|
-
return {
|
|
743
|
-
orderedRenderedTemplates: placeholderData.orderedTemplates?.map(placeholder => placeholder.renderedTemplate),
|
|
744
|
-
isPending: placeholderData.isPending
|
|
745
|
-
};
|
|
746
|
-
});
|
|
747
|
-
|
|
748
|
-
const placeholderTemplateStorageDeserializer = (rawObject) => {
|
|
749
|
-
if (!rawObject || !rawObject.ids) {
|
|
750
|
-
return placeholderTemplateInitialState;
|
|
751
|
-
}
|
|
752
|
-
const storeObject = placeholderTemplateAdapter.getInitialState(rawObject);
|
|
753
|
-
for (const id of rawObject.ids) {
|
|
754
|
-
storeObject.entities[id] = rawObject.entities[id];
|
|
755
|
-
}
|
|
756
|
-
return storeObject;
|
|
757
|
-
};
|
|
758
|
-
const placeholderTemplateStorageSync = {
|
|
759
|
-
deserialize: placeholderTemplateStorageDeserializer
|
|
760
|
-
};
|
|
761
|
-
|
|
762
794
|
class C11nDirective {
|
|
763
795
|
/** The input setter */
|
|
764
796
|
set inputs(value) {
|
|
@@ -867,10 +899,12 @@ class C11nDirective {
|
|
|
867
899
|
*/
|
|
868
900
|
ngOnDestroy() {
|
|
869
901
|
this.componentSubscriptions.forEach((s) => s.unsubscribe());
|
|
870
|
-
this.componentRef
|
|
902
|
+
if (this.componentRef) {
|
|
903
|
+
this.componentRef.destroy();
|
|
904
|
+
}
|
|
871
905
|
}
|
|
872
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.
|
|
873
|
-
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.
|
|
906
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.6", ngImport: i0, type: C11nDirective, deps: [{ token: i0.ViewContainerRef }, { token: i0.KeyValueDiffers }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
907
|
+
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.3.6", type: C11nDirective, selector: "[c11n]", inputs: { component: "component", config: "config", formControl: "formControl", inputs: "inputs", outputs: "outputs" }, providers: [
|
|
874
908
|
{
|
|
875
909
|
provide: NG_VALUE_ACCESSOR,
|
|
876
910
|
useExisting: forwardRef((() => C11nDirective)),
|
|
@@ -883,7 +917,7 @@ class C11nDirective {
|
|
|
883
917
|
}
|
|
884
918
|
], usesOnChanges: true, ngImport: i0 }); }
|
|
885
919
|
}
|
|
886
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.
|
|
920
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.6", ngImport: i0, type: C11nDirective, decorators: [{
|
|
887
921
|
type: Directive,
|
|
888
922
|
args: [{
|
|
889
923
|
selector: '[c11n]',
|
|
@@ -940,10 +974,10 @@ class C11nService {
|
|
|
940
974
|
return typeof presenterConfig === 'string' && presenterConfig !== '' ? (this.presentersMap.get(presenterConfig) || defaultPres) : defaultPres;
|
|
941
975
|
}));
|
|
942
976
|
}
|
|
943
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.
|
|
944
|
-
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.
|
|
977
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.6", ngImport: i0, type: C11nService, deps: [{ token: C11N_PRESENTERS_MAP_TOKEN }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
978
|
+
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.6", ngImport: i0, type: C11nService }); }
|
|
945
979
|
}
|
|
946
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.
|
|
980
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.6", ngImport: i0, type: C11nService, decorators: [{
|
|
947
981
|
type: Injectable
|
|
948
982
|
}], ctorParameters: () => [{ type: Map, decorators: [{
|
|
949
983
|
type: Inject,
|
|
@@ -979,11 +1013,11 @@ class C11nModule {
|
|
|
979
1013
|
}]
|
|
980
1014
|
};
|
|
981
1015
|
}
|
|
982
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.
|
|
983
|
-
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.
|
|
984
|
-
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.
|
|
1016
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.6", ngImport: i0, type: C11nModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
1017
|
+
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.6", ngImport: i0, type: C11nModule, declarations: [C11nDirective], exports: [C11nDirective] }); }
|
|
1018
|
+
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.6", ngImport: i0, type: C11nModule }); }
|
|
985
1019
|
}
|
|
986
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.
|
|
1020
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.6", ngImport: i0, type: C11nModule, decorators: [{
|
|
987
1021
|
type: NgModule,
|
|
988
1022
|
args: [{
|
|
989
1023
|
declarations: [C11nDirective],
|
|
@@ -1004,10 +1038,10 @@ function registerCustomComponent(customComponentsMap, customComponentKey, custom
|
|
|
1004
1038
|
|
|
1005
1039
|
/** C11n directive mock */
|
|
1006
1040
|
class MockC11nDirective {
|
|
1007
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.
|
|
1008
|
-
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.
|
|
1041
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.6", ngImport: i0, type: MockC11nDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1042
|
+
/** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.3.6", type: MockC11nDirective, selector: "[c11n]", inputs: { config: "config", component: "component", inputs: "inputs", outputs: "outputs" }, ngImport: i0 }); }
|
|
1009
1043
|
}
|
|
1010
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.
|
|
1044
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.6", ngImport: i0, type: MockC11nDirective, decorators: [{
|
|
1011
1045
|
type: Directive,
|
|
1012
1046
|
args: [{
|
|
1013
1047
|
selector: '[c11n]',
|
|
@@ -1021,21 +1055,21 @@ class C11nMockService {
|
|
|
1021
1055
|
getPresenter(_defaultPres, _presKey) {
|
|
1022
1056
|
return (source) => source.pipe(mapTo(null));
|
|
1023
1057
|
}
|
|
1024
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.
|
|
1025
|
-
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.
|
|
1058
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.6", ngImport: i0, type: C11nMockService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1059
|
+
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.6", ngImport: i0, type: C11nMockService }); }
|
|
1026
1060
|
}
|
|
1027
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.
|
|
1061
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.6", ngImport: i0, type: C11nMockService, decorators: [{
|
|
1028
1062
|
type: Injectable
|
|
1029
1063
|
}] });
|
|
1030
1064
|
/**
|
|
1031
1065
|
* The purpose of this module is to be imported in the unit tests of the components which are using c11n directive
|
|
1032
1066
|
*/
|
|
1033
1067
|
class C11nMockModule {
|
|
1034
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.
|
|
1035
|
-
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.
|
|
1036
|
-
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.
|
|
1068
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.6", ngImport: i0, type: C11nMockModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
1069
|
+
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.6", ngImport: i0, type: C11nMockModule, declarations: [MockC11nDirective], exports: [MockC11nDirective] }); }
|
|
1070
|
+
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.6", ngImport: i0, type: C11nMockModule, providers: [{ provide: C11nService, useClass: C11nMockService }] }); }
|
|
1037
1071
|
}
|
|
1038
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.
|
|
1072
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.6", ngImport: i0, type: C11nMockModule, decorators: [{
|
|
1039
1073
|
type: NgModule,
|
|
1040
1074
|
args: [{
|
|
1041
1075
|
declarations: [MockC11nDirective],
|
|
@@ -1044,26 +1078,40 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImpor
|
|
|
1044
1078
|
}]
|
|
1045
1079
|
}] });
|
|
1046
1080
|
|
|
1047
|
-
class
|
|
1081
|
+
class O3rCapitalizePipe {
|
|
1048
1082
|
transform(value) {
|
|
1049
1083
|
const val = value && value.toString && value.toString();
|
|
1050
1084
|
const firstLetter = val && val.charAt(0);
|
|
1051
1085
|
return firstLetter ? firstLetter.toUpperCase() + val.slice(1) : value;
|
|
1052
1086
|
}
|
|
1053
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.
|
|
1054
|
-
/** @nocollapse */ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "17.
|
|
1087
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.6", ngImport: i0, type: O3rCapitalizePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
1088
|
+
/** @nocollapse */ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "17.3.6", ngImport: i0, type: O3rCapitalizePipe, isStandalone: true, name: "o3rCapitalize" }); }
|
|
1089
|
+
}
|
|
1090
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.6", ngImport: i0, type: O3rCapitalizePipe, decorators: [{
|
|
1091
|
+
type: Pipe,
|
|
1092
|
+
args: [{ name: 'o3rCapitalize', standalone: true }]
|
|
1093
|
+
}] });
|
|
1094
|
+
/**
|
|
1095
|
+
* @deprecated please use O3rCapitalizePipe, will be removed in v12.
|
|
1096
|
+
*/
|
|
1097
|
+
class CapitalizePipe extends O3rCapitalizePipe {
|
|
1098
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.6", ngImport: i0, type: CapitalizePipe, deps: null, target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
1099
|
+
/** @nocollapse */ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "17.3.6", ngImport: i0, type: CapitalizePipe, name: "capitalize" }); }
|
|
1055
1100
|
}
|
|
1056
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.
|
|
1101
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.6", ngImport: i0, type: CapitalizePipe, decorators: [{
|
|
1057
1102
|
type: Pipe,
|
|
1058
1103
|
args: [{ name: 'capitalize' }]
|
|
1059
1104
|
}] });
|
|
1060
1105
|
|
|
1106
|
+
/**
|
|
1107
|
+
* @deprecated please use O3rCapitalizePipe, will be removed in v12.
|
|
1108
|
+
*/
|
|
1061
1109
|
class CapitalizePipeModule {
|
|
1062
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.
|
|
1063
|
-
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.
|
|
1064
|
-
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.
|
|
1110
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.6", ngImport: i0, type: CapitalizePipeModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
1111
|
+
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.6", ngImport: i0, type: CapitalizePipeModule, declarations: [CapitalizePipe], exports: [CapitalizePipe] }); }
|
|
1112
|
+
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.6", ngImport: i0, type: CapitalizePipeModule }); }
|
|
1065
1113
|
}
|
|
1066
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.
|
|
1114
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.6", ngImport: i0, type: CapitalizePipeModule, decorators: [{
|
|
1067
1115
|
type: NgModule,
|
|
1068
1116
|
args: [{
|
|
1069
1117
|
declarations: [CapitalizePipe],
|
|
@@ -1106,7 +1154,7 @@ function padNum(num, digits) {
|
|
|
1106
1154
|
/**
|
|
1107
1155
|
* Converts a duration in seconds into the HH:mm format
|
|
1108
1156
|
*/
|
|
1109
|
-
class
|
|
1157
|
+
class O3rDurationPipe {
|
|
1110
1158
|
/**
|
|
1111
1159
|
* @param value the value in seconds
|
|
1112
1160
|
* @param pattern the desired output format.
|
|
@@ -1145,20 +1193,35 @@ class DurationPipe {
|
|
|
1145
1193
|
return result.replace(matchedPatternToReplace, padded);
|
|
1146
1194
|
}, pattern);
|
|
1147
1195
|
}
|
|
1148
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.
|
|
1149
|
-
/** @nocollapse */ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "17.
|
|
1196
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.6", ngImport: i0, type: O3rDurationPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
1197
|
+
/** @nocollapse */ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "17.3.6", ngImport: i0, type: O3rDurationPipe, isStandalone: true, name: "o3rDuration" }); }
|
|
1198
|
+
}
|
|
1199
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.6", ngImport: i0, type: O3rDurationPipe, decorators: [{
|
|
1200
|
+
type: Pipe,
|
|
1201
|
+
args: [{ name: 'o3rDuration', standalone: true }]
|
|
1202
|
+
}] });
|
|
1203
|
+
/**
|
|
1204
|
+
* Converts a duration in seconds into the HH:mm format
|
|
1205
|
+
* @deprecated please use O3rDurationPipe, will be removed in v12.
|
|
1206
|
+
*/
|
|
1207
|
+
class DurationPipe extends O3rDurationPipe {
|
|
1208
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.6", ngImport: i0, type: DurationPipe, deps: null, target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
1209
|
+
/** @nocollapse */ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "17.3.6", ngImport: i0, type: DurationPipe, name: "duration" }); }
|
|
1150
1210
|
}
|
|
1151
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.
|
|
1211
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.6", ngImport: i0, type: DurationPipe, decorators: [{
|
|
1152
1212
|
type: Pipe,
|
|
1153
1213
|
args: [{ name: 'duration' }]
|
|
1154
1214
|
}] });
|
|
1155
1215
|
|
|
1216
|
+
/**
|
|
1217
|
+
* @deprecated please use O3rDurationPipe, will be removed in v12.
|
|
1218
|
+
*/
|
|
1156
1219
|
class DurationPipeModule {
|
|
1157
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.
|
|
1158
|
-
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.
|
|
1159
|
-
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.
|
|
1220
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.6", ngImport: i0, type: DurationPipeModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
1221
|
+
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.6", ngImport: i0, type: DurationPipeModule, declarations: [DurationPipe], exports: [DurationPipe] }); }
|
|
1222
|
+
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.6", ngImport: i0, type: DurationPipeModule }); }
|
|
1160
1223
|
}
|
|
1161
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.
|
|
1224
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.6", ngImport: i0, type: DurationPipeModule, decorators: [{
|
|
1162
1225
|
type: NgModule,
|
|
1163
1226
|
args: [{
|
|
1164
1227
|
declarations: [DurationPipe],
|
|
@@ -1166,27 +1229,42 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImpor
|
|
|
1166
1229
|
}]
|
|
1167
1230
|
}] });
|
|
1168
1231
|
|
|
1169
|
-
class
|
|
1232
|
+
class O3rKeepWhiteSpacePipe {
|
|
1170
1233
|
transform(value) {
|
|
1171
1234
|
return value.replace(/\s/g, ' ');
|
|
1172
1235
|
}
|
|
1173
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.
|
|
1174
|
-
/** @nocollapse */ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "17.
|
|
1236
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.6", ngImport: i0, type: O3rKeepWhiteSpacePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
1237
|
+
/** @nocollapse */ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "17.3.6", ngImport: i0, type: O3rKeepWhiteSpacePipe, name: "o3rKeepWhiteSpace" }); }
|
|
1238
|
+
}
|
|
1239
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.6", ngImport: i0, type: O3rKeepWhiteSpacePipe, decorators: [{
|
|
1240
|
+
type: Pipe,
|
|
1241
|
+
args: [{
|
|
1242
|
+
name: 'o3rKeepWhiteSpace'
|
|
1243
|
+
}]
|
|
1244
|
+
}] });
|
|
1245
|
+
/**
|
|
1246
|
+
* @deprecated please use O3rKeepWhiteSpacePipe, will be removed in v12.
|
|
1247
|
+
*/
|
|
1248
|
+
class KeepWhiteSpacePipe extends O3rKeepWhiteSpacePipe {
|
|
1249
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.6", ngImport: i0, type: KeepWhiteSpacePipe, deps: null, target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
1250
|
+
/** @nocollapse */ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "17.3.6", ngImport: i0, type: KeepWhiteSpacePipe, name: "keepWhiteSpace" }); }
|
|
1175
1251
|
}
|
|
1176
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.
|
|
1252
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.6", ngImport: i0, type: KeepWhiteSpacePipe, decorators: [{
|
|
1177
1253
|
type: Pipe,
|
|
1178
1254
|
args: [{
|
|
1179
|
-
name: 'keepWhiteSpace'
|
|
1180
|
-
pure: true
|
|
1255
|
+
name: 'keepWhiteSpace'
|
|
1181
1256
|
}]
|
|
1182
1257
|
}] });
|
|
1183
1258
|
|
|
1259
|
+
/**
|
|
1260
|
+
* @deprecated please use O3rKeepWhiteSpacePipe, will be removed in v12.
|
|
1261
|
+
*/
|
|
1184
1262
|
class KeepWhiteSpacePipeModule {
|
|
1185
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.
|
|
1186
|
-
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.
|
|
1187
|
-
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.
|
|
1263
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.6", ngImport: i0, type: KeepWhiteSpacePipeModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
1264
|
+
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.6", ngImport: i0, type: KeepWhiteSpacePipeModule, declarations: [KeepWhiteSpacePipe], exports: [KeepWhiteSpacePipe] }); }
|
|
1265
|
+
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.6", ngImport: i0, type: KeepWhiteSpacePipeModule }); }
|
|
1188
1266
|
}
|
|
1189
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.
|
|
1267
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.6", ngImport: i0, type: KeepWhiteSpacePipeModule, decorators: [{
|
|
1190
1268
|
type: NgModule,
|
|
1191
1269
|
args: [{
|
|
1192
1270
|
declarations: [KeepWhiteSpacePipe],
|
|
@@ -1194,36 +1272,53 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImpor
|
|
|
1194
1272
|
}]
|
|
1195
1273
|
}] });
|
|
1196
1274
|
|
|
1197
|
-
|
|
1275
|
+
const escapeRegExp = (str) => str.replace(/[-[\]/{}()*+?.\\^$|]/g, '\\$&');
|
|
1276
|
+
class O3rReplaceWithBoldPipe {
|
|
1198
1277
|
transform(value, inputText) {
|
|
1199
1278
|
if (inputText) {
|
|
1200
|
-
const regexp = new RegExp(
|
|
1279
|
+
const regexp = new RegExp(escapeRegExp(inputText.trim()), 'gi');
|
|
1201
1280
|
return value.replace(regexp, (match) => `<strong>${match}</strong>`);
|
|
1202
1281
|
}
|
|
1203
1282
|
else {
|
|
1204
1283
|
return value;
|
|
1205
1284
|
}
|
|
1206
1285
|
}
|
|
1286
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.6", ngImport: i0, type: O3rReplaceWithBoldPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
1287
|
+
/** @nocollapse */ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "17.3.6", ngImport: i0, type: O3rReplaceWithBoldPipe, isStandalone: true, name: "o3rReplaceWithBold" }); }
|
|
1288
|
+
}
|
|
1289
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.6", ngImport: i0, type: O3rReplaceWithBoldPipe, decorators: [{
|
|
1290
|
+
type: Pipe,
|
|
1291
|
+
args: [{
|
|
1292
|
+
name: 'o3rReplaceWithBold',
|
|
1293
|
+
standalone: true
|
|
1294
|
+
}]
|
|
1295
|
+
}] });
|
|
1296
|
+
/**
|
|
1297
|
+
* @deprecated please use O3rReplaceWithBoldPipe, will be removed in v12.
|
|
1298
|
+
*/
|
|
1299
|
+
class ReplaceWithBoldPipe extends O3rReplaceWithBoldPipe {
|
|
1207
1300
|
escapeRegExp(str) {
|
|
1208
|
-
return str
|
|
1301
|
+
return escapeRegExp(str);
|
|
1209
1302
|
}
|
|
1210
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.
|
|
1211
|
-
/** @nocollapse */ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "17.
|
|
1303
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.6", ngImport: i0, type: ReplaceWithBoldPipe, deps: null, target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
1304
|
+
/** @nocollapse */ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "17.3.6", ngImport: i0, type: ReplaceWithBoldPipe, name: "replaceWithBold" }); }
|
|
1212
1305
|
}
|
|
1213
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.
|
|
1306
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.6", ngImport: i0, type: ReplaceWithBoldPipe, decorators: [{
|
|
1214
1307
|
type: Pipe,
|
|
1215
1308
|
args: [{
|
|
1216
|
-
name: 'replaceWithBold'
|
|
1217
|
-
pure: true
|
|
1309
|
+
name: 'replaceWithBold'
|
|
1218
1310
|
}]
|
|
1219
1311
|
}] });
|
|
1220
1312
|
|
|
1313
|
+
/**
|
|
1314
|
+
* @deprecated please use O3rReplaceWithBoldPipe, will be removed in v12.
|
|
1315
|
+
*/
|
|
1221
1316
|
class ReplaceWithBoldPipeModule {
|
|
1222
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.
|
|
1223
|
-
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.
|
|
1224
|
-
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.
|
|
1317
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.6", ngImport: i0, type: ReplaceWithBoldPipeModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
1318
|
+
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.6", ngImport: i0, type: ReplaceWithBoldPipeModule, declarations: [ReplaceWithBoldPipe], exports: [ReplaceWithBoldPipe] }); }
|
|
1319
|
+
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.6", ngImport: i0, type: ReplaceWithBoldPipeModule }); }
|
|
1225
1320
|
}
|
|
1226
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.
|
|
1321
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.6", ngImport: i0, type: ReplaceWithBoldPipeModule, decorators: [{
|
|
1227
1322
|
type: NgModule,
|
|
1228
1323
|
args: [{
|
|
1229
1324
|
declarations: [ReplaceWithBoldPipe],
|
|
@@ -1249,6 +1344,7 @@ class PlaceholderComponent {
|
|
|
1249
1344
|
this.id$ = new BehaviorSubject(undefined);
|
|
1250
1345
|
this.afterViewInit$ = new Subject();
|
|
1251
1346
|
this.messages$ = new ReplaySubject(1);
|
|
1347
|
+
this.mode = this.store.selectSignal(selectPlaceholderTemplateMode);
|
|
1252
1348
|
}
|
|
1253
1349
|
/** @inheritdoc */
|
|
1254
1350
|
ngOnInit() {
|
|
@@ -1294,34 +1390,31 @@ class PlaceholderComponent {
|
|
|
1294
1390
|
this.afterViewInit$.complete();
|
|
1295
1391
|
this.subscription.unsubscribe();
|
|
1296
1392
|
}
|
|
1297
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.
|
|
1298
|
-
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
1393
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.6", ngImport: i0, type: PlaceholderComponent, deps: [{ token: i1.Store }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1394
|
+
/** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.6", type: PlaceholderComponent, selector: "o3r-placeholder", inputs: { id: "id" }, host: { properties: { "class.debug": "mode() === 'debug'" } }, ngImport: i0, template: "<ng-template #projection>\n <ng-content></ng-content>\n</ng-template>\n@switch (mode()) {\n @case ('debug') {\n <span class=\"placehoder-id\">{{ id$ | async }}</span>\n }\n @case ('pending') {\n <ng-container *ngTemplateOutlet=\"projection\" />\n }\n @case ('normal') {\n @if (isPending) {\n <ng-container *ngTemplateOutlet=\"projection\" />\n } @else {\n <div [innerHTML]=\"template\"></div>\n }\n }\n}\n", styles: [".debug{padding:15px;text-align:center;border:2px dashed var(--o3r-placeholder-debug-color, #a65c27);border-radius:10px;width:100%;background:var(--o3r-placeholder-background, #fff2ea);border-style:dashed;color:var(--o3r-placeholder-debug-color, #a65c27);font-size:larger}\n"], dependencies: [{ kind: "directive", type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "pipe", type: i2.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
1299
1395
|
}
|
|
1300
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.
|
|
1396
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.6", ngImport: i0, type: PlaceholderComponent, decorators: [{
|
|
1301
1397
|
type: Component,
|
|
1302
|
-
args: [{
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
encapsulation: ViewEncapsulation.None
|
|
1308
|
-
}]
|
|
1309
|
-
}], ctorParameters: () => [{ type: i1$1.Store }, { type: i0.ChangeDetectorRef }], propDecorators: { id: [{
|
|
1398
|
+
args: [{ selector: 'o3r-placeholder', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, host: {
|
|
1399
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
1400
|
+
'[class.debug]': `mode() === 'debug'`
|
|
1401
|
+
}, template: "<ng-template #projection>\n <ng-content></ng-content>\n</ng-template>\n@switch (mode()) {\n @case ('debug') {\n <span class=\"placehoder-id\">{{ id$ | async }}</span>\n }\n @case ('pending') {\n <ng-container *ngTemplateOutlet=\"projection\" />\n }\n @case ('normal') {\n @if (isPending) {\n <ng-container *ngTemplateOutlet=\"projection\" />\n } @else {\n <div [innerHTML]=\"template\"></div>\n }\n }\n}\n", styles: [".debug{padding:15px;text-align:center;border:2px dashed var(--o3r-placeholder-debug-color, #a65c27);border-radius:10px;width:100%;background:var(--o3r-placeholder-background, #fff2ea);border-style:dashed;color:var(--o3r-placeholder-debug-color, #a65c27);font-size:larger}\n"] }]
|
|
1402
|
+
}], ctorParameters: () => [{ type: i1.Store }, { type: i0.ChangeDetectorRef }], propDecorators: { id: [{
|
|
1310
1403
|
type: Input
|
|
1311
1404
|
}] } });
|
|
1312
1405
|
|
|
1313
1406
|
class PlaceholderModule {
|
|
1314
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.
|
|
1315
|
-
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.
|
|
1407
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.6", ngImport: i0, type: PlaceholderModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
1408
|
+
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.6", ngImport: i0, type: PlaceholderModule, declarations: [PlaceholderComponent], imports: [CommonModule,
|
|
1316
1409
|
StoreModule,
|
|
1317
1410
|
PlaceholderTemplateStoreModule,
|
|
1318
1411
|
PlaceholderRequestStoreModule], exports: [PlaceholderComponent] }); }
|
|
1319
|
-
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.
|
|
1412
|
+
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.6", ngImport: i0, type: PlaceholderModule, imports: [CommonModule,
|
|
1320
1413
|
StoreModule,
|
|
1321
1414
|
PlaceholderTemplateStoreModule,
|
|
1322
1415
|
PlaceholderRequestStoreModule] }); }
|
|
1323
1416
|
}
|
|
1324
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.
|
|
1417
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.6", ngImport: i0, type: PlaceholderModule, decorators: [{
|
|
1325
1418
|
type: NgModule,
|
|
1326
1419
|
args: [{
|
|
1327
1420
|
imports: [
|
|
@@ -1339,5 +1432,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImpor
|
|
|
1339
1432
|
* Generated bundle index. Do not edit.
|
|
1340
1433
|
*/
|
|
1341
1434
|
|
|
1342
|
-
export { C11N_PRESENTERS_MAP_TOKEN, C11N_REGISTER_FUNC_TOKEN, C11nDirective, C11nMockModule, C11nMockService, C11nModule, C11nService, CapitalizePipe, CapitalizePipeModule, ComponentsDevtoolsMessageService, ComponentsDevtoolsModule, DurationPipe, DurationPipeModule, INSPECTOR_CLASS, KeepWhiteSpacePipe, KeepWhiteSpacePipeModule, MockC11nDirective, OTTER_COMPONENTS_DEVTOOLS_DEFAULT_OPTIONS, OTTER_COMPONENTS_DEVTOOLS_OPTIONS, OtterInspectorService, PLACEHOLDER_REQUEST_REDUCER_TOKEN, PLACEHOLDER_REQUEST_STORE_NAME, PLACEHOLDER_TEMPLATE_REDUCER_TOKEN, PLACEHOLDER_TEMPLATE_STORE_NAME, PlaceholderComponent, PlaceholderModule, PlaceholderRequestStoreModule, PlaceholderTemplateStoreModule, ReplaceWithBoldPipe, ReplaceWithBoldPipeModule, cancelPlaceholderRequest, createC11nService, deletePlaceholderTemplateEntity, failPlaceholderRequestEntity, getAnalyticEvents, getAnalyticEventsRec, getConfigId, getDefaultPlaceholderTemplateReducer, getDefaultplaceholderRequestReducer, getOtterLikeComponentInfo, getTranslations, getTranslationsRec, isComponentsMessage, isContainer, lazyArray, placeholderRequestAdapter, placeholderRequestInitialState, placeholderRequestReducer, placeholderRequestReducerFeatures, placeholderRequestStorageDeserializer, placeholderRequestStorageSerializer, placeholderRequestStorageSync, placeholderTemplateAdapter, placeholderTemplateInitialState, placeholderTemplateReducer, placeholderTemplateReducerFeatures, placeholderTemplateStorageDeserializer, placeholderTemplateStorageSync, registerCustomComponent, selectPlaceholderRenderedTemplates, selectPlaceholderRequestEntities, selectPlaceholderRequestEntityUsage, selectPlaceholderRequestState, selectPlaceholderTemplateEntities, selectPlaceholderTemplateEntity, selectPlaceholderTemplateState, selectSortedTemplates, setPlaceholderRequestEntityFromUrl, setPlaceholderTemplateEntity, updatePlaceholderRequestEntity, updatePlaceholderRequestEntitySync };
|
|
1435
|
+
export { C11N_PRESENTERS_MAP_TOKEN, C11N_REGISTER_FUNC_TOKEN, C11nDirective, C11nMockModule, C11nMockService, C11nModule, C11nService, CapitalizePipe, CapitalizePipeModule, ComponentsDevtoolsMessageService, ComponentsDevtoolsModule, DurationPipe, DurationPipeModule, INSPECTOR_CLASS, KeepWhiteSpacePipe, KeepWhiteSpacePipeModule, MockC11nDirective, O3rCapitalizePipe, O3rDurationPipe, O3rKeepWhiteSpacePipe, O3rReplaceWithBoldPipe, OTTER_COMPONENTS_DEVTOOLS_DEFAULT_OPTIONS, OTTER_COMPONENTS_DEVTOOLS_OPTIONS, OtterInspectorService, PLACEHOLDER_REQUEST_REDUCER_TOKEN, PLACEHOLDER_REQUEST_STORE_NAME, PLACEHOLDER_TEMPLATE_REDUCER_TOKEN, PLACEHOLDER_TEMPLATE_STORE_NAME, PlaceholderComponent, PlaceholderModule, PlaceholderRequestStoreModule, PlaceholderTemplateStoreModule, ReplaceWithBoldPipe, ReplaceWithBoldPipeModule, cancelPlaceholderRequest, createC11nService, deletePlaceholderTemplateEntity, failPlaceholderRequestEntity, getAnalyticEvents, getAnalyticEventsRec, getConfigId, getDefaultPlaceholderTemplateReducer, getDefaultplaceholderRequestReducer, getOtterLikeComponentInfo, getTranslations, getTranslationsRec, isComponentsMessage, isContainer, lazyArray, placeholderRequestAdapter, placeholderRequestInitialState, placeholderRequestReducer, placeholderRequestReducerFeatures, placeholderRequestStorageDeserializer, placeholderRequestStorageSerializer, placeholderRequestStorageSync, placeholderTemplateAdapter, placeholderTemplateInitialState, placeholderTemplateReducer, placeholderTemplateReducerFeatures, placeholderTemplateStorageDeserializer, placeholderTemplateStorageSync, registerCustomComponent, selectPlaceholderRenderedTemplates, selectPlaceholderRequestEntities, selectPlaceholderRequestEntityUsage, selectPlaceholderRequestState, selectPlaceholderTemplateEntities, selectPlaceholderTemplateEntity, selectPlaceholderTemplateMode, selectPlaceholderTemplateState, selectSortedTemplates, setPlaceholderRequestEntityFromUrl, setPlaceholderTemplateEntity, togglePlaceholderModeTemplate, updatePlaceholderRequestEntity, updatePlaceholderRequestEntitySync };
|
|
1343
1436
|
//# sourceMappingURL=o3r-components.mjs.map
|