@o3r/dynamic-content 15.3.0-prerelease.9 → 15.3.0-rc.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/fesm2022/o3r-dynamic-content-fixtures-jasmine.mjs +25 -33
- package/fesm2022/o3r-dynamic-content-fixtures-jasmine.mjs.map +1 -1
- package/fesm2022/o3r-dynamic-content-fixtures-jest.mjs +25 -33
- package/fesm2022/o3r-dynamic-content-fixtures-jest.mjs.map +1 -1
- package/fesm2022/o3r-dynamic-content-rules-engine.mjs +90 -66
- package/fesm2022/o3r-dynamic-content-rules-engine.mjs.map +1 -1
- package/fesm2022/o3r-dynamic-content.mjs +412 -550
- package/fesm2022/o3r-dynamic-content.mjs.map +1 -1
- package/package.json +4 -4
- package/schematics/ng-add/schema.json +0 -3
- package/types/o3r-dynamic-content-fixtures-jasmine.d.ts +22 -25
- package/types/o3r-dynamic-content-fixtures-jasmine.d.ts.map +1 -1
- package/types/o3r-dynamic-content-fixtures-jest.d.ts +22 -25
- package/types/o3r-dynamic-content-fixtures-jest.d.ts.map +1 -1
- package/types/o3r-dynamic-content-rules-engine.d.ts +23 -29
- package/types/o3r-dynamic-content-rules-engine.d.ts.map +1 -1
- package/types/o3r-dynamic-content.d.ts +225 -245
- package/types/o3r-dynamic-content.d.ts.map +1 -1
|
@@ -1,580 +1,442 @@
|
|
|
1
|
-
import * as i0 from
|
|
2
|
-
import {
|
|
3
|
-
import * as i1 from
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
/** Actions */
|
|
9
|
-
const ACTION_SET = '[AssetPathOverride] set entities';
|
|
10
|
-
/**
|
|
11
|
-
* Clear all overrides and fill the store with the payload
|
|
12
|
-
*/
|
|
13
|
-
const setAssetPathOverride = createAction(ACTION_SET, props());
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* AssetPathOverride Store initial value
|
|
17
|
-
*/
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { ChangeDetectorRef, Injectable, InjectionToken, NgModule, Pipe, inject, makeEnvironmentProviders } from "@angular/core";
|
|
3
|
+
import * as i1 from "@ngrx/store";
|
|
4
|
+
import { Store, StoreModule, createAction, createFeatureSelector, createReducer, createSelector, on, props, provideState, select } from "@ngrx/store";
|
|
5
|
+
import { firstValueFrom, of } from "rxjs";
|
|
6
|
+
import { distinctUntilChanged, map, shareReplay } from "rxjs/operators";
|
|
7
|
+
const setAssetPathOverride = createAction("[AssetPathOverride] set entities", props());
|
|
18
8
|
const assetPathOverrideInitialState = { assetPathOverrides: {} };
|
|
19
|
-
|
|
20
|
-
* List of basic actions for AssetPathOverride Store
|
|
21
|
-
*/
|
|
22
|
-
const assetPathOverrideReducerFeatures = [
|
|
23
|
-
on(setAssetPathOverride, (_state, payload) => ({ ...payload.state }))
|
|
24
|
-
];
|
|
25
|
-
/**
|
|
26
|
-
* AssetPathOverride Store reducer
|
|
27
|
-
*/
|
|
9
|
+
const assetPathOverrideReducerFeatures = [on(setAssetPathOverride, (_state, payload) => ({ ...payload.state }))];
|
|
28
10
|
const assetPathOverrideReducer = createReducer(assetPathOverrideInitialState, ...assetPathOverrideReducerFeatures);
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
* Name of the AssetPathOverride Store
|
|
32
|
-
*/
|
|
33
|
-
const ASSET_PATH_OVERRIDE_STORE_NAME = 'assetPathOverride';
|
|
34
|
-
|
|
35
|
-
/** Token of the AssetPathOverride reducer */
|
|
36
|
-
const ASSET_PATH_OVERRIDE_REDUCER_TOKEN = new InjectionToken('Feature AssetPathOverride Reducer');
|
|
37
|
-
/** Provide default reducer for AssetPathOverride store */
|
|
11
|
+
const ASSET_PATH_OVERRIDE_STORE_NAME = "assetPathOverride";
|
|
12
|
+
const ASSET_PATH_OVERRIDE_REDUCER_TOKEN = new InjectionToken("Feature AssetPathOverride Reducer");
|
|
38
13
|
function getDefaultAssetPathOverrideReducer() {
|
|
39
|
-
|
|
14
|
+
return assetPathOverrideReducer;
|
|
40
15
|
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
16
|
+
var AssetPathOverrideStoreModule = class AssetPathOverrideStoreModule {
|
|
17
|
+
static forRoot(reducerFactory) {
|
|
18
|
+
return {
|
|
19
|
+
ngModule: AssetPathOverrideStoreModule,
|
|
20
|
+
providers: [{
|
|
21
|
+
provide: ASSET_PATH_OVERRIDE_REDUCER_TOKEN,
|
|
22
|
+
useFactory: reducerFactory
|
|
23
|
+
}]
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
static {
|
|
27
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
28
|
+
minVersion: "12.0.0",
|
|
29
|
+
version: "22.2.3",
|
|
30
|
+
ngImport: i0,
|
|
31
|
+
type: AssetPathOverrideStoreModule,
|
|
32
|
+
deps: [],
|
|
33
|
+
target: i0.ɵɵFactoryTarget.NgModule
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
static {
|
|
37
|
+
this.ɵmod = i0.ɵɵngDeclareNgModule({
|
|
38
|
+
minVersion: "14.0.0",
|
|
39
|
+
version: "22.2.3",
|
|
40
|
+
ngImport: i0,
|
|
41
|
+
type: AssetPathOverrideStoreModule,
|
|
42
|
+
imports: [i1.StoreFeatureModule]
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
static {
|
|
46
|
+
this.ɵinj = i0.ɵɵngDeclareInjector({
|
|
47
|
+
minVersion: "12.0.0",
|
|
48
|
+
version: "22.2.3",
|
|
49
|
+
ngImport: i0,
|
|
50
|
+
type: AssetPathOverrideStoreModule,
|
|
51
|
+
providers: [{
|
|
52
|
+
provide: ASSET_PATH_OVERRIDE_REDUCER_TOKEN,
|
|
53
|
+
useFactory: getDefaultAssetPathOverrideReducer
|
|
54
|
+
}],
|
|
55
|
+
imports: [StoreModule.forFeature(ASSET_PATH_OVERRIDE_STORE_NAME, ASSET_PATH_OVERRIDE_REDUCER_TOKEN)]
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
60
|
+
minVersion: "12.0.0",
|
|
61
|
+
version: "22.2.3",
|
|
62
|
+
ngImport: i0,
|
|
63
|
+
type: AssetPathOverrideStoreModule,
|
|
64
|
+
decorators: [{
|
|
65
|
+
type: NgModule,
|
|
66
|
+
args: [{
|
|
67
|
+
imports: [StoreModule.forFeature(ASSET_PATH_OVERRIDE_STORE_NAME, ASSET_PATH_OVERRIDE_REDUCER_TOKEN)],
|
|
68
|
+
providers: [{
|
|
69
|
+
provide: ASSET_PATH_OVERRIDE_REDUCER_TOKEN,
|
|
70
|
+
useFactory: getDefaultAssetPathOverrideReducer
|
|
71
|
+
}]
|
|
72
|
+
}]
|
|
73
|
+
}]
|
|
74
|
+
});
|
|
74
75
|
function provideAssetPathOverrideStore(reducerFactory) {
|
|
75
|
-
|
|
76
|
-
provideState(ASSET_PATH_OVERRIDE_STORE_NAME, reducerFactory ? reducerFactory() : assetPathOverrideReducer)
|
|
77
|
-
]);
|
|
76
|
+
return makeEnvironmentProviders([provideState(ASSET_PATH_OVERRIDE_STORE_NAME, reducerFactory ? reducerFactory() : assetPathOverrideReducer)]);
|
|
78
77
|
}
|
|
79
|
-
|
|
80
|
-
/** Select AssetPathOverride State */
|
|
81
78
|
const selectAssetPathOverrideState = createFeatureSelector(ASSET_PATH_OVERRIDE_STORE_NAME);
|
|
82
|
-
/** Select all assetPath override map */
|
|
83
79
|
const selectAssetPathOverride = createSelector(selectAssetPathOverrideState, (state) => state?.assetPathOverrides || {});
|
|
84
|
-
|
|
85
|
-
/**
|
|
86
|
-
* Deserializer
|
|
87
|
-
* @param rawObject
|
|
88
|
-
*/
|
|
89
80
|
const assetPathOverrideStorageDeserializer = (rawObject) => {
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
}
|
|
93
|
-
return rawObject;
|
|
81
|
+
if (!rawObject) return assetPathOverrideInitialState;
|
|
82
|
+
return rawObject;
|
|
94
83
|
};
|
|
95
|
-
const assetPathOverrideStorageSync = {
|
|
96
|
-
|
|
84
|
+
const assetPathOverrideStorageSync = { deserialize: assetPathOverrideStorageDeserializer };
|
|
85
|
+
const DYNAMIC_CONTENT_BASE_PATH_TOKEN = new InjectionToken("Dynamic content path injection token");
|
|
86
|
+
const CMS_ASSETS_PATH_TOKEN = new InjectionToken("CMS assets path injection token");
|
|
87
|
+
const MEDIA_FOLDER_NAME = "assets";
|
|
88
|
+
var DynamicContentService = class DynamicContentService {
|
|
89
|
+
constructor() {
|
|
90
|
+
this.cmsOnlyAssetsPath = inject(CMS_ASSETS_PATH_TOKEN);
|
|
91
|
+
this.store = inject(Store, { optional: true });
|
|
92
|
+
const dynamicContentPath = inject(DYNAMIC_CONTENT_BASE_PATH_TOKEN);
|
|
93
|
+
this.basePath = dynamicContentPath.replace(/\/$/, "");
|
|
94
|
+
this.mediaFolder = MEDIA_FOLDER_NAME;
|
|
95
|
+
}
|
|
96
|
+
normalizePath(assetPath) {
|
|
97
|
+
return assetPath ? assetPath.replace(/^\//, "") : "";
|
|
98
|
+
}
|
|
99
|
+
isAbsoluteUrl(assetPath) {
|
|
100
|
+
return URL.canParse(assetPath);
|
|
101
|
+
}
|
|
102
|
+
getContentPath(assetPath) {
|
|
103
|
+
if (assetPath && this.isAbsoluteUrl(assetPath)) return assetPath;
|
|
104
|
+
const normalizedAssetPath = this.normalizePath(assetPath);
|
|
105
|
+
return this.basePath === "" ? assetPath || "" : `${this.basePath}/${normalizedAssetPath}`;
|
|
106
|
+
}
|
|
107
|
+
getMediaPath(assetPath) {
|
|
108
|
+
if (assetPath && this.isAbsoluteUrl(assetPath)) return assetPath;
|
|
109
|
+
if (this.cmsOnlyAssetsPath && assetPath) return assetPath.startsWith("/") ? assetPath : `${this.cmsOnlyAssetsPath.replace(/\/$/, "")}/${assetPath}`;
|
|
110
|
+
return this.getContentPath(this.mediaFolder ? `${this.mediaFolder}/${this.normalizePath(assetPath)}` : assetPath);
|
|
111
|
+
}
|
|
112
|
+
getContentPathStream(assetPath) {
|
|
113
|
+
return of(this.getContentPath(assetPath));
|
|
114
|
+
}
|
|
115
|
+
getMediaPathStream(assetPath) {
|
|
116
|
+
if (!this.store) return of(this.getMediaPath(assetPath));
|
|
117
|
+
return this.store.pipe(select(selectAssetPathOverride), map((entities) => assetPath && entities && entities[assetPath] ? entities[assetPath] : assetPath), map((finalAssetPath) => this.getMediaPath(finalAssetPath)), distinctUntilChanged(), shareReplay({
|
|
118
|
+
bufferSize: 1,
|
|
119
|
+
refCount: true
|
|
120
|
+
}));
|
|
121
|
+
}
|
|
122
|
+
static {
|
|
123
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
124
|
+
minVersion: "12.0.0",
|
|
125
|
+
version: "22.2.3",
|
|
126
|
+
ngImport: i0,
|
|
127
|
+
type: DynamicContentService,
|
|
128
|
+
deps: [],
|
|
129
|
+
target: i0.ɵɵFactoryTarget.Injectable
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
static {
|
|
133
|
+
this.ɵprov = i0.ɵɵngDeclareInjectable({
|
|
134
|
+
minVersion: "12.0.0",
|
|
135
|
+
version: "22.2.3",
|
|
136
|
+
ngImport: i0,
|
|
137
|
+
type: DynamicContentService
|
|
138
|
+
});
|
|
139
|
+
}
|
|
97
140
|
};
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
*/
|
|
107
|
-
const CMS_ASSETS_PATH_TOKEN = new InjectionToken('CMS assets path injection token');
|
|
108
|
-
|
|
109
|
-
const MEDIA_FOLDER_NAME = 'assets';
|
|
110
|
-
/**
|
|
111
|
-
* Service for getting dynamic content path
|
|
112
|
-
*/
|
|
113
|
-
class DynamicContentService {
|
|
114
|
-
constructor() {
|
|
115
|
-
this.cmsOnlyAssetsPath = inject(CMS_ASSETS_PATH_TOKEN);
|
|
116
|
-
this.store = inject(Store, { optional: true });
|
|
117
|
-
const dynamicContentPath = inject(DYNAMIC_CONTENT_BASE_PATH_TOKEN);
|
|
118
|
-
this.basePath = dynamicContentPath.replace(/\/$/, '');
|
|
119
|
-
this.mediaFolder = MEDIA_FOLDER_NAME;
|
|
120
|
-
}
|
|
121
|
-
normalizePath(assetPath) {
|
|
122
|
-
return assetPath ? assetPath.replace(/^\//, '') : '';
|
|
123
|
-
}
|
|
124
|
-
isAbsoluteUrl(assetPath) {
|
|
125
|
-
return URL.canParse(assetPath);
|
|
126
|
-
}
|
|
127
|
-
getContentPath(assetPath) {
|
|
128
|
-
if (assetPath && this.isAbsoluteUrl(assetPath)) {
|
|
129
|
-
return assetPath;
|
|
130
|
-
}
|
|
131
|
-
const normalizedAssetPath = this.normalizePath(assetPath);
|
|
132
|
-
return this.basePath === '' ? assetPath || '' : `${this.basePath}/${normalizedAssetPath}`;
|
|
133
|
-
}
|
|
134
|
-
getMediaPath(assetPath) {
|
|
135
|
-
if (assetPath && this.isAbsoluteUrl(assetPath)) {
|
|
136
|
-
return assetPath;
|
|
137
|
-
}
|
|
138
|
-
if (this.cmsOnlyAssetsPath && assetPath) {
|
|
139
|
-
return assetPath.startsWith('/') ? assetPath : `${this.cmsOnlyAssetsPath.replace(/\/$/, '')}/${assetPath}`;
|
|
140
|
-
}
|
|
141
|
-
return this.getContentPath(this.mediaFolder ? `${this.mediaFolder}/${this.normalizePath(assetPath)}` : assetPath);
|
|
142
|
-
}
|
|
143
|
-
/**
|
|
144
|
-
* Gets the full path of a content relative to the root
|
|
145
|
-
* Content path doesn't consider any override, you will always get the same file
|
|
146
|
-
* @param assetPath asset location in the root folder
|
|
147
|
-
* @example
|
|
148
|
-
* ```typescript
|
|
149
|
-
* getMediaPath('assets/imgs/my-image.png') // will give you the basePath + 'assets/imgs/my-image.png'
|
|
150
|
-
* ```
|
|
151
|
-
*/
|
|
152
|
-
getContentPathStream(assetPath) {
|
|
153
|
-
return of(this.getContentPath(assetPath));
|
|
154
|
-
}
|
|
155
|
-
/**
|
|
156
|
-
* Gets the stream that provides the full path of a media content
|
|
157
|
-
* A Media content is always stored in the 'assets' media folder, no external content will be accessible through this function
|
|
158
|
-
* If any override is applied to the content, returns the override path instead
|
|
159
|
-
* @param assetPath asset location in the media folder (e.g imgs/my-image.png)
|
|
160
|
-
* @example
|
|
161
|
-
* ```typescript
|
|
162
|
-
* getMediaPathStream('imgs/my-image.png') // will give you the basePath + mediaFolder + 'imgs/my-image.png'
|
|
163
|
-
* ```
|
|
164
|
-
*/
|
|
165
|
-
getMediaPathStream(assetPath) {
|
|
166
|
-
if (!this.store) {
|
|
167
|
-
return of(this.getMediaPath(assetPath));
|
|
168
|
-
}
|
|
169
|
-
return this.store.pipe(select(selectAssetPathOverride), map((entities) => assetPath && entities && entities[assetPath] ? entities[assetPath] : assetPath), map((finalAssetPath) => this.getMediaPath(finalAssetPath)), distinctUntilChanged(), shareReplay({ bufferSize: 1, refCount: true }));
|
|
170
|
-
}
|
|
171
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: DynamicContentService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
172
|
-
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: DynamicContentService }); }
|
|
173
|
-
}
|
|
174
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: DynamicContentService, decorators: [{
|
|
175
|
-
type: Injectable
|
|
176
|
-
}], ctorParameters: () => [] });
|
|
177
|
-
|
|
178
|
-
/**
|
|
179
|
-
* Function to get dynamic content from body dataset
|
|
180
|
-
*/
|
|
141
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
142
|
+
minVersion: "12.0.0",
|
|
143
|
+
version: "22.2.3",
|
|
144
|
+
ngImport: i0,
|
|
145
|
+
type: DynamicContentService,
|
|
146
|
+
decorators: [{ type: Injectable }],
|
|
147
|
+
ctorParameters: () => []
|
|
148
|
+
});
|
|
181
149
|
function getDynamicContent() {
|
|
182
|
-
|
|
150
|
+
return document.body.dataset.dynamiccontentpath || "";
|
|
183
151
|
}
|
|
184
|
-
/**
|
|
185
|
-
* Function to get the cms assets from body dataset
|
|
186
|
-
* This will be used only in a CMS context(not in local or prod) to display correctly the assets in the editor
|
|
187
|
-
*/
|
|
188
152
|
function getCmsAssets() {
|
|
189
|
-
|
|
153
|
+
return document.body.dataset.cmsassetspath || "";
|
|
190
154
|
}
|
|
191
|
-
/**
|
|
192
|
-
* Specify a custom base path
|
|
193
|
-
* @param basePath
|
|
194
|
-
*/
|
|
195
155
|
function withBasePath(basePath) {
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
: { useFactory: basePath })
|
|
204
|
-
}
|
|
205
|
-
]
|
|
206
|
-
};
|
|
156
|
+
return {
|
|
157
|
+
ɵkind: "base-path",
|
|
158
|
+
ɵproviders: [{
|
|
159
|
+
provide: DYNAMIC_CONTENT_BASE_PATH_TOKEN,
|
|
160
|
+
...typeof basePath === "string" ? { useValue: basePath } : { useFactory: basePath }
|
|
161
|
+
}]
|
|
162
|
+
};
|
|
207
163
|
}
|
|
208
|
-
/**
|
|
209
|
-
* Specify a custom CMS assets path
|
|
210
|
-
* @param cmsAssetsPath
|
|
211
|
-
*/
|
|
212
164
|
function withCmsAssetsPath(cmsAssetsPath) {
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
: { useFactory: cmsAssetsPath })
|
|
221
|
-
}
|
|
222
|
-
]
|
|
223
|
-
};
|
|
165
|
+
return {
|
|
166
|
+
ɵkind: "cms-assets-path",
|
|
167
|
+
ɵproviders: [{
|
|
168
|
+
provide: CMS_ASSETS_PATH_TOKEN,
|
|
169
|
+
...typeof cmsAssetsPath === "string" ? { useValue: cmsAssetsPath } : { useFactory: cmsAssetsPath }
|
|
170
|
+
}]
|
|
171
|
+
};
|
|
224
172
|
}
|
|
225
|
-
/**
|
|
226
|
-
* Provide dynamic content default configuration.
|
|
227
|
-
* To customize the location where the application will search for the base path of dynamic content
|
|
228
|
-
* @see {@link withBasePath}
|
|
229
|
-
* @see {@link withCmsAssetsPath}
|
|
230
|
-
* @note The cmsAssets will be used only in the cms editor mode and it will take priority over dynamic content
|
|
231
|
-
* @param features
|
|
232
|
-
* @example
|
|
233
|
-
* ```typescript
|
|
234
|
-
* bootstrapApplication(App,
|
|
235
|
-
* {
|
|
236
|
-
* providers: [
|
|
237
|
-
* provideDynamicContent(
|
|
238
|
-
* withBasePath('custom/base/path'),
|
|
239
|
-
* withCmsAssetsPath('custom/cms/assets/path'),
|
|
240
|
-
* )
|
|
241
|
-
* ]
|
|
242
|
-
* }
|
|
243
|
-
* );
|
|
244
|
-
*/
|
|
245
173
|
function provideDynamicContent(...features) {
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
providers.push(cmsAssetsPathFeature.ɵproviders);
|
|
253
|
-
return makeEnvironmentProviders(providers);
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
class O3rDynamicContentPipe {
|
|
257
|
-
constructor() {
|
|
258
|
-
this.service = inject(DynamicContentService);
|
|
259
|
-
this.cd = inject(ChangeDetectorRef);
|
|
260
|
-
/** Path to the media */
|
|
261
|
-
this.mediaPath = '';
|
|
262
|
-
}
|
|
263
|
-
/** @inheritDoc */
|
|
264
|
-
transform(query) {
|
|
265
|
-
if (query !== this.lastQuery) {
|
|
266
|
-
this.lastQuery = query;
|
|
267
|
-
if (this.onMediaPathChange) {
|
|
268
|
-
this.onMediaPathChange.unsubscribe();
|
|
269
|
-
}
|
|
270
|
-
this.onMediaPathChange = this.service.getMediaPathStream(query).subscribe((mediaPath) => {
|
|
271
|
-
this.mediaPath = mediaPath;
|
|
272
|
-
this.cd.markForCheck();
|
|
273
|
-
});
|
|
274
|
-
}
|
|
275
|
-
return this.mediaPath;
|
|
276
|
-
}
|
|
277
|
-
/** @inheritDoc */
|
|
278
|
-
ngOnDestroy() {
|
|
279
|
-
if (this.onMediaPathChange) {
|
|
280
|
-
this.onMediaPathChange.unsubscribe();
|
|
281
|
-
}
|
|
282
|
-
}
|
|
283
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: O3rDynamicContentPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
284
|
-
/** @nocollapse */ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "22.2.0", ngImport: i0, type: O3rDynamicContentPipe, isStandalone: true, name: "o3rDynamicContent", pure: false }); }
|
|
174
|
+
const providers = [DynamicContentService];
|
|
175
|
+
const basePathFeature = features.find((f) => f.ɵkind === "base-path") ?? withBasePath(getDynamicContent);
|
|
176
|
+
providers.push(basePathFeature.ɵproviders);
|
|
177
|
+
const cmsAssetsPathFeature = features.find((f) => f.ɵkind === "cms-assets-path") ?? withCmsAssetsPath(getCmsAssets);
|
|
178
|
+
providers.push(cmsAssetsPathFeature.ɵproviders);
|
|
179
|
+
return makeEnvironmentProviders(providers);
|
|
285
180
|
}
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
181
|
+
var O3rDynamicContentPipe = class O3rDynamicContentPipe {
|
|
182
|
+
constructor() {
|
|
183
|
+
this.service = inject(DynamicContentService);
|
|
184
|
+
this.cd = inject(ChangeDetectorRef);
|
|
185
|
+
this.mediaPath = "";
|
|
186
|
+
}
|
|
187
|
+
transform(query) {
|
|
188
|
+
if (query !== this.lastQuery) {
|
|
189
|
+
this.lastQuery = query;
|
|
190
|
+
if (this.onMediaPathChange) this.onMediaPathChange.unsubscribe();
|
|
191
|
+
this.onMediaPathChange = this.service.getMediaPathStream(query).subscribe((mediaPath) => {
|
|
192
|
+
this.mediaPath = mediaPath;
|
|
193
|
+
this.cd.markForCheck();
|
|
194
|
+
});
|
|
195
|
+
}
|
|
196
|
+
return this.mediaPath;
|
|
197
|
+
}
|
|
198
|
+
ngOnDestroy() {
|
|
199
|
+
if (this.onMediaPathChange) this.onMediaPathChange.unsubscribe();
|
|
200
|
+
}
|
|
201
|
+
static {
|
|
202
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
203
|
+
minVersion: "12.0.0",
|
|
204
|
+
version: "22.2.3",
|
|
205
|
+
ngImport: i0,
|
|
206
|
+
type: O3rDynamicContentPipe,
|
|
207
|
+
deps: [],
|
|
208
|
+
target: i0.ɵɵFactoryTarget.Pipe
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
static {
|
|
212
|
+
this.ɵpipe = i0.ɵɵngDeclarePipe({
|
|
213
|
+
minVersion: "14.0.0",
|
|
214
|
+
version: "22.2.3",
|
|
215
|
+
ngImport: i0,
|
|
216
|
+
type: O3rDynamicContentPipe,
|
|
217
|
+
isStandalone: true,
|
|
218
|
+
name: "o3rDynamicContent",
|
|
219
|
+
pure: false
|
|
220
|
+
});
|
|
221
|
+
}
|
|
222
|
+
};
|
|
223
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
224
|
+
minVersion: "12.0.0",
|
|
225
|
+
version: "22.2.3",
|
|
226
|
+
ngImport: i0,
|
|
227
|
+
type: O3rDynamicContentPipe,
|
|
228
|
+
decorators: [{
|
|
229
|
+
type: Pipe,
|
|
230
|
+
args: [{
|
|
231
|
+
name: "o3rDynamicContent",
|
|
232
|
+
pure: false
|
|
233
|
+
}]
|
|
234
|
+
}]
|
|
235
|
+
});
|
|
301
236
|
var StorageStrategy;
|
|
302
|
-
(function
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention -- required naming convention
|
|
308
|
-
StorageStrategy[StorageStrategy["Replace"] = 2] = "Replace";
|
|
309
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention -- required naming convention
|
|
310
|
-
StorageStrategy[StorageStrategy["ReplaceIfNotEmpty"] = 3] = "ReplaceIfNotEmpty";
|
|
237
|
+
(function(StorageStrategy) {
|
|
238
|
+
StorageStrategy[StorageStrategy["Rehydrate"] = 0] = "Rehydrate";
|
|
239
|
+
StorageStrategy[StorageStrategy["Merge"] = 1] = "Merge";
|
|
240
|
+
StorageStrategy[StorageStrategy["Replace"] = 2] = "Replace";
|
|
241
|
+
StorageStrategy[StorageStrategy["ReplaceIfNotEmpty"] = 3] = "ReplaceIfNotEmpty";
|
|
311
242
|
})(StorageStrategy || (StorageStrategy = {}));
|
|
312
243
|
const defaultRequestParametersConfig = {
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
244
|
+
storage: typeof window === "undefined" ? void 0 : window.sessionStorage,
|
|
245
|
+
strategy: StorageStrategy.Rehydrate,
|
|
246
|
+
queryParamsValue: typeof document !== "undefined" && document.body?.dataset?.query || "{}",
|
|
247
|
+
postParamsValue: typeof document !== "undefined" && document.body?.dataset?.post || "{}"
|
|
317
248
|
};
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
.reduce((acc, key) => {
|
|
448
|
-
acc[key] = this._query[key];
|
|
449
|
-
return acc;
|
|
450
|
-
}, {});
|
|
451
|
-
if (this.config.storage) {
|
|
452
|
-
this.config.storage.setItem('_query', JSON.stringify(newQuery));
|
|
453
|
-
}
|
|
454
|
-
this._query = newQuery;
|
|
455
|
-
}
|
|
456
|
-
/**
|
|
457
|
-
* Clear POST parameters from the storage
|
|
458
|
-
* @param paramsToClear the list on key that you want to clean in post parameters
|
|
459
|
-
*/
|
|
460
|
-
clearPostParameters(paramsToClear) {
|
|
461
|
-
const newPost = (paramsToClear ? Object.keys(this._post).filter((key) => !paramsToClear.includes(key)) : [])
|
|
462
|
-
.reduce((acc, key) => {
|
|
463
|
-
acc[key] = this._post[key];
|
|
464
|
-
return acc;
|
|
465
|
-
}, {});
|
|
466
|
-
if (this.config.storage) {
|
|
467
|
-
this.config.storage.setItem('_post', JSON.stringify(newPost));
|
|
468
|
-
}
|
|
469
|
-
this._post = newPost;
|
|
470
|
-
}
|
|
471
|
-
/**
|
|
472
|
-
* Get all the parameters in a map.
|
|
473
|
-
* @param priority the parameter to be given priority in case same key is in get and post params.
|
|
474
|
-
*/
|
|
475
|
-
getParams(priority = 'query') {
|
|
476
|
-
return priority === 'query' ? { ...this._post, ...this._query } : { ...this._query, ...this._post };
|
|
477
|
-
}
|
|
478
|
-
/**
|
|
479
|
-
* Filter Parameters(both Query/POST) from the storage
|
|
480
|
-
* @param paramstoFilter the list on key that you want to filter from parameters
|
|
481
|
-
* @param priority the priorty of the parameter type(POST/Query)
|
|
482
|
-
*/
|
|
483
|
-
getFilteredParameters(paramstoFilter, priority = 'query') {
|
|
484
|
-
const params = this.getParams(priority);
|
|
485
|
-
if (!paramstoFilter) {
|
|
486
|
-
return params;
|
|
487
|
-
}
|
|
488
|
-
return Object.keys(params)
|
|
489
|
-
.filter((key) => !paramstoFilter.includes(key))
|
|
490
|
-
.reduce((acc, key) => {
|
|
491
|
-
acc[key] = params[key];
|
|
492
|
-
return acc;
|
|
493
|
-
}, {});
|
|
494
|
-
}
|
|
495
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: RequestParametersService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
496
|
-
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: RequestParametersService }); }
|
|
497
|
-
}
|
|
498
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: RequestParametersService, decorators: [{
|
|
499
|
-
type: Injectable
|
|
500
|
-
}], ctorParameters: () => [] });
|
|
501
|
-
|
|
502
|
-
/**
|
|
503
|
-
* Empty configuration factory, used when config is not provided. It needs a separate function for AOT.
|
|
504
|
-
*/
|
|
249
|
+
const REQUEST_PARAMETERS_CONFIG_TOKEN = new InjectionToken("RequestParametersConfig injection token", { factory: () => ({}) });
|
|
250
|
+
var RequestParametersService = class RequestParametersService {
|
|
251
|
+
constructor() {
|
|
252
|
+
this._query = {};
|
|
253
|
+
this._post = {};
|
|
254
|
+
const config = inject(REQUEST_PARAMETERS_CONFIG_TOKEN);
|
|
255
|
+
this.config = defaultRequestParametersConfig;
|
|
256
|
+
Object.keys(config).filter((key) => config[key] !== void 0).forEach((key) => this.config[key] = config[key]);
|
|
257
|
+
this.setParameters("query", JSON.parse(this.config.queryParamsValue));
|
|
258
|
+
this.setParameters("post", JSON.parse(this.config.postParamsValue));
|
|
259
|
+
}
|
|
260
|
+
setParameters(key, value) {
|
|
261
|
+
const privateKey = `_${key}`;
|
|
262
|
+
if (!this.config.storage) return;
|
|
263
|
+
switch (this.config.strategy) {
|
|
264
|
+
case StorageStrategy.Rehydrate:
|
|
265
|
+
if (!this.config.storage.getItem(privateKey)) {
|
|
266
|
+
this[privateKey] = value;
|
|
267
|
+
this.config.storage.setItem(privateKey, JSON.stringify(value));
|
|
268
|
+
break;
|
|
269
|
+
}
|
|
270
|
+
this[privateKey] = JSON.parse(this.config.storage.getItem(privateKey) || "{}");
|
|
271
|
+
break;
|
|
272
|
+
case StorageStrategy.Replace:
|
|
273
|
+
this[privateKey] = value;
|
|
274
|
+
this.config.storage.setItem(privateKey, JSON.stringify(value));
|
|
275
|
+
break;
|
|
276
|
+
case StorageStrategy.Merge: {
|
|
277
|
+
const storageData = Object.assign(JSON.parse(this.config.storage.getItem(privateKey) || "{}"), value);
|
|
278
|
+
this[privateKey] = storageData;
|
|
279
|
+
this.config.storage.setItem(privateKey, JSON.stringify(storageData));
|
|
280
|
+
break;
|
|
281
|
+
}
|
|
282
|
+
case StorageStrategy.ReplaceIfNotEmpty:
|
|
283
|
+
if (Object.keys(value).length > 0) {
|
|
284
|
+
this[privateKey] = value;
|
|
285
|
+
this.config.storage.setItem(privateKey, JSON.stringify(value));
|
|
286
|
+
break;
|
|
287
|
+
}
|
|
288
|
+
this[privateKey] = JSON.parse(this.config.storage.getItem(privateKey) || "{}");
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
get query() {
|
|
292
|
+
return this._query;
|
|
293
|
+
}
|
|
294
|
+
get post() {
|
|
295
|
+
return this._post;
|
|
296
|
+
}
|
|
297
|
+
getQueryParameter(key) {
|
|
298
|
+
return this._query[key];
|
|
299
|
+
}
|
|
300
|
+
getQueryParameterAsBoolean(key) {
|
|
301
|
+
const queryParameter = this.getQueryParameter(key);
|
|
302
|
+
return queryParameter ? queryParameter.toLowerCase() === "true" : void 0;
|
|
303
|
+
}
|
|
304
|
+
getPostParameter(key) {
|
|
305
|
+
return this._post[key];
|
|
306
|
+
}
|
|
307
|
+
getPostParameterAsBoolean(key) {
|
|
308
|
+
const postParameter = this.getPostParameter(key);
|
|
309
|
+
return postParameter ? postParameter.toLowerCase() === "true" : void 0;
|
|
310
|
+
}
|
|
311
|
+
getParameter(key) {
|
|
312
|
+
return this._query[key] || this._post[key];
|
|
313
|
+
}
|
|
314
|
+
getParameterAsBoolean(key) {
|
|
315
|
+
const parameter = this.getParameter(key);
|
|
316
|
+
return parameter ? parameter.toLowerCase() === "true" : void 0;
|
|
317
|
+
}
|
|
318
|
+
clearQueryParameters(paramsToClear) {
|
|
319
|
+
const newQuery = (paramsToClear ? Object.keys(this._query).filter((key) => !paramsToClear.includes(key)) : []).reduce((acc, key) => {
|
|
320
|
+
acc[key] = this._query[key];
|
|
321
|
+
return acc;
|
|
322
|
+
}, {});
|
|
323
|
+
if (this.config.storage) this.config.storage.setItem("_query", JSON.stringify(newQuery));
|
|
324
|
+
this._query = newQuery;
|
|
325
|
+
}
|
|
326
|
+
clearPostParameters(paramsToClear) {
|
|
327
|
+
const newPost = (paramsToClear ? Object.keys(this._post).filter((key) => !paramsToClear.includes(key)) : []).reduce((acc, key) => {
|
|
328
|
+
acc[key] = this._post[key];
|
|
329
|
+
return acc;
|
|
330
|
+
}, {});
|
|
331
|
+
if (this.config.storage) this.config.storage.setItem("_post", JSON.stringify(newPost));
|
|
332
|
+
this._post = newPost;
|
|
333
|
+
}
|
|
334
|
+
getParams(priority = "query") {
|
|
335
|
+
return priority === "query" ? {
|
|
336
|
+
...this._post,
|
|
337
|
+
...this._query
|
|
338
|
+
} : {
|
|
339
|
+
...this._query,
|
|
340
|
+
...this._post
|
|
341
|
+
};
|
|
342
|
+
}
|
|
343
|
+
getFilteredParameters(paramstoFilter, priority = "query") {
|
|
344
|
+
const params = this.getParams(priority);
|
|
345
|
+
if (!paramstoFilter) return params;
|
|
346
|
+
return Object.keys(params).filter((key) => !paramstoFilter.includes(key)).reduce((acc, key) => {
|
|
347
|
+
acc[key] = params[key];
|
|
348
|
+
return acc;
|
|
349
|
+
}, {});
|
|
350
|
+
}
|
|
351
|
+
static {
|
|
352
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
353
|
+
minVersion: "12.0.0",
|
|
354
|
+
version: "22.2.3",
|
|
355
|
+
ngImport: i0,
|
|
356
|
+
type: RequestParametersService,
|
|
357
|
+
deps: [],
|
|
358
|
+
target: i0.ɵɵFactoryTarget.Injectable
|
|
359
|
+
});
|
|
360
|
+
}
|
|
361
|
+
static {
|
|
362
|
+
this.ɵprov = i0.ɵɵngDeclareInjectable({
|
|
363
|
+
minVersion: "12.0.0",
|
|
364
|
+
version: "22.2.3",
|
|
365
|
+
ngImport: i0,
|
|
366
|
+
type: RequestParametersService
|
|
367
|
+
});
|
|
368
|
+
}
|
|
369
|
+
};
|
|
370
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
371
|
+
minVersion: "12.0.0",
|
|
372
|
+
version: "22.2.3",
|
|
373
|
+
ngImport: i0,
|
|
374
|
+
type: RequestParametersService,
|
|
375
|
+
decorators: [{ type: Injectable }],
|
|
376
|
+
ctorParameters: () => []
|
|
377
|
+
});
|
|
505
378
|
function defaultConfigFactory() {
|
|
506
|
-
|
|
379
|
+
return {};
|
|
507
380
|
}
|
|
508
|
-
/**
|
|
509
|
-
* Provide request parameters config
|
|
510
|
-
* We don't provide directly the value and use a factory because otherwise AOT compilation will resolve to undefined whatever is taken from window
|
|
511
|
-
* @param config
|
|
512
|
-
*/
|
|
513
381
|
function provideRequestParameters(config = defaultConfigFactory) {
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
},
|
|
519
|
-
RequestParametersService
|
|
520
|
-
]);
|
|
382
|
+
return makeEnvironmentProviders([{
|
|
383
|
+
provide: REQUEST_PARAMETERS_CONFIG_TOKEN,
|
|
384
|
+
useFactory: config
|
|
385
|
+
}, RequestParametersService]);
|
|
521
386
|
}
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
/**
|
|
576
|
-
* Generated bundle index. Do not edit.
|
|
577
|
-
*/
|
|
578
|
-
|
|
387
|
+
var StyleLazyLoader = class StyleLazyLoader {
|
|
388
|
+
constructor() {
|
|
389
|
+
this.dcService = inject(DynamicContentService);
|
|
390
|
+
this.DEFAULT_STYLE_ELEMENT_ID = "external-theme";
|
|
391
|
+
}
|
|
392
|
+
loadStyleFromURL(styleUrlConfig) {
|
|
393
|
+
const elementId = styleUrlConfig.id || this.DEFAULT_STYLE_ELEMENT_ID;
|
|
394
|
+
let style = document.querySelector(`#${elementId}`);
|
|
395
|
+
if (style === null) {
|
|
396
|
+
style = document.createElement("link");
|
|
397
|
+
style.rel = "stylesheet";
|
|
398
|
+
style.type = "text/css";
|
|
399
|
+
document.querySelectorAll("head")[0].append(style);
|
|
400
|
+
}
|
|
401
|
+
if (styleUrlConfig.integrity) style.integrity = styleUrlConfig.integrity;
|
|
402
|
+
if (styleUrlConfig.crossOrigin !== void 0) style.crossOrigin = styleUrlConfig.crossOrigin;
|
|
403
|
+
style.href = styleUrlConfig.href;
|
|
404
|
+
return style;
|
|
405
|
+
}
|
|
406
|
+
async asyncLoadStyleFromDynamicContent(styleUrlConfig) {
|
|
407
|
+
styleUrlConfig.href = await firstValueFrom(this.dcService.getContentPathStream(styleUrlConfig.href));
|
|
408
|
+
this.loadStyleFromURL(styleUrlConfig);
|
|
409
|
+
}
|
|
410
|
+
static {
|
|
411
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
412
|
+
minVersion: "12.0.0",
|
|
413
|
+
version: "22.2.3",
|
|
414
|
+
ngImport: i0,
|
|
415
|
+
type: StyleLazyLoader,
|
|
416
|
+
deps: [],
|
|
417
|
+
target: i0.ɵɵFactoryTarget.Injectable
|
|
418
|
+
});
|
|
419
|
+
}
|
|
420
|
+
static {
|
|
421
|
+
this.ɵprov = i0.ɵɵngDeclareInjectable({
|
|
422
|
+
minVersion: "12.0.0",
|
|
423
|
+
version: "22.2.3",
|
|
424
|
+
ngImport: i0,
|
|
425
|
+
type: StyleLazyLoader,
|
|
426
|
+
providedIn: "root"
|
|
427
|
+
});
|
|
428
|
+
}
|
|
429
|
+
};
|
|
430
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
431
|
+
minVersion: "12.0.0",
|
|
432
|
+
version: "22.2.3",
|
|
433
|
+
ngImport: i0,
|
|
434
|
+
type: StyleLazyLoader,
|
|
435
|
+
decorators: [{
|
|
436
|
+
type: Injectable,
|
|
437
|
+
args: [{ providedIn: "root" }]
|
|
438
|
+
}]
|
|
439
|
+
});
|
|
579
440
|
export { ASSET_PATH_OVERRIDE_REDUCER_TOKEN, ASSET_PATH_OVERRIDE_STORE_NAME, AssetPathOverrideStoreModule, CMS_ASSETS_PATH_TOKEN, DYNAMIC_CONTENT_BASE_PATH_TOKEN, DynamicContentService, O3rDynamicContentPipe, RequestParametersService, StorageStrategy, StyleLazyLoader, assetPathOverrideInitialState, assetPathOverrideReducer, assetPathOverrideReducerFeatures, assetPathOverrideStorageDeserializer, assetPathOverrideStorageSync, defaultConfigFactory, defaultRequestParametersConfig, getCmsAssets, getDefaultAssetPathOverrideReducer, getDynamicContent, provideAssetPathOverrideStore, provideDynamicContent, provideRequestParameters, selectAssetPathOverride, selectAssetPathOverrideState, setAssetPathOverride, withBasePath, withCmsAssetsPath };
|
|
580
|
-
|
|
441
|
+
|
|
442
|
+
//# sourceMappingURL=o3r-dynamic-content.mjs.map
|