@ethlete/contentful 4.0.0-next.0 → 4.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/CHANGELOG.md +12 -0
- package/fesm2022/ethlete-contentful.mjs +198 -72
- package/fesm2022/ethlete-contentful.mjs.map +1 -1
- package/package.json +10 -8
- package/types/ethlete-contentful.d.ts +38 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @ethlete/contentful
|
|
2
2
|
|
|
3
|
+
## 4.0.0-next.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`a690217`](https://github.com/ethlete-io/ethdk/commit/a6902172efd9bd1956a16237e79acbfbd816d946) Thanks [@TomTomB](https://github.com/TomTomB)! - Version bump only
|
|
8
|
+
|
|
9
|
+
## 4.0.0-next.1
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`b71e18f`](https://github.com/ethlete-io/ethdk/commit/b71e18fba16c08be9da03a16ba9bd74239626485) Thanks [@TomTomB](https://github.com/TomTomB)! - Use router link for internal links in contentful renderer
|
|
14
|
+
|
|
3
15
|
## 4.0.0-next.0
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { NgClass, DOCUMENT } from '@angular/common';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
|
-
import { input, computed, ViewEncapsulation, ChangeDetectionStrategy, Component, InjectionToken, inject, numberAttribute, booleanAttribute, isDevMode, ViewContainerRef, ElementRef } from '@angular/core';
|
|
3
|
+
import { input, computed, ViewEncapsulation, ChangeDetectionStrategy, Component, InjectionToken, inject, numberAttribute, booleanAttribute, isDevMode, ViewContainerRef, ElementRef, reflectComponentType } from '@angular/core';
|
|
4
4
|
import { gql } from '@ethlete/query';
|
|
5
5
|
import { normalizePictureSizes, PictureComponent } from '@ethlete/cdk';
|
|
6
|
+
import { RouterLink } from '@angular/router';
|
|
6
7
|
import { toSignal, toObservable, takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
7
8
|
import { INLINES, BLOCKS } from '@contentful/rich-text-types';
|
|
8
9
|
import { RuntimeError, isObject, injectRenderer, getObjectProperty } from '@ethlete/core';
|
|
@@ -29,10 +30,10 @@ const isContentfulGqlAsset = (asset) => {
|
|
|
29
30
|
|
|
30
31
|
class ContentfulAudioComponent {
|
|
31
32
|
constructor() {
|
|
32
|
-
this.asset = input.required(...(ngDevMode ? [{ debugName: "asset" }] : []));
|
|
33
|
-
this.audioClass = input(null, ...(ngDevMode ? [{ debugName: "audioClass" }] : []));
|
|
34
|
-
this.figureClass = input(null, ...(ngDevMode ? [{ debugName: "figureClass" }] : []));
|
|
35
|
-
this.figcaptionClass = input(null, ...(ngDevMode ? [{ debugName: "figcaptionClass" }] : []));
|
|
33
|
+
this.asset = input.required(...(ngDevMode ? [{ debugName: "asset" }] : /* istanbul ignore next */ []));
|
|
34
|
+
this.audioClass = input(null, ...(ngDevMode ? [{ debugName: "audioClass" }] : /* istanbul ignore next */ []));
|
|
35
|
+
this.figureClass = input(null, ...(ngDevMode ? [{ debugName: "figureClass" }] : /* istanbul ignore next */ []));
|
|
36
|
+
this.figcaptionClass = input(null, ...(ngDevMode ? [{ debugName: "figcaptionClass" }] : /* istanbul ignore next */ []));
|
|
36
37
|
this.data = computed(() => {
|
|
37
38
|
const asset = this.asset();
|
|
38
39
|
if (!asset) {
|
|
@@ -48,10 +49,10 @@ class ContentfulAudioComponent {
|
|
|
48
49
|
url: asset.fields.file.url,
|
|
49
50
|
title: asset.fields.title,
|
|
50
51
|
};
|
|
51
|
-
}, ...(ngDevMode ? [{ debugName: "data" }] : []));
|
|
52
|
+
}, ...(ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []));
|
|
52
53
|
}
|
|
53
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.
|
|
54
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.
|
|
54
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.13", ngImport: i0, type: ContentfulAudioComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
55
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.13", type: ContentfulAudioComponent, isStandalone: true, selector: "et-contentful-audio", inputs: { asset: { classPropertyName: "asset", publicName: "asset", isSignal: true, isRequired: true, transformFunction: null }, audioClass: { classPropertyName: "audioClass", publicName: "audioClass", isSignal: true, isRequired: false, transformFunction: null }, figureClass: { classPropertyName: "figureClass", publicName: "figureClass", isSignal: true, isRequired: false, transformFunction: null }, figcaptionClass: { classPropertyName: "figcaptionClass", publicName: "figcaptionClass", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
|
|
55
56
|
@if (data(); as data) {
|
|
56
57
|
<figure [ngClass]="figureClass()">
|
|
57
58
|
<figcaption [ngClass]="figcaptionClass()">{{ data.title }}</figcaption>
|
|
@@ -60,7 +61,7 @@ class ContentfulAudioComponent {
|
|
|
60
61
|
}
|
|
61
62
|
`, isInline: true, dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
62
63
|
}
|
|
63
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.
|
|
64
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.13", ngImport: i0, type: ContentfulAudioComponent, decorators: [{
|
|
64
65
|
type: Component,
|
|
65
66
|
args: [{
|
|
66
67
|
selector: 'et-contentful-audio',
|
|
@@ -80,8 +81,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImpor
|
|
|
80
81
|
|
|
81
82
|
class ContentfulFileComponent {
|
|
82
83
|
constructor() {
|
|
83
|
-
this.asset = input.required(...(ngDevMode ? [{ debugName: "asset" }] : []));
|
|
84
|
-
this.fileClass = input(null, ...(ngDevMode ? [{ debugName: "fileClass" }] : []));
|
|
84
|
+
this.asset = input.required(...(ngDevMode ? [{ debugName: "asset" }] : /* istanbul ignore next */ []));
|
|
85
|
+
this.fileClass = input(null, ...(ngDevMode ? [{ debugName: "fileClass" }] : /* istanbul ignore next */ []));
|
|
85
86
|
this.data = computed(() => {
|
|
86
87
|
const asset = this.asset();
|
|
87
88
|
if (!asset) {
|
|
@@ -101,10 +102,10 @@ class ContentfulFileComponent {
|
|
|
101
102
|
size: asset.fields.file.details.size,
|
|
102
103
|
title: asset.fields.title,
|
|
103
104
|
};
|
|
104
|
-
}, ...(ngDevMode ? [{ debugName: "data" }] : []));
|
|
105
|
+
}, ...(ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []));
|
|
105
106
|
}
|
|
106
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.
|
|
107
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.
|
|
107
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.13", ngImport: i0, type: ContentfulFileComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
108
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.13", type: ContentfulFileComponent, isStandalone: true, selector: "et-contentful-file", inputs: { asset: { classPropertyName: "asset", publicName: "asset", isSignal: true, isRequired: true, transformFunction: null }, fileClass: { classPropertyName: "fileClass", publicName: "fileClass", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
|
|
108
109
|
@if (data(); as data) {
|
|
109
110
|
<a [href]="data.url" [ngClass]="fileClass()" class="underline" target="_blank">
|
|
110
111
|
{{ data.title }} ({{ data.size }} Bytes)
|
|
@@ -112,7 +113,7 @@ class ContentfulFileComponent {
|
|
|
112
113
|
}
|
|
113
114
|
`, isInline: true, dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
114
115
|
}
|
|
115
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.
|
|
116
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.13", ngImport: i0, type: ContentfulFileComponent, decorators: [{
|
|
116
117
|
type: Component,
|
|
117
118
|
args: [{
|
|
118
119
|
selector: 'et-contentful-file',
|
|
@@ -233,18 +234,18 @@ const generateContentfulImageSources = (data, srcsetSizes, backgroundColor, qual
|
|
|
233
234
|
class ContentfulImageComponent {
|
|
234
235
|
constructor() {
|
|
235
236
|
this._contentfulConfig = inject(CONTENTFUL_CONFIG);
|
|
236
|
-
this.asset = input.required(...(ngDevMode ? [{ debugName: "asset" }] : []));
|
|
237
|
-
this.backgroundColor = input(null, ...(ngDevMode ? [{ debugName: "backgroundColor" }] : []));
|
|
238
|
-
this.srcsetSizes = input(this._contentfulConfig.imageOptions.srcsetSizes, ...(ngDevMode ? [{ debugName: "srcsetSizes" }] : []));
|
|
239
|
-
this.quality = input(null, { ...(ngDevMode ? { debugName: "quality" } : {}), transform: numberAttribute });
|
|
240
|
-
this.focusArea = input(null, ...(ngDevMode ? [{ debugName: "focusArea" }] : []));
|
|
241
|
-
this.resizeBehavior = input(null, ...(ngDevMode ? [{ debugName: "resizeBehavior" }] : []));
|
|
242
|
-
this.hasPriority = input(false, { ...(ngDevMode ? { debugName: "hasPriority" } : {}), transform: booleanAttribute });
|
|
243
|
-
this.imgClass = input(null, ...(ngDevMode ? [{ debugName: "imgClass" }] : []));
|
|
244
|
-
this.figureClass = input(null, ...(ngDevMode ? [{ debugName: "figureClass" }] : []));
|
|
245
|
-
this.figcaptionClass = input(null, ...(ngDevMode ? [{ debugName: "figcaptionClass" }] : []));
|
|
246
|
-
this.pictureClass = input(null, ...(ngDevMode ? [{ debugName: "pictureClass" }] : []));
|
|
247
|
-
this.sizes = input(normalizePictureSizes(this._contentfulConfig.imageOptions.sizes), { ...(ngDevMode ? { debugName: "sizes" } : {}), transform: (v) => normalizePictureSizes(v) });
|
|
237
|
+
this.asset = input.required(...(ngDevMode ? [{ debugName: "asset" }] : /* istanbul ignore next */ []));
|
|
238
|
+
this.backgroundColor = input(null, ...(ngDevMode ? [{ debugName: "backgroundColor" }] : /* istanbul ignore next */ []));
|
|
239
|
+
this.srcsetSizes = input(this._contentfulConfig.imageOptions.srcsetSizes, ...(ngDevMode ? [{ debugName: "srcsetSizes" }] : /* istanbul ignore next */ []));
|
|
240
|
+
this.quality = input(null, { ...(ngDevMode ? { debugName: "quality" } : /* istanbul ignore next */ {}), transform: numberAttribute });
|
|
241
|
+
this.focusArea = input(null, ...(ngDevMode ? [{ debugName: "focusArea" }] : /* istanbul ignore next */ []));
|
|
242
|
+
this.resizeBehavior = input(null, ...(ngDevMode ? [{ debugName: "resizeBehavior" }] : /* istanbul ignore next */ []));
|
|
243
|
+
this.hasPriority = input(false, { ...(ngDevMode ? { debugName: "hasPriority" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
244
|
+
this.imgClass = input(null, ...(ngDevMode ? [{ debugName: "imgClass" }] : /* istanbul ignore next */ []));
|
|
245
|
+
this.figureClass = input(null, ...(ngDevMode ? [{ debugName: "figureClass" }] : /* istanbul ignore next */ []));
|
|
246
|
+
this.figcaptionClass = input(null, ...(ngDevMode ? [{ debugName: "figcaptionClass" }] : /* istanbul ignore next */ []));
|
|
247
|
+
this.pictureClass = input(null, ...(ngDevMode ? [{ debugName: "pictureClass" }] : /* istanbul ignore next */ []));
|
|
248
|
+
this.sizes = input(normalizePictureSizes(this._contentfulConfig.imageOptions.sizes), { ...(ngDevMode ? { debugName: "sizes" } : /* istanbul ignore next */ {}), transform: (v) => normalizePictureSizes(v) });
|
|
248
249
|
this.normalizedAsset = computed(() => {
|
|
249
250
|
const asset = this.asset();
|
|
250
251
|
if (isContentfulGqlAsset(asset)) {
|
|
@@ -263,7 +264,7 @@ class ContentfulImageComponent {
|
|
|
263
264
|
height: asset?.fields?.file?.details?.image?.height ?? null,
|
|
264
265
|
};
|
|
265
266
|
}
|
|
266
|
-
}, ...(ngDevMode ? [{ debugName: "normalizedAsset" }] : []));
|
|
267
|
+
}, ...(ngDevMode ? [{ debugName: "normalizedAsset" }] : /* istanbul ignore next */ []));
|
|
267
268
|
this._sources = computed(() => {
|
|
268
269
|
const asset = this.asset();
|
|
269
270
|
const backgroundColor = this.backgroundColor();
|
|
@@ -275,14 +276,14 @@ class ContentfulImageComponent {
|
|
|
275
276
|
return [];
|
|
276
277
|
}
|
|
277
278
|
return generateContentfulImageSources(asset, srcsetSizes, backgroundColor, quality, focusArea, resizeBehavior);
|
|
278
|
-
}, ...(ngDevMode ? [{ debugName: "_sources" }] : []));
|
|
279
|
+
}, ...(ngDevMode ? [{ debugName: "_sources" }] : /* istanbul ignore next */ []));
|
|
279
280
|
this._defaultSrc = computed(() => {
|
|
280
281
|
const asset = this.asset();
|
|
281
282
|
return asset ? generateDefaultContentfulImageSource(asset) : null;
|
|
282
|
-
}, ...(ngDevMode ? [{ debugName: "_defaultSrc" }] : []));
|
|
283
|
+
}, ...(ngDevMode ? [{ debugName: "_defaultSrc" }] : /* istanbul ignore next */ []));
|
|
283
284
|
}
|
|
284
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.
|
|
285
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.
|
|
285
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.13", ngImport: i0, type: ContentfulImageComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
286
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.13", type: ContentfulImageComponent, isStandalone: true, selector: "et-contentful-image", inputs: { asset: { classPropertyName: "asset", publicName: "asset", isSignal: true, isRequired: true, transformFunction: null }, backgroundColor: { classPropertyName: "backgroundColor", publicName: "backgroundColor", isSignal: true, isRequired: false, transformFunction: null }, srcsetSizes: { classPropertyName: "srcsetSizes", publicName: "srcsetSizes", isSignal: true, isRequired: false, transformFunction: null }, quality: { classPropertyName: "quality", publicName: "quality", isSignal: true, isRequired: false, transformFunction: null }, focusArea: { classPropertyName: "focusArea", publicName: "focusArea", isSignal: true, isRequired: false, transformFunction: null }, resizeBehavior: { classPropertyName: "resizeBehavior", publicName: "resizeBehavior", isSignal: true, isRequired: false, transformFunction: null }, hasPriority: { classPropertyName: "hasPriority", publicName: "hasPriority", isSignal: true, isRequired: false, transformFunction: null }, imgClass: { classPropertyName: "imgClass", publicName: "imgClass", isSignal: true, isRequired: false, transformFunction: null }, figureClass: { classPropertyName: "figureClass", publicName: "figureClass", isSignal: true, isRequired: false, transformFunction: null }, figcaptionClass: { classPropertyName: "figcaptionClass", publicName: "figcaptionClass", isSignal: true, isRequired: false, transformFunction: null }, pictureClass: { classPropertyName: "pictureClass", publicName: "pictureClass", isSignal: true, isRequired: false, transformFunction: null }, sizes: { classPropertyName: "sizes", publicName: "sizes", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "et-contentful-image" }, ngImport: i0, template: `
|
|
286
287
|
<et-picture
|
|
287
288
|
[imgClass]="imgClass()"
|
|
288
289
|
[hasPriority]="hasPriority()"
|
|
@@ -299,7 +300,7 @@ class ContentfulImageComponent {
|
|
|
299
300
|
/>
|
|
300
301
|
`, isInline: true, dependencies: [{ kind: "component", type: PictureComponent, selector: "et-picture", inputs: ["sources", "hasPriority", "imgClass", "figureClass", "figcaptionClass", "pictureClass", "defaultSrc", "alt", "figcaption", "width", "height", "sizes"], outputs: ["imgLoaded", "imgError"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
301
302
|
}
|
|
302
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.
|
|
303
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.13", ngImport: i0, type: ContentfulImageComponent, decorators: [{
|
|
303
304
|
type: Component,
|
|
304
305
|
args: [{
|
|
305
306
|
selector: 'et-contentful-image',
|
|
@@ -330,8 +331,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImpor
|
|
|
330
331
|
|
|
331
332
|
class ContentfulVideoComponent {
|
|
332
333
|
constructor() {
|
|
333
|
-
this.asset = input.required(...(ngDevMode ? [{ debugName: "asset" }] : []));
|
|
334
|
-
this.videoClass = input(null, ...(ngDevMode ? [{ debugName: "videoClass" }] : []));
|
|
334
|
+
this.asset = input.required(...(ngDevMode ? [{ debugName: "asset" }] : /* istanbul ignore next */ []));
|
|
335
|
+
this.videoClass = input(null, ...(ngDevMode ? [{ debugName: "videoClass" }] : /* istanbul ignore next */ []));
|
|
335
336
|
this.data = computed(() => {
|
|
336
337
|
const asset = this.asset();
|
|
337
338
|
if (!asset) {
|
|
@@ -347,10 +348,10 @@ class ContentfulVideoComponent {
|
|
|
347
348
|
url: asset.fields.file.url,
|
|
348
349
|
contentType: asset.fields.file.contentType,
|
|
349
350
|
};
|
|
350
|
-
}, ...(ngDevMode ? [{ debugName: "data" }] : []));
|
|
351
|
+
}, ...(ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []));
|
|
351
352
|
}
|
|
352
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.
|
|
353
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.
|
|
353
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.13", ngImport: i0, type: ContentfulVideoComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
354
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.13", type: ContentfulVideoComponent, isStandalone: true, selector: "et-contentful-video", inputs: { asset: { classPropertyName: "asset", publicName: "asset", isSignal: true, isRequired: true, transformFunction: null }, videoClass: { classPropertyName: "videoClass", publicName: "videoClass", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
|
|
354
355
|
@if (data(); as data) {
|
|
355
356
|
<video [ngClass]="videoClass()" controls>
|
|
356
357
|
<source src="{{ data.url }}" type="{{ data.contentType }}" />
|
|
@@ -358,7 +359,7 @@ class ContentfulVideoComponent {
|
|
|
358
359
|
}
|
|
359
360
|
`, isInline: true, dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
360
361
|
}
|
|
361
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.
|
|
362
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.13", ngImport: i0, type: ContentfulVideoComponent, decorators: [{
|
|
362
363
|
type: Component,
|
|
363
364
|
args: [{
|
|
364
365
|
selector: 'et-contentful-video',
|
|
@@ -379,11 +380,13 @@ const createContentfulConfig = (config = {}) => ({
|
|
|
379
380
|
// This default config must be inline and not saved inside a const for some weird webpack reason
|
|
380
381
|
...{
|
|
381
382
|
useTailwindClasses: false,
|
|
383
|
+
internalHosts: [],
|
|
382
384
|
components: {
|
|
383
385
|
audio: ContentfulAudioComponent,
|
|
384
386
|
file: ContentfulFileComponent,
|
|
385
387
|
image: ContentfulImageComponent,
|
|
386
388
|
video: ContentfulVideoComponent,
|
|
389
|
+
link: ContentfulLinkComponent,
|
|
387
390
|
},
|
|
388
391
|
customComponents: {},
|
|
389
392
|
imageOptions: {
|
|
@@ -395,6 +398,107 @@ const createContentfulConfig = (config = {}) => ({
|
|
|
395
398
|
...(config || {}),
|
|
396
399
|
});
|
|
397
400
|
|
|
401
|
+
const getPrimaryDomain = (host) => {
|
|
402
|
+
const parts = host.split('.');
|
|
403
|
+
return parts.length > 2 ? parts.slice(-2).join('.') : host;
|
|
404
|
+
};
|
|
405
|
+
class ContentfulLinkComponent {
|
|
406
|
+
constructor() {
|
|
407
|
+
this._document = inject(DOCUMENT);
|
|
408
|
+
this._config = inject(CONTENTFUL_CONFIG, { optional: true }) ?? createContentfulConfig();
|
|
409
|
+
this.href = input.required(...(ngDevMode ? [{ debugName: "href" }] : /* istanbul ignore next */ []));
|
|
410
|
+
this.text = input.required(...(ngDevMode ? [{ debugName: "text" }] : /* istanbul ignore next */ []));
|
|
411
|
+
this.textClass = input('', ...(ngDevMode ? [{ debugName: "textClass" }] : /* istanbul ignore next */ []));
|
|
412
|
+
this.isExternal = computed(() => {
|
|
413
|
+
const href = this.href();
|
|
414
|
+
const isAbsolute = href.startsWith('http://') || href.startsWith('https://') || href.startsWith('//');
|
|
415
|
+
if (!isAbsolute)
|
|
416
|
+
return false;
|
|
417
|
+
try {
|
|
418
|
+
const parsed = new URL(href.startsWith('//') ? `https:${href}` : href);
|
|
419
|
+
const internalHosts = [this._document.location.host, ...this._config.internalHosts];
|
|
420
|
+
return !internalHosts.includes(parsed.host);
|
|
421
|
+
}
|
|
422
|
+
catch {
|
|
423
|
+
return true;
|
|
424
|
+
}
|
|
425
|
+
}, ...(ngDevMode ? [{ debugName: "isExternal" }] : /* istanbul ignore next */ []));
|
|
426
|
+
this.openInNewTab = computed(() => {
|
|
427
|
+
if (!this.isExternal())
|
|
428
|
+
return false;
|
|
429
|
+
const href = this.href();
|
|
430
|
+
try {
|
|
431
|
+
const parsed = new URL(href.startsWith('//') ? `https:${href}` : href);
|
|
432
|
+
const internalPrimaryDomains = [
|
|
433
|
+
getPrimaryDomain(this._document.location.host),
|
|
434
|
+
...this._config.internalHosts.map(getPrimaryDomain),
|
|
435
|
+
];
|
|
436
|
+
return !internalPrimaryDomains.includes(getPrimaryDomain(parsed.host));
|
|
437
|
+
}
|
|
438
|
+
catch {
|
|
439
|
+
return true;
|
|
440
|
+
}
|
|
441
|
+
}, ...(ngDevMode ? [{ debugName: "openInNewTab" }] : /* istanbul ignore next */ []));
|
|
442
|
+
this.internalPath = computed(() => {
|
|
443
|
+
const href = this.href();
|
|
444
|
+
if (!href.startsWith('http://') && !href.startsWith('https://') && !href.startsWith('//')) {
|
|
445
|
+
return href;
|
|
446
|
+
}
|
|
447
|
+
try {
|
|
448
|
+
const url = new URL(href.startsWith('//') ? `https:${href}` : href);
|
|
449
|
+
return url.pathname + url.search + url.hash;
|
|
450
|
+
}
|
|
451
|
+
catch {
|
|
452
|
+
return href;
|
|
453
|
+
}
|
|
454
|
+
}, ...(ngDevMode ? [{ debugName: "internalPath" }] : /* istanbul ignore next */ []));
|
|
455
|
+
this.linkClass = computed(() => {
|
|
456
|
+
const base = 'et-contentful-rich-text-default-element et-contentful-rich-text-default-a';
|
|
457
|
+
const extra = this.textClass();
|
|
458
|
+
return extra ? `${base} ${extra}` : base;
|
|
459
|
+
}, ...(ngDevMode ? [{ debugName: "linkClass" }] : /* istanbul ignore next */ []));
|
|
460
|
+
}
|
|
461
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.13", ngImport: i0, type: ContentfulLinkComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
462
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.13", type: ContentfulLinkComponent, isStandalone: true, selector: "et-contentful-link", inputs: { href: { classPropertyName: "href", publicName: "href", isSignal: true, isRequired: true, transformFunction: null }, text: { classPropertyName: "text", publicName: "text", isSignal: true, isRequired: true, transformFunction: null }, textClass: { classPropertyName: "textClass", publicName: "textClass", isSignal: true, isRequired: false, transformFunction: null } }, host: { styleAttribute: "display: contents" }, ngImport: i0, template: `
|
|
463
|
+
@if (isExternal()) {
|
|
464
|
+
<a
|
|
465
|
+
[class]="linkClass()"
|
|
466
|
+
[href]="href()"
|
|
467
|
+
[target]="openInNewTab() ? '_blank' : null"
|
|
468
|
+
[rel]="openInNewTab() ? 'noopener noreferrer' : null"
|
|
469
|
+
>{{ text() }}</a
|
|
470
|
+
>
|
|
471
|
+
} @else {
|
|
472
|
+
<a [class]="linkClass()" [routerLink]="internalPath()">{{ text() }}</a>
|
|
473
|
+
}
|
|
474
|
+
`, isInline: true, dependencies: [{ kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
475
|
+
}
|
|
476
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.13", ngImport: i0, type: ContentfulLinkComponent, decorators: [{
|
|
477
|
+
type: Component,
|
|
478
|
+
args: [{
|
|
479
|
+
selector: 'et-contentful-link',
|
|
480
|
+
template: `
|
|
481
|
+
@if (isExternal()) {
|
|
482
|
+
<a
|
|
483
|
+
[class]="linkClass()"
|
|
484
|
+
[href]="href()"
|
|
485
|
+
[target]="openInNewTab() ? '_blank' : null"
|
|
486
|
+
[rel]="openInNewTab() ? 'noopener noreferrer' : null"
|
|
487
|
+
>{{ text() }}</a
|
|
488
|
+
>
|
|
489
|
+
} @else {
|
|
490
|
+
<a [class]="linkClass()" [routerLink]="internalPath()">{{ text() }}</a>
|
|
491
|
+
}
|
|
492
|
+
`,
|
|
493
|
+
host: {
|
|
494
|
+
style: 'display: contents',
|
|
495
|
+
},
|
|
496
|
+
imports: [RouterLink],
|
|
497
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
498
|
+
encapsulation: ViewEncapsulation.None,
|
|
499
|
+
}]
|
|
500
|
+
}], propDecorators: { href: [{ type: i0.Input, args: [{ isSignal: true, alias: "href", required: true }] }], text: [{ type: i0.Input, args: [{ isSignal: true, alias: "text", required: true }] }], textClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "textClass", required: false }] }] } });
|
|
501
|
+
|
|
398
502
|
const RICH_TEXT_RENDERER_ERRORS = {
|
|
399
503
|
rich_text_undefined: 'The property value given at richTextPath is undefined. Use the richTextPath input to specify the path to the rich text object.',
|
|
400
504
|
rich_text_wrong_type: 'The rich text object does not satisfy the RichTextResponse interface. It should contain a property named "nodeType" with the value "document".',
|
|
@@ -410,9 +514,9 @@ const RICH_TEXT_RENDERER_ERROR_CODES = Object.keys(RICH_TEXT_RENDERER_ERRORS).re
|
|
|
410
514
|
acc[key] = index;
|
|
411
515
|
return acc;
|
|
412
516
|
}, {});
|
|
413
|
-
const richTextRendererError = (code,
|
|
517
|
+
const richTextRendererError = (code, data) => {
|
|
414
518
|
const message = `<et-contentful-rich-text-renderer>: ${RICH_TEXT_RENDERER_ERRORS[code]}`;
|
|
415
|
-
throw new RuntimeError(RICH_TEXT_RENDERER_ERROR_CODES[code], message,
|
|
519
|
+
throw new RuntimeError(RICH_TEXT_RENDERER_ERROR_CODES[code], message, data);
|
|
416
520
|
};
|
|
417
521
|
|
|
418
522
|
const isRichTextRootNode = (node) => {
|
|
@@ -454,8 +558,6 @@ const translateContentfulNodeTypeToHtmlTag = (nodeType) => {
|
|
|
454
558
|
return 'th';
|
|
455
559
|
case BLOCKS.EMBEDDED_ASSET:
|
|
456
560
|
return 'div';
|
|
457
|
-
case INLINES.HYPERLINK:
|
|
458
|
-
return 'a';
|
|
459
561
|
case INLINES.ENTRY_HYPERLINK:
|
|
460
562
|
return 'a';
|
|
461
563
|
case INLINES.ASSET_HYPERLINK:
|
|
@@ -566,6 +668,7 @@ const DEFAULT_COMPONENT_TYPES = {
|
|
|
566
668
|
VIDEO: '$$$_et-video',
|
|
567
669
|
AUDIO: '$$$_et-audio',
|
|
568
670
|
FILE: '$$$_et-file',
|
|
671
|
+
LINK: '$$$_et-link',
|
|
569
672
|
};
|
|
570
673
|
const isExecutedComponentCommandCacheItem = (cache) => {
|
|
571
674
|
return isComponentRenderCommand(cache.command);
|
|
@@ -645,12 +748,12 @@ class ContentfulRichTextRendererComponent {
|
|
|
645
748
|
* The contentful response gotten via their REST api.
|
|
646
749
|
* @see https://www.contentful.com/developers/docs/references/content-delivery-api/#/reference/entries/entries-collection
|
|
647
750
|
*/
|
|
648
|
-
this.content = input.required(...(ngDevMode ? [{ debugName: "content" }] : []));
|
|
751
|
+
this.content = input.required(...(ngDevMode ? [{ debugName: "content" }] : /* istanbul ignore next */ []));
|
|
649
752
|
/**
|
|
650
753
|
* The path to where the rich text field is inside the contentful response. Dot and array notation is allowed.
|
|
651
754
|
* @example "items[0].fields.html"
|
|
652
755
|
*/
|
|
653
|
-
this.richTextPath = input.required(...(ngDevMode ? [{ debugName: "richTextPath" }] : []));
|
|
756
|
+
this.richTextPath = input.required(...(ngDevMode ? [{ debugName: "richTextPath" }] : /* istanbul ignore next */ []));
|
|
654
757
|
/**
|
|
655
758
|
* A map of all includes in the contentful response.
|
|
656
759
|
* This is useful for looking up assets and entries that are referenced in the rich text without having to use loops.
|
|
@@ -660,7 +763,7 @@ class ContentfulRichTextRendererComponent {
|
|
|
660
763
|
const assets = content?.includes.Asset;
|
|
661
764
|
const entries = content?.includes.Entry;
|
|
662
765
|
return createContentfulIncludeMap({ assets: assets ?? [], entries: entries ?? [] });
|
|
663
|
-
}, ...(ngDevMode ? [{ debugName: "contentIncludesMap" }] : []));
|
|
766
|
+
}, ...(ngDevMode ? [{ debugName: "contentIncludesMap" }] : /* istanbul ignore next */ []));
|
|
664
767
|
/**
|
|
665
768
|
* The rich text data that should be rendered.
|
|
666
769
|
*/
|
|
@@ -672,20 +775,20 @@ class ContentfulRichTextRendererComponent {
|
|
|
672
775
|
}
|
|
673
776
|
const richText = getObjectProperty(content, richTextPath);
|
|
674
777
|
if (!isObject(richText)) {
|
|
675
|
-
throw richTextRendererError('rich_text_undefined',
|
|
778
|
+
throw richTextRendererError('rich_text_undefined', { content, richTextPath });
|
|
676
779
|
}
|
|
677
780
|
if (!isRichTextRootNode(richText)) {
|
|
678
|
-
throw richTextRendererError('rich_text_wrong_type',
|
|
781
|
+
throw richTextRendererError('rich_text_wrong_type', { content, richTextPath });
|
|
679
782
|
}
|
|
680
783
|
return richText;
|
|
681
|
-
}, ...(ngDevMode ? [{ debugName: "richTextData" }] : []));
|
|
784
|
+
}, ...(ngDevMode ? [{ debugName: "richTextData" }] : /* istanbul ignore next */ []));
|
|
682
785
|
this.renderCommands = computed(() => {
|
|
683
786
|
const richTextData = this.richTextData();
|
|
684
787
|
if (!richTextData) {
|
|
685
788
|
return [];
|
|
686
789
|
}
|
|
687
790
|
return this._createRenderCommands(richTextData);
|
|
688
|
-
}, ...(ngDevMode ? [{ debugName: "renderCommands" }] : []));
|
|
791
|
+
}, ...(ngDevMode ? [{ debugName: "renderCommands" }] : /* istanbul ignore next */ []));
|
|
689
792
|
this.renderCommandHistory = toSignal(toObservable(this.renderCommands).pipe(startWith([]), pairwise()), { initialValue: [[], []] });
|
|
690
793
|
this.previousRenderCommandMap = computed(() => {
|
|
691
794
|
const [prevCommands] = this.renderCommandHistory();
|
|
@@ -694,7 +797,7 @@ class ContentfulRichTextRendererComponent {
|
|
|
694
797
|
map.set(getRenderCommandId(command), command);
|
|
695
798
|
}
|
|
696
799
|
return map;
|
|
697
|
-
}, ...(ngDevMode ? [{ debugName: "previousRenderCommandMap" }] : []));
|
|
800
|
+
}, ...(ngDevMode ? [{ debugName: "previousRenderCommandMap" }] : /* istanbul ignore next */ []));
|
|
698
801
|
this.renderInstructions = computed(() => {
|
|
699
802
|
const commands = this.renderCommands();
|
|
700
803
|
const previousRenderCommandMap = new Map(this.previousRenderCommandMap());
|
|
@@ -760,7 +863,7 @@ class ContentfulRichTextRendererComponent {
|
|
|
760
863
|
}
|
|
761
864
|
}
|
|
762
865
|
return instructions;
|
|
763
|
-
}, ...(ngDevMode ? [{ debugName: "renderInstructions" }] : []));
|
|
866
|
+
}, ...(ngDevMode ? [{ debugName: "renderInstructions" }] : /* istanbul ignore next */ []));
|
|
764
867
|
toObservable(this.renderInstructions)
|
|
765
868
|
.pipe(takeUntilDestroyed(), tap((instructions) => {
|
|
766
869
|
this._execInstructions(instructions);
|
|
@@ -813,11 +916,11 @@ class ContentfulRichTextRendererComponent {
|
|
|
813
916
|
const type = RENDER_COMMAND_TYPE.COMPONENT;
|
|
814
917
|
const assetId = node.data['target']?.sys?.id;
|
|
815
918
|
if (!assetId) {
|
|
816
|
-
throw richTextRendererError('asset_id_not_found',
|
|
919
|
+
throw richTextRendererError('asset_id_not_found', { node });
|
|
817
920
|
}
|
|
818
921
|
const asset = this.contentIncludesMap().getAsset(assetId);
|
|
819
922
|
if (!asset) {
|
|
820
|
-
throw richTextRendererError('asset_not_found',
|
|
923
|
+
throw richTextRendererError('asset_not_found', { assetId, node });
|
|
821
924
|
}
|
|
822
925
|
const contentType = asset.fields.file.contentType;
|
|
823
926
|
const assetComponents = this._config.components;
|
|
@@ -868,22 +971,51 @@ class ContentfulRichTextRendererComponent {
|
|
|
868
971
|
domPosition++;
|
|
869
972
|
break;
|
|
870
973
|
}
|
|
974
|
+
case INLINES.HYPERLINK: {
|
|
975
|
+
const uri = node.data['uri'] ?? '';
|
|
976
|
+
// Collect all text and marks from children (hyperlink children are text nodes)
|
|
977
|
+
let linkText = '';
|
|
978
|
+
const linkMarks = [];
|
|
979
|
+
for (const child of node.content) {
|
|
980
|
+
if (child.nodeType === 'text') {
|
|
981
|
+
linkText += child.value;
|
|
982
|
+
linkMarks.push(...child.marks);
|
|
983
|
+
}
|
|
984
|
+
}
|
|
985
|
+
const textClass = linkMarks.length ? marksToClass(linkMarks) : '';
|
|
986
|
+
let linkComponentId = componentIdMap.get(DEFAULT_COMPONENT_TYPES.LINK) ?? -1;
|
|
987
|
+
const linkId = DEFAULT_COMPONENT_TYPES.LINK + ++linkComponentId;
|
|
988
|
+
componentIdMap.set(DEFAULT_COMPONENT_TYPES.LINK, linkComponentId);
|
|
989
|
+
const linkCommand = [
|
|
990
|
+
RENDER_COMMAND_TYPE.COMPONENT,
|
|
991
|
+
nestingLevel,
|
|
992
|
+
domPosition,
|
|
993
|
+
commandIndex++,
|
|
994
|
+
{},
|
|
995
|
+
this._config.components.link,
|
|
996
|
+
{ href: uri, text: linkText, textClass },
|
|
997
|
+
linkId,
|
|
998
|
+
];
|
|
999
|
+
rootCommands.push(linkCommand);
|
|
1000
|
+
domPosition++;
|
|
1001
|
+
break;
|
|
1002
|
+
}
|
|
871
1003
|
case BLOCKS.EMBEDDED_ENTRY:
|
|
872
1004
|
case INLINES.EMBEDDED_ENTRY: {
|
|
873
1005
|
// Render component
|
|
874
1006
|
const type = RENDER_COMMAND_TYPE.COMPONENT;
|
|
875
1007
|
const entryId = node.data['target']?.sys?.id;
|
|
876
1008
|
if (!entryId) {
|
|
877
|
-
throw richTextRendererError('entry_id_not_found',
|
|
1009
|
+
throw richTextRendererError('entry_id_not_found', { node });
|
|
878
1010
|
}
|
|
879
1011
|
const entry = this.contentIncludesMap().getEntry(entryId, ET_CONTENTFUL_ANY_ENTRY_CONTENT_TYPE_SYS_ID);
|
|
880
1012
|
if (!entry) {
|
|
881
|
-
throw richTextRendererError('entry_not_found',
|
|
1013
|
+
throw richTextRendererError('entry_not_found', { entryId, node });
|
|
882
1014
|
}
|
|
883
1015
|
const componentType = entry.sys.contentType.sys.id;
|
|
884
1016
|
const component = this._config.customComponents[componentType];
|
|
885
1017
|
if (!component) {
|
|
886
|
-
throw richTextRendererError('custom_component_not_found',
|
|
1018
|
+
throw richTextRendererError('custom_component_not_found', {
|
|
887
1019
|
componentType,
|
|
888
1020
|
customComponents: this._config.customComponents,
|
|
889
1021
|
entry,
|
|
@@ -953,15 +1085,6 @@ class ContentfulRichTextRendererComponent {
|
|
|
953
1085
|
rootCommands.push(closeCommand);
|
|
954
1086
|
domPosition++;
|
|
955
1087
|
}
|
|
956
|
-
if (node.nodeType === INLINES.HYPERLINK) {
|
|
957
|
-
const uri = node.data['uri'];
|
|
958
|
-
attributes['href'] = uri;
|
|
959
|
-
const host = this._document.location.host;
|
|
960
|
-
const isExternal = !uri.includes(host);
|
|
961
|
-
if (isExternal) {
|
|
962
|
-
attributes['target'] = '_blank';
|
|
963
|
-
}
|
|
964
|
-
}
|
|
965
1088
|
break;
|
|
966
1089
|
}
|
|
967
1090
|
}
|
|
@@ -1130,10 +1253,13 @@ class ContentfulRichTextRendererComponent {
|
|
|
1130
1253
|
return componentRef.hostView.rootNodes[0];
|
|
1131
1254
|
}
|
|
1132
1255
|
_updateComponentInputs(command, componentRef) {
|
|
1256
|
+
const inputMeta = reflectComponentType(command[COMPONENT_RENDER_COMMAND_POSITION.COMPONENT])?.inputs ?? [];
|
|
1257
|
+
const inputsByProp = new Map(inputMeta.map((i) => [i.propName, i.templateName]));
|
|
1133
1258
|
for (const [key, value] of Object.entries(command[COMPONENT_RENDER_COMMAND_POSITION.INPUTS])) {
|
|
1134
|
-
|
|
1259
|
+
const publicName = inputsByProp.get(key);
|
|
1260
|
+
if (publicName === undefined)
|
|
1135
1261
|
continue;
|
|
1136
|
-
componentRef.setInput(
|
|
1262
|
+
componentRef.setInput(publicName, value);
|
|
1137
1263
|
}
|
|
1138
1264
|
}
|
|
1139
1265
|
_findParent(command) {
|
|
@@ -1198,10 +1324,10 @@ class ContentfulRichTextRendererComponent {
|
|
|
1198
1324
|
this._renderer.appendChild(parentElement, nodeToRender);
|
|
1199
1325
|
}
|
|
1200
1326
|
}
|
|
1201
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.
|
|
1202
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.
|
|
1327
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.13", ngImport: i0, type: ContentfulRichTextRendererComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1328
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.13", type: ContentfulRichTextRendererComponent, isStandalone: true, selector: "et-contentful-rich-text-renderer", inputs: { content: { classPropertyName: "content", publicName: "content", isSignal: true, isRequired: true, transformFunction: null }, richTextPath: { classPropertyName: "richTextPath", publicName: "richTextPath", isSignal: true, isRequired: true, transformFunction: null } }, host: { classAttribute: "et-contentful-rich-text-renderer" }, ngImport: i0, template: ``, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
1203
1329
|
}
|
|
1204
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.
|
|
1330
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.13", ngImport: i0, type: ContentfulRichTextRendererComponent, decorators: [{
|
|
1205
1331
|
type: Component,
|
|
1206
1332
|
args: [{
|
|
1207
1333
|
selector: 'et-contentful-rich-text-renderer',
|
|
@@ -1233,5 +1359,5 @@ const isContentfulEntryType = (entry, type) => entry.sys.contentType.sys.id ===
|
|
|
1233
1359
|
* Generated bundle index. Do not edit.
|
|
1234
1360
|
*/
|
|
1235
1361
|
|
|
1236
|
-
export { COMPONENT_RENDER_COMMAND_POSITION, CONTENTFUL_CONFIG, ContentfulAudioComponent, ContentfulFileComponent, ContentfulImageComponent, ContentfulImports, ContentfulRichTextRendererComponent, ContentfulVideoComponent, ET_CONTENTFUL_ANY_ENTRY_CONTENT_TYPE_SYS_ID, GQL_FRAGMENT_CONTENTFUL_ASSET, HTML_CLOSE_RENDER_COMMAND_POSITION, HTML_OPEN_RENDER_COMMAND_POSITION, RENDER_COMMAND_POSITION, RENDER_COMMAND_TYPE, RENDER_INSTRUCTION_POSITION, RENDER_INSTRUCTION_TYPE, TEXT_RENDER_COMMAND_POSITION, createContentfulConfig, createContentfulIncludeMap, generateContentfulImageSources, generateDefaultContentfulImageSource, getRenderCommandId, isComponentRenderCommand, isContentfulEntryType, isContentfulGqlAsset, isExecutedComponentCommandCacheItem, isExecutedHtmlOrTextCommandCacheItem, isExecutedTextCommandCacheItem, isHtmlCloseRenderCommand, isHtmlOpenRenderCommand, isRichTextRootNode, isTextRenderCommand, marksToClass, parseContentfulImageSize, provideContentfulConfig, translateContentfulNodeTypeToHtmlTag };
|
|
1362
|
+
export { COMPONENT_RENDER_COMMAND_POSITION, CONTENTFUL_CONFIG, ContentfulAudioComponent, ContentfulFileComponent, ContentfulImageComponent, ContentfulImports, ContentfulLinkComponent, ContentfulRichTextRendererComponent, ContentfulVideoComponent, ET_CONTENTFUL_ANY_ENTRY_CONTENT_TYPE_SYS_ID, GQL_FRAGMENT_CONTENTFUL_ASSET, HTML_CLOSE_RENDER_COMMAND_POSITION, HTML_OPEN_RENDER_COMMAND_POSITION, RENDER_COMMAND_POSITION, RENDER_COMMAND_TYPE, RENDER_INSTRUCTION_POSITION, RENDER_INSTRUCTION_TYPE, TEXT_RENDER_COMMAND_POSITION, createContentfulConfig, createContentfulIncludeMap, generateContentfulImageSources, generateDefaultContentfulImageSource, getRenderCommandId, isComponentRenderCommand, isContentfulEntryType, isContentfulGqlAsset, isExecutedComponentCommandCacheItem, isExecutedHtmlOrTextCommandCacheItem, isExecutedTextCommandCacheItem, isHtmlCloseRenderCommand, isHtmlOpenRenderCommand, isRichTextRootNode, isTextRenderCommand, marksToClass, parseContentfulImageSize, provideContentfulConfig, translateContentfulNodeTypeToHtmlTag };
|
|
1237
1363
|
//# sourceMappingURL=ethlete-contentful.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ethlete-contentful.mjs","sources":["../../../../libs/contentful/src/lib/gql/asset.fragments.ts","../../../../libs/contentful/src/lib/components/audio/contentful-audio.component.ts","../../../../libs/contentful/src/lib/components/file/contentful-file.component.ts","../../../../libs/contentful/src/lib/constants/contentful.constants.ts","../../../../libs/contentful/src/lib/components/image/contentful-image.component.utils.ts","../../../../libs/contentful/src/lib/components/image/contentful-image.component.ts","../../../../libs/contentful/src/lib/components/video/contentful-video.component.ts","../../../../libs/contentful/src/lib/utils/contentful-config.ts","../../../../libs/contentful/src/lib/components/rich-text-renderer/rich-text-renderer.errors.ts","../../../../libs/contentful/src/lib/components/rich-text-renderer/rich-text-renderer.util.ts","../../../../libs/contentful/src/lib/components/rich-text-renderer/rich-text-renderer.component.ts","../../../../libs/contentful/src/lib/contentful.imports.ts","../../../../libs/contentful/src/lib/utils/contentful.util.ts","../../../../libs/contentful/src/index.ts","../../../../libs/contentful/src/ethlete-contentful.ts"],"sourcesContent":["import { gql } from '@ethlete/query';\n\nexport const GQL_FRAGMENT_CONTENTFUL_ASSET = gql`\n fragment AssetData on Asset {\n sys {\n id\n }\n url\n title\n width\n height\n description\n contentType\n size\n }\n`;\n\nexport type ContentfulGqlAsset = {\n sys: {\n id: string;\n };\n title: string | null;\n contentType: string | null;\n url: string | null;\n description: string | null;\n width: number | null;\n height: number | null;\n size: number | null;\n};\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const isContentfulGqlAsset = (asset: any): asset is ContentfulGqlAsset => {\n return asset?.sys?.id && asset?.url && typeof asset?.size === 'number';\n};\n\nexport type ContentfulGqlWhereFilter<TLinkedFrom extends Record<string, unknown> = Record<string, unknown>> = {\n /**\n * Filer by ids.\n * @see https://www.contentful.com/developers/docs/references/graphql/#/reference/collection-filters/sys-filters\n */\n sys?: {\n id?: string;\n id_not?: string;\n id_in?: string[];\n id_not_in?: string[];\n id_contains?: string;\n id_not_contains?: string;\n };\n /**\n * Filer by tags.\n * @see https://www.contentful.com/developers/docs/references/graphql/#/reference/collection-filters/contentfulmetadata-filters\n */\n contentfulMetadata?: {\n tags_exists?: boolean;\n tags?: {\n id_contains_some?: string[];\n id_contains_none?: string[];\n id_contains_all?: string[];\n };\n };\n /**\n * Retrieve a collection of entries linked to the specified entry or asset.\n * @see https://www.contentful.com/developers/docs/references/graphql/#links-to-a-specific-item\n */\n linkedFrom?: TLinkedFrom;\n};\n\nexport type ContentfulGqlOrder = `${string}_${'ASC' | 'DESC'}`;\n\nexport type ContentfulGqlCollectionFilterVariables<\n TCustomWhere extends Record<string, unknown> = Record<string, unknown>,\n TLinkedFrom extends Record<string, unknown> = Record<string, unknown>,\n> = {\n /**\n * Zero-indexed offset in the collection from which items are fetched\n * @default 0\n */\n skip?: number;\n\n /**\n * Maximum number of items to fetch. Maximum is 1000.\n * @default 100\n */\n limit?: number;\n\n /**\n * Filter specifications to apply on the collection query.\n * @see https://www.contentful.com/developers/docs/references/graphql/#/reference/collection-filters\n */\n where?: TCustomWhere & ContentfulGqlWhereFilter<TLinkedFrom>;\n\n /**\n * Order specifications to apply on the collection query.\n * @see https://www.contentful.com/developers/docs/references/graphql/#/reference/collection-order\n */\n order?: ContentfulGqlOrder[];\n\n /**\n * When set to `true` the field will be resolved with non published content.\n * @default false\n */\n preview?: boolean;\n\n /**\n * Locale for the collection items. If not set the default locale is used.\n */\n locale?: string;\n};\n","import { NgClass } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, ViewEncapsulation, computed, input } from '@angular/core';\nimport { NgClassType } from '@ethlete/core';\nimport { ContentfulGqlAsset, isContentfulGqlAsset } from '../../gql';\nimport { ContentfulRestAsset } from '../../types';\n\n@Component({\n selector: 'et-contentful-audio',\n template: `\n @if (data(); as data) {\n <figure [ngClass]=\"figureClass()\">\n <figcaption [ngClass]=\"figcaptionClass()\">{{ data.title }}</figcaption>\n <audio [ngClass]=\"audioClass()\" controls src=\"{{ data.url }}\"></audio>\n </figure>\n }\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n imports: [NgClass],\n})\nexport class ContentfulAudioComponent {\n asset = input.required<ContentfulRestAsset | ContentfulGqlAsset | null | undefined>();\n audioClass = input<NgClassType>(null);\n figureClass = input<NgClassType>(null);\n figcaptionClass = input<NgClassType>(null);\n\n data = computed(() => {\n const asset = this.asset();\n\n if (!asset) {\n return null;\n }\n\n if (isContentfulGqlAsset(asset)) {\n return {\n url: asset.url,\n title: asset.title,\n };\n }\n\n return {\n url: asset.fields.file.url,\n title: asset.fields.title,\n };\n });\n}\n","import { NgClass } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, ViewEncapsulation, computed, input } from '@angular/core';\nimport { NgClassType } from '@ethlete/core';\nimport { ContentfulGqlAsset, isContentfulGqlAsset } from '../../gql';\nimport { ContentfulRestAsset } from '../../types';\n\n@Component({\n selector: 'et-contentful-file',\n template: `\n @if (data(); as data) {\n <a [href]=\"data.url\" [ngClass]=\"fileClass()\" class=\"underline\" target=\"_blank\">\n {{ data.title }} ({{ data.size }} Bytes)\n </a>\n }\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n imports: [NgClass],\n})\nexport class ContentfulFileComponent {\n asset = input.required<ContentfulRestAsset | ContentfulGqlAsset | null | undefined>();\n fileClass = input<NgClassType>(null);\n\n data = computed(() => {\n const asset = this.asset();\n\n if (!asset) {\n return null;\n }\n\n if (isContentfulGqlAsset(asset)) {\n return {\n url: asset.url,\n contentType: asset.contentType,\n size: asset.size,\n title: asset.title,\n };\n }\n\n return {\n url: asset.fields.file.url,\n contentType: asset.fields.file.contentType,\n size: asset.fields.file.details.size,\n title: asset.fields.title,\n };\n });\n}\n","import { InjectionToken } from '@angular/core';\n\nimport { ContentfulConfig } from '../types';\n\nexport const CONTENTFUL_CONFIG = new InjectionToken<ContentfulConfig>('ContentfulConfig');\n","import { PictureSource } from '@ethlete/cdk';\nimport { ContentfulGqlAsset, isContentfulGqlAsset } from '../../gql';\nimport { ContentfulImageFocusArea, ContentfulImageResizeBehavior, ContentfulRestAsset } from '../../types';\n\nexport const generateDefaultContentfulImageSource = (data: ContentfulRestAsset | ContentfulGqlAsset): PictureSource => {\n if (isContentfulGqlAsset(data)) {\n if (!data.contentType || !data.url) {\n return {\n type: '',\n srcset: '',\n };\n }\n\n return {\n type: data.contentType,\n srcset: data.url,\n };\n }\n\n if (!data.fields.file.contentType || !data.fields.file.url) {\n return {\n type: '',\n srcset: '',\n };\n }\n\n return {\n type: data.fields.file.contentType,\n srcset: data.fields.file.url,\n };\n};\n\n/**\n * Parses source set sizes into an object containing with and height. Eg.\n * - `\"400\"` - 400px width\n * - `\"400x300\"` - 400px width and 300px height\n * - `\"400w\"` - 400px width\n * - `\"400h\"` - 400px height\n * - `\"400wx300h\"` - 400px width and 300px height\n **/\nexport const parseContentfulImageSize = (size: string): { width: number | null; height: number | null } => {\n let width: string | null | undefined = null;\n let height: string | null | undefined = null;\n\n if (size.includes('x')) {\n const [w, h] = size.split('x');\n\n width = w;\n height = h;\n } else if (size.includes('h')) {\n height = size;\n } else {\n width = size;\n }\n\n return {\n width: width ? parseInt(width, 10) : null,\n height: height ? parseInt(height, 10) : null,\n };\n};\n\nexport const generateContentfulImageSources = (\n data: ContentfulRestAsset | ContentfulGqlAsset,\n srcsetSizes: string[],\n backgroundColor: string | null,\n quality: number | null,\n focusArea: ContentfulImageFocusArea | null,\n resizeBehavior: ContentfulImageResizeBehavior | null,\n): PictureSource[] => {\n const assetData = data;\n\n if (!assetData) {\n return [];\n }\n\n const sources: PictureSource[] = [];\n\n const SOURCE_TYPES = ['image/avif', 'image/webp', 'image/png', 'image/jpg'];\n\n for (const type of SOURCE_TYPES) {\n const baseUrl = isContentfulGqlAsset(assetData) ? assetData.url : assetData.fields.file.url;\n const sourceSets: string[] = [];\n const queryParams: string[] = [];\n\n // Set the format (e.g. 'fm=webp')\n queryParams.push(`fm=${type.split('/')[1]}`);\n\n if (backgroundColor) {\n queryParams.push(`bg=rgb:${backgroundColor}`);\n }\n\n if (quality !== null) {\n queryParams.push(`q=${quality}`);\n }\n\n if (focusArea) {\n queryParams.push(`f=${focusArea}`);\n }\n\n if (resizeBehavior) {\n queryParams.push(`fit=${resizeBehavior}`);\n }\n if (srcsetSizes?.length) {\n const urlWithParams = `${baseUrl}?${queryParams.join('&')}`;\n\n for (const size of srcsetSizes) {\n const { width, height } = parseContentfulImageSize(size);\n\n if (width && height) {\n sourceSets.push(`${urlWithParams}&w=${width}&h=${height} ${width}w`);\n } else if (width) {\n sourceSets.push(`${urlWithParams}&w=${width} ${width}w`);\n } else if (height) {\n sourceSets.push(`${urlWithParams}&h=${height} ${height}h`);\n }\n }\n }\n\n sources.push({\n type,\n srcset: sourceSets.length ? sourceSets.join(', ') : `${baseUrl}?${queryParams.join('&')}`,\n });\n }\n\n return sources;\n};\n","import {\n ChangeDetectionStrategy,\n Component,\n ViewEncapsulation,\n booleanAttribute,\n computed,\n inject,\n input,\n numberAttribute,\n} from '@angular/core';\nimport { PictureComponent, normalizePictureSizes } from '@ethlete/cdk';\nimport { NgClassType } from '@ethlete/core';\nimport { CONTENTFUL_CONFIG } from '../../constants';\nimport { ContentfulGqlAsset, isContentfulGqlAsset } from '../../gql';\nimport { ContentfulImageFocusArea, ContentfulImageResizeBehavior, ContentfulRestAsset } from '../../types';\nimport {\n generateContentfulImageSources,\n generateDefaultContentfulImageSource,\n} from './contentful-image.component.utils';\n\n@Component({\n selector: 'et-contentful-image',\n template: `\n <et-picture\n [imgClass]=\"imgClass()\"\n [hasPriority]=\"hasPriority()\"\n [figureClass]=\"figureClass()\"\n [pictureClass]=\"pictureClass()\"\n [figcaptionClass]=\"figcaptionClass()\"\n [defaultSrc]=\"_defaultSrc()\"\n [alt]=\"normalizedAsset().alt ?? null\"\n [figcaption]=\"normalizedAsset().figcaption ?? null\"\n [width]=\"normalizedAsset().width ?? null\"\n [height]=\"normalizedAsset().height ?? null\"\n [sizes]=\"sizes()\"\n [sources]=\"_sources()\"\n />\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n imports: [PictureComponent],\n host: {\n class: 'et-contentful-image',\n },\n})\nexport class ContentfulImageComponent {\n _contentfulConfig = inject(CONTENTFUL_CONFIG);\n\n asset = input.required<ContentfulRestAsset | ContentfulGqlAsset | null | undefined>();\n backgroundColor = input<string | null>(null);\n srcsetSizes = input<string[]>(this._contentfulConfig.imageOptions.srcsetSizes);\n\n quality = input(null, { transform: numberAttribute });\n focusArea = input<ContentfulImageFocusArea | null>(null);\n resizeBehavior = input<ContentfulImageResizeBehavior | null>(null);\n hasPriority = input(false, { transform: booleanAttribute });\n imgClass = input<NgClassType>(null);\n figureClass = input<NgClassType>(null);\n figcaptionClass = input<NgClassType>(null);\n pictureClass = input<NgClassType>(null);\n sizes = input<string | null, string[] | string | null>(\n normalizePictureSizes(this._contentfulConfig.imageOptions.sizes),\n {\n transform: (v) => normalizePictureSizes(v),\n },\n );\n\n normalizedAsset = computed(() => {\n const asset = this.asset();\n\n if (isContentfulGqlAsset(asset)) {\n return {\n alt: asset.title || null,\n figcaption: asset.description || null,\n width: asset.width,\n height: asset.height,\n };\n } else {\n return {\n alt: asset?.fields?.title || null,\n figcaption: asset?.fields?.description || null,\n width: asset?.fields?.file?.details?.image?.width ?? null,\n height: asset?.fields?.file?.details?.image?.height ?? null,\n };\n }\n });\n\n _sources = computed(() => {\n const asset = this.asset();\n const backgroundColor = this.backgroundColor();\n const srcsetSizes = this.srcsetSizes();\n const quality = this.quality();\n const focusArea = this.focusArea();\n const resizeBehavior = this.resizeBehavior();\n\n if (!asset) {\n return [];\n }\n\n return generateContentfulImageSources(asset, srcsetSizes, backgroundColor, quality, focusArea, resizeBehavior);\n });\n\n _defaultSrc = computed(() => {\n const asset = this.asset();\n\n return asset ? generateDefaultContentfulImageSource(asset) : null;\n });\n}\n","import { NgClass } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, ViewEncapsulation, computed, input } from '@angular/core';\nimport { NgClassType } from '@ethlete/core';\nimport { ContentfulGqlAsset, isContentfulGqlAsset } from '../../gql';\nimport { ContentfulRestAsset } from '../../types';\n\n@Component({\n selector: 'et-contentful-video',\n template: `\n @if (data(); as data) {\n <video [ngClass]=\"videoClass()\" controls>\n <source src=\"{{ data.url }}\" type=\"{{ data.contentType }}\" />\n </video>\n }\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n imports: [NgClass],\n})\nexport class ContentfulVideoComponent {\n asset = input.required<ContentfulRestAsset | ContentfulGqlAsset | null | undefined>();\n videoClass = input<NgClassType>(null);\n\n data = computed(() => {\n const asset = this.asset();\n\n if (!asset) {\n return null;\n }\n\n if (isContentfulGqlAsset(asset)) {\n return {\n url: asset.url,\n contentType: asset.contentType,\n };\n }\n\n return {\n url: asset.fields.file.url,\n contentType: asset.fields.file.contentType,\n };\n });\n}\n","import { ContentfulAudioComponent } from '../components/audio';\nimport { ContentfulFileComponent } from '../components/file';\nimport { ContentfulImageComponent } from '../components/image';\nimport { ContentfulVideoComponent } from '../components/video';\nimport { ContentfulConfig } from '../types';\n\nexport const createContentfulConfig = (\n config: Partial<ContentfulConfig> | null | undefined = {},\n): ContentfulConfig => ({\n // This default config must be inline and not saved inside a const for some weird webpack reason\n ...{\n useTailwindClasses: false,\n components: {\n audio: ContentfulAudioComponent,\n file: ContentfulFileComponent,\n image: ContentfulImageComponent,\n video: ContentfulVideoComponent,\n },\n customComponents: {},\n imageOptions: {\n srcsetSizes: ['375w', '1280w', '1920w', '2560w'],\n sizes: [],\n backgroundColor: null,\n },\n },\n ...(config || {}),\n});\n","import { RuntimeError } from '@ethlete/core';\n\nexport const RICH_TEXT_RENDERER_ERRORS = {\n rich_text_undefined:\n 'The property value given at richTextPath is undefined. Use the richTextPath input to specify the path to the rich text object.',\n rich_text_wrong_type:\n 'The rich text object does not satisfy the RichTextResponse interface. It should contain a property named \"nodeType\" with the value \"document\".',\n\n asset_id_not_found: 'The asset ID was not found. This node is not supported.',\n entry_id_not_found: 'The entry ID was not found. This node is not supported.',\n\n asset_not_found: 'The asset was not found. This node is not supported.',\n entry_not_found: 'The entry was not found. This node is not supported.',\n\n custom_component_not_found: 'No custom component found for entry type. Please provide one for this type.',\n\n text_parent_not_found: 'The parent node is not found. This structure is not supported.',\n text_parent_wrong_type:\n 'The parent node neither a html element nor a custom component. This structure is not supported.',\n} as const;\n\nconst RICH_TEXT_RENDERER_ERROR_CODES = Object.keys(RICH_TEXT_RENDERER_ERRORS).reduce(\n (acc, key, index) => {\n acc[key as keyof typeof RICH_TEXT_RENDERER_ERRORS] = index;\n return acc;\n },\n {} as Record<keyof typeof RICH_TEXT_RENDERER_ERRORS, number>,\n);\n\nexport const richTextRendererError = (\n code: keyof typeof RICH_TEXT_RENDERER_ERRORS,\n devOnly: boolean,\n data?: unknown,\n) => {\n const message = `<et-contentful-rich-text-renderer>: ${RICH_TEXT_RENDERER_ERRORS[code]}`;\n\n throw new RuntimeError(RICH_TEXT_RENDERER_ERROR_CODES[code], message, devOnly, data);\n};\n","import { BLOCKS, INLINES } from '@contentful/rich-text-types';\nimport { isObject } from '@ethlete/core';\nimport { RichTextResponse } from '../../types';\n\nexport const isRichTextRootNode = (node: unknown): node is RichTextResponse => {\n return isObject(node) && 'nodeType' in node && node['nodeType'] === 'document';\n};\n\nexport const translateContentfulNodeTypeToHtmlTag = (nodeType: 'text' | BLOCKS | INLINES) => {\n switch (nodeType) {\n case BLOCKS.HEADING_1:\n return 'h1';\n case BLOCKS.HEADING_2:\n return 'h2';\n case BLOCKS.HEADING_3:\n return 'h3';\n case BLOCKS.HEADING_4:\n return 'h4';\n case BLOCKS.HEADING_5:\n return 'h5';\n case BLOCKS.HEADING_6:\n return 'h6';\n case BLOCKS.PARAGRAPH:\n return 'p';\n case BLOCKS.UL_LIST:\n return 'ul';\n case BLOCKS.OL_LIST:\n return 'ol';\n case BLOCKS.LIST_ITEM:\n return 'li';\n case BLOCKS.HR:\n return 'hr';\n case BLOCKS.QUOTE:\n return 'blockquote';\n case BLOCKS.TABLE:\n return 'table';\n case BLOCKS.TABLE_ROW:\n return 'tr';\n case BLOCKS.TABLE_CELL:\n return 'td';\n case BLOCKS.TABLE_HEADER_CELL:\n return 'th';\n case BLOCKS.EMBEDDED_ASSET:\n return 'div';\n\n case INLINES.HYPERLINK:\n return 'a';\n case INLINES.ENTRY_HYPERLINK:\n return 'a';\n case INLINES.ASSET_HYPERLINK:\n return 'a';\n\n case 'text':\n return 'span';\n\n // Will be ignored by the renderer\n case 'document':\n return 'div';\n\n case BLOCKS.EMBEDDED_ENTRY:\n return 'div';\n case INLINES.EMBEDDED_ENTRY:\n return 'div';\n\n default:\n return 'div';\n }\n};\n","import { ComponentType } from '@angular/cdk/portal';\nimport { DOCUMENT } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n ComponentRef,\n ElementRef,\n EmbeddedViewRef,\n ViewContainerRef,\n ViewEncapsulation,\n computed,\n inject,\n input,\n isDevMode,\n} from '@angular/core';\nimport { takeUntilDestroyed, toObservable, toSignal } from '@angular/core/rxjs-interop';\nimport { BLOCKS, Block, INLINES, Inline, Mark, Text } from '@contentful/rich-text-types';\nimport { getObjectProperty, injectRenderer, isObject } from '@ethlete/core';\nimport { pairwise, startWith, tap } from 'rxjs';\nimport { CONTENTFUL_CONFIG } from '../../constants/contentful.constants';\nimport {\n ContentfulCollection,\n ContentfulEntry,\n ContentfulEntryLinkItem,\n ContentfulRestAsset,\n RichTextResponse,\n} from '../../types';\nimport { createContentfulConfig } from '../../utils/contentful-config';\nimport { richTextRendererError } from './rich-text-renderer.errors';\nimport { isRichTextRootNode, translateContentfulNodeTypeToHtmlTag } from './rich-text-renderer.util';\n\nexport const RENDER_COMMAND_TYPE = {\n HTML_OPEN: 0,\n HTML_CLOSE: 1,\n TEXT: 2,\n COMPONENT: 3,\n} as const;\n\nexport const RENDER_COMMAND_POSITION = {\n TYPE: 0,\n NESTING_LEVEL: 1,\n DOM_POSITION: 2,\n INDEX: 3,\n} as const;\n\nexport const HTML_OPEN_RENDER_COMMAND_POSITION = {\n ATTRIBUTES: 4,\n TAG_NAME: 5,\n ELEMENT_ID: 6,\n} as const;\n\nexport const HTML_CLOSE_RENDER_COMMAND_POSITION = {\n TAG_NAME: 4,\n ELEMENT_ID: 5,\n} as const;\n\nexport const TEXT_RENDER_COMMAND_POSITION = {\n ATTRIBUTES: 4,\n TEXT: 5,\n TEXT_ID: 6,\n} as const;\n\nexport const COMPONENT_RENDER_COMMAND_POSITION = {\n ATTRIBUTES: 4,\n COMPONENT: 5,\n INPUTS: 6,\n COMPONENT_ID: 7,\n} as const;\n\ntype HtmlOpenRenderCommand = [\n type: typeof RENDER_COMMAND_TYPE.HTML_OPEN,\n nestingLevel: number,\n domPosition: number,\n index: number,\n attributes: Record<string, string>,\n tagName: keyof HTMLElementTagNameMap,\n textId: string,\n];\n\ntype HtmlCloseRenderCommand = [\n type: typeof RENDER_COMMAND_TYPE.HTML_CLOSE,\n nestingLevel: number,\n domPosition: number,\n index: number,\n tagName: keyof HTMLElementTagNameMap,\n elementId: string,\n];\n\ntype TextRenderCommand = [\n type: typeof RENDER_COMMAND_TYPE.TEXT,\n nestingLevel: number,\n domPosition: number,\n index: number,\n attributes: Record<string, string>,\n text: string,\n elementId: string,\n];\n\ntype ComponentRenderCommand = [\n type: typeof RENDER_COMMAND_TYPE.COMPONENT,\n nestingLevel: number,\n domPosition: number,\n index: number,\n attributes: Record<string, string>,\n component: ComponentType<unknown>,\n inputs: Record<string, unknown>,\n componentId: string,\n];\n\ntype RenderCommand = HtmlOpenRenderCommand | HtmlCloseRenderCommand | TextRenderCommand | ComponentRenderCommand;\n\nexport const RENDER_INSTRUCTION_POSITION = {\n TYPE: 0,\n COMMAND: 1,\n} as const;\n\nexport const RENDER_INSTRUCTION_TYPE = {\n CREATE: 0,\n UPDATE: 1,\n DELETE: 2,\n MOVE: 3,\n} as const;\n\ntype RenderInstructionTypeValue = (typeof RENDER_INSTRUCTION_TYPE)[keyof typeof RENDER_INSTRUCTION_TYPE];\n\ntype RenderInstruction = [RenderInstructionTypeValue, RenderCommand];\n\nconst MARK_TAILWIND_MAP: Record<string, string> = {\n bold: 'font-bold',\n italic: 'italic',\n underline: 'underline',\n code: 'font-mono',\n};\n\nexport const marksToClass = (marks: Mark[]) => {\n const classes: string[] = [];\n\n for (const mark of marks) {\n let klass = MARK_TAILWIND_MAP[mark.type];\n\n if (!klass) {\n console.warn(`No class found for mark type! Falling back to \"${mark.type}\".`, mark);\n\n klass = mark.type;\n }\n\n classes.push(klass);\n }\n\n return classes.join(' ');\n};\n\nexport const isHtmlOpenRenderCommand = (command: RenderCommand): command is HtmlOpenRenderCommand => {\n return command[RENDER_COMMAND_POSITION.TYPE] === RENDER_COMMAND_TYPE.HTML_OPEN;\n};\n\nexport const isHtmlCloseRenderCommand = (command: RenderCommand): command is HtmlCloseRenderCommand => {\n return command[RENDER_COMMAND_POSITION.TYPE] === RENDER_COMMAND_TYPE.HTML_CLOSE;\n};\n\nexport const isTextRenderCommand = (command: RenderCommand): command is TextRenderCommand => {\n return command[RENDER_COMMAND_POSITION.TYPE] === RENDER_COMMAND_TYPE.TEXT;\n};\n\nexport const isComponentRenderCommand = (command: RenderCommand): command is ComponentRenderCommand => {\n return command[RENDER_COMMAND_POSITION.TYPE] === RENDER_COMMAND_TYPE.COMPONENT;\n};\n\nexport const getRenderCommandId = (command: RenderCommand) => {\n if (isHtmlOpenRenderCommand(command)) {\n return command[HTML_OPEN_RENDER_COMMAND_POSITION.ELEMENT_ID];\n } else if (isHtmlCloseRenderCommand(command)) {\n return command[HTML_CLOSE_RENDER_COMMAND_POSITION.ELEMENT_ID];\n } else if (isTextRenderCommand(command)) {\n return command[TEXT_RENDER_COMMAND_POSITION.TEXT_ID];\n } else {\n return command[COMPONENT_RENDER_COMMAND_POSITION.COMPONENT_ID];\n }\n};\n\nconst CLASS_ATTR = 'class';\nconst DEFAULT_COMPONENT_TYPES = {\n IMAGE: '$$$_et-image',\n VIDEO: '$$$_et-video',\n AUDIO: '$$$_et-audio',\n FILE: '$$$_et-file',\n};\n\ntype ExecutedCommandCacheItemBase = {\n element: HTMLElement;\n};\n\ntype ExecutedComponentCommandCacheItem = {\n command: ComponentRenderCommand;\n componentRef: ComponentRef<unknown>;\n} & ExecutedCommandCacheItemBase;\n\ntype ExecutedHtmlCommandCacheItem = {\n command: HtmlOpenRenderCommand | HtmlCloseRenderCommand;\n} & ExecutedCommandCacheItemBase;\n\ntype ExecutedTextCommandCacheItem = {\n command: TextRenderCommand;\n textNode: unknown;\n} & ExecutedCommandCacheItemBase;\n\ntype ExecutedCommandCacheItem =\n | ExecutedComponentCommandCacheItem\n | ExecutedHtmlCommandCacheItem\n | ExecutedTextCommandCacheItem;\n\nexport const isExecutedComponentCommandCacheItem = (\n cache: ExecutedCommandCacheItem,\n): cache is ExecutedComponentCommandCacheItem => {\n return isComponentRenderCommand(cache.command);\n};\n\nexport const isExecutedHtmlOrTextCommandCacheItem = (\n cache: ExecutedCommandCacheItem,\n): cache is ExecutedHtmlCommandCacheItem => {\n return isHtmlCloseRenderCommand(cache.command) || isHtmlOpenRenderCommand(cache.command);\n};\n\nexport const isExecutedTextCommandCacheItem = (\n cache: ExecutedCommandCacheItem,\n): cache is ExecutedTextCommandCacheItem => {\n return isTextRenderCommand(cache.command);\n};\n\nexport const ET_CONTENTFUL_ANY_ENTRY_CONTENT_TYPE_SYS_ID = '$$$_et-contentful-any-entry-content-type-sys-id';\n\nexport type ContentfulIncludeMap = {\n /**\n * Select an entry by its ID and content type ID.\n *\n * The content type ID can be found inside the entry -> sys -> contentType -> sys -> id property.\n *\n * You can provide the `ET_CONTENTFUL_ANY_ENTRY_CONTENT_TYPE_SYS_ID` constant to match any entry sys ID.\n * But be aware that this will return the entry as is without any type checking.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n getEntry: <T extends { [key: string]: any }>(id: string, contentTypeId: string) => ContentfulEntry<T> | null;\n\n /**\n * Select multiple entries by their IDs and content type ID.\n * If an entry is not found, it will be omitted from the result.\n *\n * The content type ID can be found inside the entry -> sys -> contentType -> sys -> id property.\n *\n * You can provide the `ET_CONTENTFUL_ANY_ENTRY_CONTENT_TYPE_SYS_ID` constant to match any entry sys ID.\n * But be aware that this will return the entry as is without any type checking.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n getEntries: <T extends { [key: string]: any }>(\n ids: string[] | ContentfulEntryLinkItem[],\n contentTypeId: string,\n ) => ContentfulEntry<T>[];\n\n /**\n * Select an asset by its ID.\n */\n getAsset: (id: string) => ContentfulRestAsset | null;\n\n /**\n * Select multiple assets by their IDs. If an asset is not found, it will be omitted from the result.\n */\n getAssets: (ids: string[]) => ContentfulRestAsset[];\n};\n\nexport type CreateContentfulIncludeMapConfig = {\n /** The entries that should be present inside the map */\n entries: ContentfulEntry[];\n\n /** The assets that should be present inside the map */\n assets: ContentfulRestAsset[];\n};\n\n/**\n * Create a contentful include map using the provided entries and assets.\n */\nexport const createContentfulIncludeMap = (config: CreateContentfulIncludeMapConfig): ContentfulIncludeMap => {\n const { entries, assets } = config;\n\n const assetMap = new Map(assets.map((asset) => [asset.sys.id, asset]));\n const entryMap = new Map(entries.map((entry) => [entry.sys.id, entry]));\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const getEntry = <T extends { [key: string]: any }>(id: string, contentTypeId: string) => {\n const entry = entryMap.get(id);\n\n if (!entry) {\n if (isDevMode()) {\n console.warn('Entry not found! Will return null. Is the include query param to low?', { id, entryMap });\n }\n\n return null;\n }\n\n if (contentTypeId === ET_CONTENTFUL_ANY_ENTRY_CONTENT_TYPE_SYS_ID) {\n return entry as ContentfulEntry<T>;\n }\n\n if (entry.sys.contentType.sys.id !== contentTypeId) {\n if (isDevMode()) {\n console.warn('Entry sys ID does not match the provided sys ID! Will return null.', {\n entry,\n sysId: contentTypeId,\n });\n }\n\n return null;\n }\n\n return entry as ContentfulEntry<T>;\n };\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const getEntries = <T extends { [key: string]: any }>(\n ids: string[] | ContentfulEntryLinkItem[],\n contentTypeId: string,\n ) => {\n const entries = ids\n .map((id) => (typeof id === 'string' ? id : id.sys.id))\n .map((id) => getEntry<T>(id, contentTypeId))\n .filter((entry): entry is ContentfulEntry<T> => entry !== null);\n\n return entries;\n };\n\n const getAsset = (id: string) => {\n return assetMap.get(id) ?? null;\n };\n\n const getAssets = (ids: string[]) => {\n return ids.map((id) => getAsset(id)).filter((asset): asset is ContentfulRestAsset => asset !== null);\n };\n\n return {\n getEntry,\n getEntries,\n getAsset,\n getAssets,\n };\n};\n\n@Component({\n selector: 'et-contentful-rich-text-renderer',\n template: ``,\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n class: 'et-contentful-rich-text-renderer',\n },\n})\nexport class ContentfulRichTextRendererComponent {\n _viewContainerRef = inject(ViewContainerRef);\n _renderer = injectRenderer();\n _elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n _document = inject(DOCUMENT);\n _config = inject(CONTENTFUL_CONFIG, { optional: true }) ?? createContentfulConfig();\n\n /**\n * A cache for all executed commands that are not deleted.\n * This is used to keep track of all rendered elements and components.\n * The key is the render command element ID.\n */\n _executedCommandsCache = new Map<string, ExecutedCommandCacheItem>();\n\n /**\n * The contentful response gotten via their REST api.\n * @see https://www.contentful.com/developers/docs/references/content-delivery-api/#/reference/entries/entries-collection\n */\n content = input.required<ContentfulCollection | null | undefined>();\n\n /**\n * The path to where the rich text field is inside the contentful response. Dot and array notation is allowed.\n * @example \"items[0].fields.html\"\n */\n richTextPath = input.required<string>();\n\n /**\n * A map of all includes in the contentful response.\n * This is useful for looking up assets and entries that are referenced in the rich text without having to use loops.\n */\n contentIncludesMap = computed<ContentfulIncludeMap>(() => {\n const content = this.content();\n const assets = content?.includes.Asset;\n const entries = content?.includes.Entry;\n\n return createContentfulIncludeMap({ assets: assets ?? [], entries: entries ?? [] });\n });\n\n /**\n * The rich text data that should be rendered.\n */\n richTextData = computed(() => {\n const content = this.content();\n const richTextPath = this.richTextPath();\n\n if (!content) {\n return null;\n }\n\n const richText = getObjectProperty(content as unknown as Record<string, unknown>, richTextPath);\n\n if (!isObject(richText)) {\n throw richTextRendererError('rich_text_undefined', false, { content, richTextPath });\n }\n\n if (!isRichTextRootNode(richText)) {\n throw richTextRendererError('rich_text_wrong_type', false, { content, richTextPath });\n }\n\n return richText as RichTextResponse;\n });\n\n renderCommands = computed(() => {\n const richTextData = this.richTextData();\n\n if (!richTextData) {\n return [];\n }\n\n return this._createRenderCommands(richTextData);\n });\n\n renderCommandHistory = toSignal(\n toObservable(this.renderCommands).pipe(startWith([] as RenderCommand[]), pairwise()),\n { initialValue: [[], []] },\n );\n\n previousRenderCommandMap = computed(() => {\n const [prevCommands] = this.renderCommandHistory();\n\n const map = new Map<string | number, RenderCommand>();\n\n for (const command of prevCommands) {\n map.set(getRenderCommandId(command), command);\n }\n\n return map;\n });\n\n renderInstructions = computed(() => {\n const commands = this.renderCommands();\n const previousRenderCommandMap = new Map(this.previousRenderCommandMap());\n\n const instructions: RenderInstruction[] = [];\n\n // remove deleted components as well as all other elements\n for (const [, command] of previousRenderCommandMap) {\n if (isComponentRenderCommand(command)) {\n // keep the component around if it's still in the new commands\n if (commands.some((c) => getRenderCommandId(c) === getRenderCommandId(command))) {\n continue;\n }\n }\n\n instructions.push([RENDER_INSTRUCTION_TYPE.DELETE, command]);\n\n // remove from map to mark as used\n previousRenderCommandMap.delete(getRenderCommandId(command));\n }\n\n // Find the indexes of the commands remaining in the previousRenderCommandMap in the new commands array.\n const lastComponentIndexes: { newIndex: number; prevIndex: number; command: RenderCommand }[] = [];\n for (const [id, command] of previousRenderCommandMap) {\n const index = commands.findIndex((c) => getRenderCommandId(c) === id);\n const newCommand = commands[index]!;\n\n if (index === -1) {\n throw new Error('Command not found!');\n }\n\n lastComponentIndexes.push({\n newIndex: index,\n prevIndex: command[RENDER_COMMAND_POSITION.INDEX],\n command: newCommand,\n });\n }\n\n lastComponentIndexes.sort((a, b) => a.newIndex - b.newIndex);\n\n // check if the prevIndex are in order ascending\n // for indexes that are not in order, create a move instruction\n // for indexes that are in order, create an update instruction\n let moveCheckIndex = 0;\n while (moveCheckIndex < lastComponentIndexes.length - 1) {\n const moveCurr = lastComponentIndexes[moveCheckIndex];\n const moveNext = lastComponentIndexes[moveCheckIndex + 1];\n\n if (!moveCurr || !moveNext) {\n break;\n }\n\n if (moveCurr.prevIndex > moveNext.prevIndex) {\n lastComponentIndexes.splice(moveCheckIndex + 1, 1);\n instructions.push([RENDER_INSTRUCTION_TYPE.MOVE, moveNext.command]);\n } else {\n instructions.push([RENDER_INSTRUCTION_TYPE.UPDATE, moveNext.command]);\n moveCheckIndex++;\n }\n }\n\n for (const command of commands) {\n const id = getRenderCommandId(command);\n\n if (isComponentRenderCommand(command)) {\n const previousCommand = previousRenderCommandMap.get(id);\n\n if (!previousCommand) {\n // create\n instructions.push([RENDER_INSTRUCTION_TYPE.CREATE, command]);\n }\n } else {\n // create\n instructions.push([RENDER_INSTRUCTION_TYPE.CREATE, command]);\n }\n }\n\n return instructions;\n });\n\n constructor() {\n toObservable(this.renderInstructions)\n .pipe(\n takeUntilDestroyed(),\n tap((instructions) => {\n this._execInstructions(instructions);\n }),\n )\n .subscribe();\n }\n\n private _createRenderCommands(richTextData: RichTextResponse) {\n /** List of all render commands */\n const rootCommands: RenderCommand[] = [];\n\n /** Counter for generating unique html element IDs. */\n let elementOpenId = 0;\n\n /** Counter for generating unique html element IDs. */\n let elementCloseId = 0;\n\n /** Counter for generating unique component IDs. */\n const componentIdMap = new Map<string, number>();\n\n /** The nesting level of the current node. */\n let nestingLevel = 0;\n\n /** The position (index) of the current node inside the parent node. */\n let domPosition = 0;\n\n let textId = 0;\n\n let commandIndex = 0;\n\n const traverse = (node: Block | Inline | Text) => {\n switch (node.nodeType) {\n case 'text': {\n // Render media\n const type = RENDER_COMMAND_TYPE.TEXT;\n const text = node.value;\n\n if (!text) break;\n\n const attributes: Record<string, string> = {\n class: 'et-contentful-rich-text-default-element et-contentful-rich-text-default-span',\n };\n\n if (node.marks.length) {\n const markClasses = marksToClass(node.marks);\n\n if (CLASS_ATTR in attributes) {\n attributes[CLASS_ATTR] += ` ${markClasses}`;\n } else {\n attributes[CLASS_ATTR] = markClasses;\n }\n }\n\n const id = 't' + textId++;\n\n const command: TextRenderCommand = [type, nestingLevel, domPosition, commandIndex++, attributes, text, id];\n\n rootCommands.push(command);\n domPosition++;\n\n break;\n }\n\n case BLOCKS.EMBEDDED_ASSET: {\n // Render media\n const type = RENDER_COMMAND_TYPE.COMPONENT;\n const assetId = node.data['target']?.sys?.id;\n\n if (!assetId) {\n throw richTextRendererError('asset_id_not_found', false, { node });\n }\n\n const asset = this.contentIncludesMap().getAsset(assetId);\n\n if (!asset) {\n throw richTextRendererError('asset_not_found', false, { assetId, node });\n }\n\n const contentType = asset.fields.file.contentType;\n const assetComponents = this._config.components;\n\n // Every property inside the asset will be null if no file was provided for a translation.\n // In this case, we can assume that the asset is missing due to user error.\n const isMissing = !contentType && !asset.fields.file.url;\n\n if (isMissing) {\n if (isDevMode()) {\n console.warn(\n 'Asset is missing file data! Asset will be skipped. Did you forget to upload a file for the current translation in Contentful?',\n { asset },\n );\n }\n\n break;\n }\n\n const isImage = contentType?.startsWith('image/');\n const isVideo = contentType?.startsWith('video/');\n const isAudio = contentType?.startsWith('audio/');\n\n const component = isImage\n ? assetComponents.image\n : isVideo\n ? assetComponents.video\n : isAudio\n ? assetComponents.audio\n : assetComponents.file;\n\n const componentType = isImage\n ? DEFAULT_COMPONENT_TYPES.IMAGE\n : isVideo\n ? DEFAULT_COMPONENT_TYPES.VIDEO\n : isAudio\n ? DEFAULT_COMPONENT_TYPES.AUDIO\n : DEFAULT_COMPONENT_TYPES.FILE;\n\n let componentId = componentIdMap.get(componentType) ?? -1;\n const id = componentType + ++componentId;\n componentIdMap.set(componentType, componentId);\n\n const attributes = {};\n\n const inputs = {\n asset,\n };\n\n const command: ComponentRenderCommand = [\n type,\n nestingLevel,\n domPosition,\n commandIndex++,\n attributes,\n component,\n inputs,\n id,\n ];\n\n rootCommands.push(command);\n\n domPosition++;\n\n break;\n }\n\n case BLOCKS.EMBEDDED_ENTRY:\n case INLINES.EMBEDDED_ENTRY: {\n // Render component\n const type = RENDER_COMMAND_TYPE.COMPONENT;\n const entryId = node.data['target']?.sys?.id;\n\n if (!entryId) {\n throw richTextRendererError('entry_id_not_found', false, { node });\n }\n\n const entry = this.contentIncludesMap().getEntry(entryId, ET_CONTENTFUL_ANY_ENTRY_CONTENT_TYPE_SYS_ID);\n\n if (!entry) {\n throw richTextRendererError('entry_not_found', false, { entryId, node });\n }\n\n const componentType = entry.sys.contentType.sys.id;\n\n const component = this._config.customComponents[componentType];\n\n if (!component) {\n throw richTextRendererError('custom_component_not_found', false, {\n componentType,\n customComponents: this._config.customComponents,\n entry,\n });\n }\n\n const attributes = {};\n let componentId = componentIdMap.get(componentType) ?? -1;\n const id = componentType + ++componentId;\n componentIdMap.set(componentType, componentId);\n\n const inputs = {\n fields: entry.fields,\n metadata: entry.metadata,\n sys: entry.sys,\n includes: this.contentIncludesMap(),\n };\n\n const command: ComponentRenderCommand = [\n type,\n nestingLevel,\n domPosition,\n commandIndex++,\n attributes,\n component,\n inputs,\n id,\n ];\n\n rootCommands.push(command);\n\n domPosition++;\n\n break;\n }\n\n default: {\n const type = RENDER_COMMAND_TYPE.HTML_OPEN;\n const tag = translateContentfulNodeTypeToHtmlTag(node.nodeType);\n const attributes: Record<string, string> = {\n class: `et-contentful-rich-text-default-element et-contentful-rich-text-default-${tag}`,\n };\n const id = 'e-o' + elementOpenId++;\n\n const command: HtmlOpenRenderCommand = [type, nestingLevel, domPosition, commandIndex++, attributes, tag, id];\n\n rootCommands.push(command);\n\n const domPositionAtThisLevel = domPosition;\n // Normal html elements can have children\n for (const child of node.content) {\n domPosition = 0;\n nestingLevel++;\n traverse(child);\n nestingLevel--;\n domPosition = domPositionAtThisLevel;\n }\n\n const lastCommand = rootCommands[rootCommands.length - 1];\n\n if (\n lastCommand?.[RENDER_COMMAND_POSITION.TYPE] === RENDER_COMMAND_TYPE.HTML_OPEN &&\n lastCommand[HTML_OPEN_RENDER_COMMAND_POSITION.TAG_NAME] !== 'td' &&\n lastCommand[HTML_OPEN_RENDER_COMMAND_POSITION.TAG_NAME] !== 'hr'\n ) {\n // If the last command is an open command, we can remove it since it's empty\n rootCommands.pop();\n elementOpenId--;\n commandIndex--;\n } else {\n const closeId = 'e-c' + elementCloseId++;\n\n const closeCommand: HtmlCloseRenderCommand = [\n RENDER_COMMAND_TYPE.HTML_CLOSE,\n nestingLevel,\n domPosition,\n commandIndex++,\n tag,\n closeId,\n ];\n rootCommands.push(closeCommand);\n\n domPosition++;\n }\n\n if (node.nodeType === INLINES.HYPERLINK) {\n const uri = node.data['uri'];\n attributes['href'] = uri;\n\n const host = this._document.location.host;\n const isExternal = !uri.includes(host);\n\n if (isExternal) {\n attributes['target'] = '_blank';\n }\n }\n\n break;\n }\n }\n };\n\n for (const node of richTextData.content) {\n traverse(node);\n }\n\n return rootCommands;\n }\n\n private _execInstructions(instructions: RenderInstruction[]) {\n for (const instruction of instructions) {\n const type = instruction[RENDER_INSTRUCTION_POSITION.TYPE];\n const command = instruction[RENDER_INSTRUCTION_POSITION.COMMAND];\n\n switch (type) {\n case RENDER_INSTRUCTION_TYPE.CREATE:\n this._runCreateInstruction(command);\n break;\n case RENDER_INSTRUCTION_TYPE.UPDATE:\n this._runUpdateInstruction(command);\n break;\n case RENDER_INSTRUCTION_TYPE.MOVE:\n this._runMoveInstruction(command);\n break;\n case RENDER_INSTRUCTION_TYPE.DELETE:\n this._runDeleteInstruction(command);\n break;\n }\n }\n }\n\n private _runCreateInstruction(command: RenderCommand) {\n const id = getRenderCommandId(command);\n const parentElement = this._findParent(command);\n const nextElement = this._findFollowingElement(command);\n\n if (isComponentRenderCommand(command)) {\n const componentRef = this._viewContainerRef.createComponent(command[COMPONENT_RENDER_COMMAND_POSITION.COMPONENT]);\n\n this._updateComponentInputs(command, componentRef);\n\n const rootNode = this._getComponentRootNode(componentRef);\n\n this._renderInsertOrAppend(rootNode, parentElement, nextElement);\n\n this._executedCommandsCache.set(id, {\n command,\n componentRef,\n element: rootNode,\n });\n } else if (isTextRenderCommand(command)) {\n const text = command[TEXT_RENDER_COMMAND_POSITION.TEXT];\n const span = this._renderer.createElement('span');\n const attributes = command[TEXT_RENDER_COMMAND_POSITION.ATTRIBUTES];\n const textSplitInLineBreaks = text.split('\\n').filter((t) => t.trim().length > 0);\n\n const textNodes: unknown[] = [];\n\n for (const [key, value] of Object.entries(attributes)) {\n this._renderer.setAttribute(span, key, value);\n }\n\n if (text.startsWith('\\n')) {\n const brNode = this._renderer.createElement('br');\n this._renderer.appendChild(parentElement, brNode);\n }\n\n for (const [textPartIndex, textPart] of textSplitInLineBreaks.entries()) {\n if (textPartIndex > 0) {\n const brNode = this._renderer.createElement('br');\n this._renderer.appendChild(span, brNode);\n }\n\n const textNode = this._renderer.createText(textPart);\n\n this._renderer.appendChild(span, textNode);\n\n textNodes.push(textNode);\n }\n\n this._renderInsertOrAppend(span, parentElement, nextElement);\n\n this._executedCommandsCache.set(id, {\n command,\n element: span,\n textNode: textNodes,\n });\n } else if (isHtmlOpenRenderCommand(command)) {\n const tag = command[HTML_OPEN_RENDER_COMMAND_POSITION.TAG_NAME];\n const attributes = command[HTML_OPEN_RENDER_COMMAND_POSITION.ATTRIBUTES];\n const element = this._renderer.createElement(tag);\n\n for (const [key, value] of Object.entries(attributes)) {\n this._renderer.setAttribute(element, key, value);\n }\n\n this._renderInsertOrAppend(element, parentElement, nextElement);\n\n this._executedCommandsCache.set(id, {\n command,\n element,\n });\n }\n }\n\n private _runUpdateInstruction(command: RenderCommand) {\n const id = getRenderCommandId(command);\n const cached = this._executedCommandsCache.get(id);\n\n if (!cached) {\n throw new Error('Cached command not found!');\n }\n\n if (isComponentRenderCommand(command)) {\n if (!isExecutedComponentCommandCacheItem(cached)) {\n throw new Error('Cached command is not a component command!');\n }\n\n const componentRef = cached.componentRef;\n\n if (!componentRef) {\n throw new Error('Component ref not found!');\n }\n\n this._updateComponentInputs(command, componentRef);\n }\n\n this._executedCommandsCache.set(id, {\n ...cached,\n command: command as any,\n });\n }\n\n private _runMoveInstruction(command: RenderCommand) {\n const id = getRenderCommandId(command);\n const cached = this._executedCommandsCache.get(id);\n\n if (!cached) {\n throw new Error('Cached command not found!');\n }\n\n if (isComponentRenderCommand(command)) {\n if (!isExecutedComponentCommandCacheItem(cached)) {\n throw new Error('Cached command is not a component command!');\n }\n\n const componentRef = cached.componentRef;\n\n if (!componentRef) {\n throw new Error('Component ref not found!');\n }\n\n const rootNode = cached.element;\n const oldParentElement = cached.element.parentElement;\n\n if (oldParentElement) {\n this._renderer.removeChild(oldParentElement, rootNode);\n }\n\n const newParentElement = this._findParent(command);\n const nextElement = this._findFollowingElement(command);\n\n this._renderInsertOrAppend(rootNode, newParentElement, nextElement);\n\n this._updateComponentInputs(command, componentRef);\n\n this._executedCommandsCache.set(id, {\n ...cached,\n command: command as any,\n });\n }\n }\n\n private _runDeleteInstruction(command: RenderCommand) {\n const id = getRenderCommandId(command);\n const cached = this._executedCommandsCache.get(id);\n\n if (!cached) {\n if (isHtmlCloseRenderCommand(command)) {\n return;\n }\n\n throw new Error('Cached command not found!');\n }\n\n if (isComponentRenderCommand(command)) {\n if (!isExecutedComponentCommandCacheItem(cached)) {\n throw new Error('Cached command is not a component command!');\n }\n\n cached.componentRef?.destroy();\n } else if (isTextRenderCommand(command)) {\n if (cached.element?.parentElement) {\n this._renderer.removeChild(cached.element.parentElement, cached.element);\n }\n } else if (isHtmlOpenRenderCommand(command)) {\n if (cached.element?.parentElement) {\n this._renderer.removeChild(cached.element.parentElement, cached.element);\n }\n }\n\n this._executedCommandsCache.delete(id);\n }\n\n private _getComponentRootNode(componentRef: ComponentRef<any>): HTMLElement {\n return (componentRef.hostView as EmbeddedViewRef<any>).rootNodes[0] as HTMLElement;\n }\n\n private _updateComponentInputs(command: ComponentRenderCommand, componentRef: ComponentRef<any>) {\n for (const [key, value] of Object.entries(command[COMPONENT_RENDER_COMMAND_POSITION.INPUTS])) {\n if (!componentRef.instance[key]) continue;\n\n componentRef.setInput(key, value);\n }\n }\n\n private _findParent(command: RenderCommand) {\n const hostElement = this._elementRef.nativeElement;\n const nestingLevel = command[RENDER_COMMAND_POSITION.NESTING_LEVEL];\n let parentElement: HTMLElement | undefined;\n\n if (nestingLevel === 0) {\n parentElement = hostElement;\n } else {\n // Reverse search all render commands beginning from the current one using a for loop.\n // The parent is found when the command's nesting level ist the same as the current nesting level minus 1.\n // If the parent is not found, throw an error.\n const allCommands = this.renderCommands();\n const currentCommandIndex = command[RENDER_COMMAND_POSITION.INDEX];\n\n let parentCommand: RenderCommand | null = null;\n\n for (let i = currentCommandIndex - 1; i >= 0; i--) {\n const cmd = allCommands[i];\n\n if (!cmd) {\n throw new Error('Command not found!');\n }\n\n if (cmd[RENDER_COMMAND_POSITION.NESTING_LEVEL] === nestingLevel - 1 && isHtmlOpenRenderCommand(cmd)) {\n parentCommand = cmd;\n break;\n }\n }\n\n if (!parentCommand) {\n throw new Error('Parent command not found!');\n }\n\n parentElement = this._executedCommandsCache.get(getRenderCommandId(parentCommand))?.element;\n }\n\n if (!parentElement) {\n throw new Error('Parent element not found!');\n }\n\n return parentElement;\n }\n\n private _findFollowingElement(command: RenderCommand) {\n const cacheArray = Array.from(this._executedCommandsCache.values());\n let nextElement: HTMLElement | undefined = undefined;\n\n const domPosition = command[RENDER_COMMAND_POSITION.DOM_POSITION];\n const nestingLevel = command[RENDER_COMMAND_POSITION.NESTING_LEVEL];\n const type = command[RENDER_COMMAND_POSITION.TYPE];\n\n // Try to find an already rendered element with a domPosition that is greater than the current domPosition. If there are multiple, use the one with the smallest domPosition.\n // If it does not exist, use .appendChild to simply append the element to the end of the parent element.\n // If it does exist, use .insertBefore to insert the element before the found element.\n for (const cached of cacheArray) {\n if (\n cached.command[RENDER_COMMAND_POSITION.DOM_POSITION] > domPosition &&\n cached.command[RENDER_COMMAND_POSITION.NESTING_LEVEL] === nestingLevel &&\n // Make sure the element does not find itself\n cached.command[RENDER_COMMAND_POSITION.TYPE] !== type\n ) {\n nextElement = cached.element;\n break;\n }\n }\n\n return nextElement;\n }\n\n private _renderInsertOrAppend(\n nodeToRender: HTMLElement,\n parentElement: HTMLElement,\n nextElement: HTMLElement | undefined,\n ) {\n if (nextElement) {\n this._renderer.insertBefore(parentElement, nodeToRender, nextElement);\n } else {\n this._renderer.appendChild(parentElement, nodeToRender);\n }\n }\n}\n\n// const stringifyRenderCommand = (command: RenderCommand) => {\n// const nestAttr = `nest=\"${command[RENDER_COMMAND_POSITION.NESTING_LEVEL]}\"`;\n// const domAttr = `dom=\"${command[RENDER_COMMAND_POSITION.DOM_POSITION]}\"`;\n\n// if (isHtmlOpenRenderCommand(command)) {\n// return `<${command[HTML_OPEN_RENDER_COMMAND_POSITION.TAG_NAME]} ${nestAttr} ${domAttr} _id=\"${command[HTML_OPEN_RENDER_COMMAND_POSITION.ELEMENT_ID]}\" _index=\"${command[RENDER_COMMAND_POSITION.INDEX]}\">`;\n// } else if (isHtmlCloseRenderCommand(command)) {\n// return `</${command[HTML_CLOSE_RENDER_COMMAND_POSITION.TAG_NAME]} ${nestAttr} ${domAttr}>`;\n// } else if (isTextRenderCommand(command)) {\n// let text = command[TEXT_RENDER_COMMAND_POSITION.TEXT];\n// const brStart = text.startsWith('\\n') ? '<br/>' : '';\n// text = brStart ? text.slice(1) : text;\n\n// return [\n// ...(brStart ? [brStart] : []),\n// `<span ${nestAttr} ${domAttr} _index=\"${command[RENDER_COMMAND_POSITION.INDEX]}\">`,\n// text.replace(/\\n/g, ' <br/> '),\n// '</span>',\n// ];\n// } else if (isComponentRenderCommand(command)) {\n// const selector = command[COMPONENT_RENDER_COMMAND_POSITION.COMPONENT_ID];\n// return [`<${selector} ${nestAttr} ${domAttr}>`, `</${selector}>`];\n// } else {\n// return 'UNKNOWN';\n// }\n// };\n\n// const formatHTMLStringArray = (html: string[]) => {\n// const result: string[] = [];\n// let indent = 0;\n\n// for (const tag of html) {\n// if (tag.startsWith('</')) {\n// indent--;\n// }\n\n// result.push(' '.repeat(indent * 2) + tag);\n\n// if (tag.startsWith('<') && !tag.startsWith('</') && !tag.startsWith('<br')) {\n// indent++;\n// }\n// }\n\n// return result.join('\\n');\n// };\n\n// const debugVisualizeRenderCommands = (commands: RenderCommand[]) => {\n// const debug = commands.map((command) => stringifyRenderCommand(command)).flat();\n\n// const prettified = formatHTMLStringArray(debug);\n\n// return prettified;\n// };\n\n// const stringifyRenderInstruction = (instruction: RenderInstruction) => {\n// const type = instruction[RENDER_INSTRUCTION_POSITION.TYPE];\n// const translatedType = Object.entries(RENDER_INSTRUCTION_TYPE).find(([, value]) => value === type)?.[0];\n\n// const command = stringifyRenderCommand(instruction[RENDER_INSTRUCTION_POSITION.COMMAND]);\n\n// return `${translatedType}: ${command}`;\n// };\n","import { ContentfulAudioComponent } from './components/audio';\nimport { ContentfulFileComponent } from './components/file';\nimport { ContentfulImageComponent } from './components/image';\nimport { ContentfulRichTextRendererComponent } from './components/rich-text-renderer';\nimport { ContentfulVideoComponent } from './components/video';\n\nexport const ContentfulImports = [\n ContentfulAudioComponent,\n ContentfulFileComponent,\n ContentfulImageComponent,\n ContentfulVideoComponent,\n ContentfulRichTextRendererComponent,\n] as const;\n","import { CONTENTFUL_CONFIG } from '../constants';\nimport { ContentfulConfig, ContentfulEntry } from '../types';\nimport { createContentfulConfig } from './contentful-config';\n\nexport const provideContentfulConfig = (contentfulConfig: Partial<ContentfulConfig> | null | undefined = {}) => {\n return { provide: CONTENTFUL_CONFIG, useValue: createContentfulConfig(contentfulConfig) };\n};\n\nexport const isContentfulEntryType = <T extends ContentfulEntry>(entry: ContentfulEntry, type: string): entry is T =>\n entry.sys.contentType.sys.id === type;\n","export * from './lib/components/audio';\nexport * from './lib/components/file';\nexport * from './lib/components/image';\nexport * from './lib/components/rich-text-renderer';\nexport * from './lib/components/video';\nexport * from './lib/constants';\nexport * from './lib/contentful.imports';\nexport * from './lib/gql';\nexport * from './lib/types';\nexport * from './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A,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,aAAA,EAAA,EAAA,CAAA,iBAAA,CAAA,IAAA,EAAA,CAAA,CAAA;;2FAOD,mCAAmC,EAAA,UAAA,EAAA,CAAA;kBAT/C,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,kCAAkC;AAC5C,oBAAA,QAAQ,EAAE,CAAA,CAAE;oBACZ,aAAa,EAAE,iBAAiB,CAAC,IAAI;oBACrC,eAAe,EAAE,uBAAuB,CAAC,MAAM;AAC/C,oBAAA,IAAI,EAAE;AACJ,wBAAA,KAAK,EAAE,kCAAkC;AAC1C,qBAAA;AACF,iBAAA;;;AC3VM,MAAM,iBAAiB,GAAG;IAC/B,wBAAwB;IACxB,uBAAuB;IACvB,wBAAwB;IACxB,wBAAwB;IACxB,mCAAmC;;;MCPxB,uBAAuB,GAAG,CAAC,gBAAA,GAAiE,EAAE,KAAI;AAC7G,IAAA,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,QAAQ,EAAE,sBAAsB,CAAC,gBAAgB,CAAC,EAAE;AAC3F;MAEa,qBAAqB,GAAG,CAA4B,KAAsB,EAAE,IAAY,KACnG,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,GAAG,CAAC,EAAE,KAAK;;ACEnC;;ACXA;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"ethlete-contentful.mjs","sources":["../../../../libs/contentful/src/lib/gql/asset.fragments.ts","../../../../libs/contentful/src/lib/components/audio/contentful-audio.component.ts","../../../../libs/contentful/src/lib/components/file/contentful-file.component.ts","../../../../libs/contentful/src/lib/constants/contentful.constants.ts","../../../../libs/contentful/src/lib/components/image/contentful-image.component.utils.ts","../../../../libs/contentful/src/lib/components/image/contentful-image.component.ts","../../../../libs/contentful/src/lib/components/video/contentful-video.component.ts","../../../../libs/contentful/src/lib/utils/contentful-config.ts","../../../../libs/contentful/src/lib/components/link/contentful-link.component.ts","../../../../libs/contentful/src/lib/components/rich-text-renderer/rich-text-renderer.errors.ts","../../../../libs/contentful/src/lib/components/rich-text-renderer/rich-text-renderer.util.ts","../../../../libs/contentful/src/lib/components/rich-text-renderer/rich-text-renderer.component.ts","../../../../libs/contentful/src/lib/contentful.imports.ts","../../../../libs/contentful/src/lib/utils/contentful.util.ts","../../../../libs/contentful/src/index.ts","../../../../libs/contentful/src/ethlete-contentful.ts"],"sourcesContent":["import { gql } from '@ethlete/query';\n\nexport const GQL_FRAGMENT_CONTENTFUL_ASSET = gql`\n fragment AssetData on Asset {\n sys {\n id\n }\n url\n title\n width\n height\n description\n contentType\n size\n }\n`;\n\nexport type ContentfulGqlAsset = {\n sys: {\n id: string;\n };\n title: string | null;\n contentType: string | null;\n url: string | null;\n description: string | null;\n width: number | null;\n height: number | null;\n size: number | null;\n};\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const isContentfulGqlAsset = (asset: any): asset is ContentfulGqlAsset => {\n return asset?.sys?.id && asset?.url && typeof asset?.size === 'number';\n};\n\nexport type ContentfulGqlWhereFilter<TLinkedFrom extends Record<string, unknown> = Record<string, unknown>> = {\n /**\n * Filer by ids.\n * @see https://www.contentful.com/developers/docs/references/graphql/#/reference/collection-filters/sys-filters\n */\n sys?: {\n id?: string;\n id_not?: string;\n id_in?: string[];\n id_not_in?: string[];\n id_contains?: string;\n id_not_contains?: string;\n };\n /**\n * Filer by tags.\n * @see https://www.contentful.com/developers/docs/references/graphql/#/reference/collection-filters/contentfulmetadata-filters\n */\n contentfulMetadata?: {\n tags_exists?: boolean;\n tags?: {\n id_contains_some?: string[];\n id_contains_none?: string[];\n id_contains_all?: string[];\n };\n };\n /**\n * Retrieve a collection of entries linked to the specified entry or asset.\n * @see https://www.contentful.com/developers/docs/references/graphql/#links-to-a-specific-item\n */\n linkedFrom?: TLinkedFrom;\n};\n\nexport type ContentfulGqlOrder = `${string}_${'ASC' | 'DESC'}`;\n\nexport type ContentfulGqlCollectionFilterVariables<\n TCustomWhere extends Record<string, unknown> = Record<string, unknown>,\n TLinkedFrom extends Record<string, unknown> = Record<string, unknown>,\n> = {\n /**\n * Zero-indexed offset in the collection from which items are fetched\n * @default 0\n */\n skip?: number;\n\n /**\n * Maximum number of items to fetch. Maximum is 1000.\n * @default 100\n */\n limit?: number;\n\n /**\n * Filter specifications to apply on the collection query.\n * @see https://www.contentful.com/developers/docs/references/graphql/#/reference/collection-filters\n */\n where?: TCustomWhere & ContentfulGqlWhereFilter<TLinkedFrom>;\n\n /**\n * Order specifications to apply on the collection query.\n * @see https://www.contentful.com/developers/docs/references/graphql/#/reference/collection-order\n */\n order?: ContentfulGqlOrder[];\n\n /**\n * When set to `true` the field will be resolved with non published content.\n * @default false\n */\n preview?: boolean;\n\n /**\n * Locale for the collection items. If not set the default locale is used.\n */\n locale?: string;\n};\n","import { NgClass } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, ViewEncapsulation, computed, input } from '@angular/core';\nimport { NgClassType } from '@ethlete/core';\nimport { ContentfulGqlAsset, isContentfulGqlAsset } from '../../gql';\nimport { ContentfulRestAsset } from '../../types';\n\n@Component({\n selector: 'et-contentful-audio',\n template: `\n @if (data(); as data) {\n <figure [ngClass]=\"figureClass()\">\n <figcaption [ngClass]=\"figcaptionClass()\">{{ data.title }}</figcaption>\n <audio [ngClass]=\"audioClass()\" controls src=\"{{ data.url }}\"></audio>\n </figure>\n }\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n imports: [NgClass],\n})\nexport class ContentfulAudioComponent {\n asset = input.required<ContentfulRestAsset | ContentfulGqlAsset | null | undefined>();\n audioClass = input<NgClassType>(null);\n figureClass = input<NgClassType>(null);\n figcaptionClass = input<NgClassType>(null);\n\n data = computed(() => {\n const asset = this.asset();\n\n if (!asset) {\n return null;\n }\n\n if (isContentfulGqlAsset(asset)) {\n return {\n url: asset.url,\n title: asset.title,\n };\n }\n\n return {\n url: asset.fields.file.url,\n title: asset.fields.title,\n };\n });\n}\n","import { NgClass } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, ViewEncapsulation, computed, input } from '@angular/core';\nimport { NgClassType } from '@ethlete/core';\nimport { ContentfulGqlAsset, isContentfulGqlAsset } from '../../gql';\nimport { ContentfulRestAsset } from '../../types';\n\n@Component({\n selector: 'et-contentful-file',\n template: `\n @if (data(); as data) {\n <a [href]=\"data.url\" [ngClass]=\"fileClass()\" class=\"underline\" target=\"_blank\">\n {{ data.title }} ({{ data.size }} Bytes)\n </a>\n }\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n imports: [NgClass],\n})\nexport class ContentfulFileComponent {\n asset = input.required<ContentfulRestAsset | ContentfulGqlAsset | null | undefined>();\n fileClass = input<NgClassType>(null);\n\n data = computed(() => {\n const asset = this.asset();\n\n if (!asset) {\n return null;\n }\n\n if (isContentfulGqlAsset(asset)) {\n return {\n url: asset.url,\n contentType: asset.contentType,\n size: asset.size,\n title: asset.title,\n };\n }\n\n return {\n url: asset.fields.file.url,\n contentType: asset.fields.file.contentType,\n size: asset.fields.file.details.size,\n title: asset.fields.title,\n };\n });\n}\n","import { InjectionToken } from '@angular/core';\n\nimport { ContentfulConfig } from '../types';\n\nexport const CONTENTFUL_CONFIG = new InjectionToken<ContentfulConfig>('ContentfulConfig');\n","import { PictureSource } from '@ethlete/cdk';\nimport { ContentfulGqlAsset, isContentfulGqlAsset } from '../../gql';\nimport { ContentfulImageFocusArea, ContentfulImageResizeBehavior, ContentfulRestAsset } from '../../types';\n\nexport const generateDefaultContentfulImageSource = (data: ContentfulRestAsset | ContentfulGqlAsset): PictureSource => {\n if (isContentfulGqlAsset(data)) {\n if (!data.contentType || !data.url) {\n return {\n type: '',\n srcset: '',\n };\n }\n\n return {\n type: data.contentType,\n srcset: data.url,\n };\n }\n\n if (!data.fields.file.contentType || !data.fields.file.url) {\n return {\n type: '',\n srcset: '',\n };\n }\n\n return {\n type: data.fields.file.contentType,\n srcset: data.fields.file.url,\n };\n};\n\n/**\n * Parses source set sizes into an object containing with and height. Eg.\n * - `\"400\"` - 400px width\n * - `\"400x300\"` - 400px width and 300px height\n * - `\"400w\"` - 400px width\n * - `\"400h\"` - 400px height\n * - `\"400wx300h\"` - 400px width and 300px height\n **/\nexport const parseContentfulImageSize = (size: string): { width: number | null; height: number | null } => {\n let width: string | null | undefined = null;\n let height: string | null | undefined = null;\n\n if (size.includes('x')) {\n const [w, h] = size.split('x');\n\n width = w;\n height = h;\n } else if (size.includes('h')) {\n height = size;\n } else {\n width = size;\n }\n\n return {\n width: width ? parseInt(width, 10) : null,\n height: height ? parseInt(height, 10) : null,\n };\n};\n\nexport const generateContentfulImageSources = (\n data: ContentfulRestAsset | ContentfulGqlAsset,\n srcsetSizes: string[],\n backgroundColor: string | null,\n quality: number | null,\n focusArea: ContentfulImageFocusArea | null,\n resizeBehavior: ContentfulImageResizeBehavior | null,\n): PictureSource[] => {\n const assetData = data;\n\n if (!assetData) {\n return [];\n }\n\n const sources: PictureSource[] = [];\n\n const SOURCE_TYPES = ['image/avif', 'image/webp', 'image/png', 'image/jpg'];\n\n for (const type of SOURCE_TYPES) {\n const baseUrl = isContentfulGqlAsset(assetData) ? assetData.url : assetData.fields.file.url;\n const sourceSets: string[] = [];\n const queryParams: string[] = [];\n\n // Set the format (e.g. 'fm=webp')\n queryParams.push(`fm=${type.split('/')[1]}`);\n\n if (backgroundColor) {\n queryParams.push(`bg=rgb:${backgroundColor}`);\n }\n\n if (quality !== null) {\n queryParams.push(`q=${quality}`);\n }\n\n if (focusArea) {\n queryParams.push(`f=${focusArea}`);\n }\n\n if (resizeBehavior) {\n queryParams.push(`fit=${resizeBehavior}`);\n }\n if (srcsetSizes?.length) {\n const urlWithParams = `${baseUrl}?${queryParams.join('&')}`;\n\n for (const size of srcsetSizes) {\n const { width, height } = parseContentfulImageSize(size);\n\n if (width && height) {\n sourceSets.push(`${urlWithParams}&w=${width}&h=${height} ${width}w`);\n } else if (width) {\n sourceSets.push(`${urlWithParams}&w=${width} ${width}w`);\n } else if (height) {\n sourceSets.push(`${urlWithParams}&h=${height} ${height}h`);\n }\n }\n }\n\n sources.push({\n type,\n srcset: sourceSets.length ? sourceSets.join(', ') : `${baseUrl}?${queryParams.join('&')}`,\n });\n }\n\n return sources;\n};\n","import {\n ChangeDetectionStrategy,\n Component,\n ViewEncapsulation,\n booleanAttribute,\n computed,\n inject,\n input,\n numberAttribute,\n} from '@angular/core';\nimport { PictureComponent, normalizePictureSizes } from '@ethlete/cdk';\nimport { NgClassType } from '@ethlete/core';\nimport { CONTENTFUL_CONFIG } from '../../constants';\nimport { ContentfulGqlAsset, isContentfulGqlAsset } from '../../gql';\nimport { ContentfulImageFocusArea, ContentfulImageResizeBehavior, ContentfulRestAsset } from '../../types';\nimport {\n generateContentfulImageSources,\n generateDefaultContentfulImageSource,\n} from './contentful-image.component.utils';\n\n@Component({\n selector: 'et-contentful-image',\n template: `\n <et-picture\n [imgClass]=\"imgClass()\"\n [hasPriority]=\"hasPriority()\"\n [figureClass]=\"figureClass()\"\n [pictureClass]=\"pictureClass()\"\n [figcaptionClass]=\"figcaptionClass()\"\n [defaultSrc]=\"_defaultSrc()\"\n [alt]=\"normalizedAsset().alt ?? null\"\n [figcaption]=\"normalizedAsset().figcaption ?? null\"\n [width]=\"normalizedAsset().width ?? null\"\n [height]=\"normalizedAsset().height ?? null\"\n [sizes]=\"sizes()\"\n [sources]=\"_sources()\"\n />\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n imports: [PictureComponent],\n host: {\n class: 'et-contentful-image',\n },\n})\nexport class ContentfulImageComponent {\n _contentfulConfig = inject(CONTENTFUL_CONFIG);\n\n asset = input.required<ContentfulRestAsset | ContentfulGqlAsset | null | undefined>();\n backgroundColor = input<string | null>(null);\n srcsetSizes = input<string[]>(this._contentfulConfig.imageOptions.srcsetSizes);\n\n quality = input(null, { transform: numberAttribute });\n focusArea = input<ContentfulImageFocusArea | null>(null);\n resizeBehavior = input<ContentfulImageResizeBehavior | null>(null);\n hasPriority = input(false, { transform: booleanAttribute });\n imgClass = input<NgClassType>(null);\n figureClass = input<NgClassType>(null);\n figcaptionClass = input<NgClassType>(null);\n pictureClass = input<NgClassType>(null);\n sizes = input<string | null, string[] | string | null>(\n normalizePictureSizes(this._contentfulConfig.imageOptions.sizes),\n {\n transform: (v) => normalizePictureSizes(v),\n },\n );\n\n normalizedAsset = computed(() => {\n const asset = this.asset();\n\n if (isContentfulGqlAsset(asset)) {\n return {\n alt: asset.title || null,\n figcaption: asset.description || null,\n width: asset.width,\n height: asset.height,\n };\n } else {\n return {\n alt: asset?.fields?.title || null,\n figcaption: asset?.fields?.description || null,\n width: asset?.fields?.file?.details?.image?.width ?? null,\n height: asset?.fields?.file?.details?.image?.height ?? null,\n };\n }\n });\n\n _sources = computed(() => {\n const asset = this.asset();\n const backgroundColor = this.backgroundColor();\n const srcsetSizes = this.srcsetSizes();\n const quality = this.quality();\n const focusArea = this.focusArea();\n const resizeBehavior = this.resizeBehavior();\n\n if (!asset) {\n return [];\n }\n\n return generateContentfulImageSources(asset, srcsetSizes, backgroundColor, quality, focusArea, resizeBehavior);\n });\n\n _defaultSrc = computed(() => {\n const asset = this.asset();\n\n return asset ? generateDefaultContentfulImageSource(asset) : null;\n });\n}\n","import { NgClass } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, ViewEncapsulation, computed, input } from '@angular/core';\nimport { NgClassType } from '@ethlete/core';\nimport { ContentfulGqlAsset, isContentfulGqlAsset } from '../../gql';\nimport { ContentfulRestAsset } from '../../types';\n\n@Component({\n selector: 'et-contentful-video',\n template: `\n @if (data(); as data) {\n <video [ngClass]=\"videoClass()\" controls>\n <source src=\"{{ data.url }}\" type=\"{{ data.contentType }}\" />\n </video>\n }\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n imports: [NgClass],\n})\nexport class ContentfulVideoComponent {\n asset = input.required<ContentfulRestAsset | ContentfulGqlAsset | null | undefined>();\n videoClass = input<NgClassType>(null);\n\n data = computed(() => {\n const asset = this.asset();\n\n if (!asset) {\n return null;\n }\n\n if (isContentfulGqlAsset(asset)) {\n return {\n url: asset.url,\n contentType: asset.contentType,\n };\n }\n\n return {\n url: asset.fields.file.url,\n contentType: asset.fields.file.contentType,\n };\n });\n}\n","import { ContentfulAudioComponent } from '../components/audio';\nimport { ContentfulFileComponent } from '../components/file';\nimport { ContentfulImageComponent } from '../components/image';\nimport { ContentfulLinkComponent } from '../components/link';\nimport { ContentfulVideoComponent } from '../components/video';\nimport { ContentfulConfig } from '../types';\n\nexport const createContentfulConfig = (\n config: Partial<ContentfulConfig> | null | undefined = {},\n): ContentfulConfig => ({\n // This default config must be inline and not saved inside a const for some weird webpack reason\n ...{\n useTailwindClasses: false,\n internalHosts: [],\n components: {\n audio: ContentfulAudioComponent,\n file: ContentfulFileComponent,\n image: ContentfulImageComponent,\n video: ContentfulVideoComponent,\n link: ContentfulLinkComponent,\n },\n customComponents: {},\n imageOptions: {\n srcsetSizes: ['375w', '1280w', '1920w', '2560w'],\n sizes: [],\n backgroundColor: null,\n },\n },\n ...(config || {}),\n});\n","import { DOCUMENT } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, ViewEncapsulation, computed, inject, input } from '@angular/core';\nimport { RouterLink } from '@angular/router';\nimport { CONTENTFUL_CONFIG } from '../../constants/contentful.constants';\nimport { createContentfulConfig } from '../../utils/contentful-config';\n\nconst getPrimaryDomain = (host: string): string => {\n const parts = host.split('.');\n return parts.length > 2 ? parts.slice(-2).join('.') : host;\n};\n\n@Component({\n selector: 'et-contentful-link',\n template: `\n @if (isExternal()) {\n <a\n [class]=\"linkClass()\"\n [href]=\"href()\"\n [target]=\"openInNewTab() ? '_blank' : null\"\n [rel]=\"openInNewTab() ? 'noopener noreferrer' : null\"\n >{{ text() }}</a\n >\n } @else {\n <a [class]=\"linkClass()\" [routerLink]=\"internalPath()\">{{ text() }}</a>\n }\n `,\n host: {\n style: 'display: contents',\n },\n imports: [RouterLink],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n})\nexport class ContentfulLinkComponent {\n private readonly _document = inject(DOCUMENT);\n private readonly _config = inject(CONTENTFUL_CONFIG, { optional: true }) ?? createContentfulConfig();\n\n href = input.required<string>();\n text = input.required<string>();\n textClass = input('');\n\n isExternal = computed(() => {\n const href = this.href();\n const isAbsolute = href.startsWith('http://') || href.startsWith('https://') || href.startsWith('//');\n\n if (!isAbsolute) return false;\n\n try {\n const parsed = new URL(href.startsWith('//') ? `https:${href}` : href);\n const internalHosts = [this._document.location.host, ...this._config.internalHosts];\n return !internalHosts.includes(parsed.host);\n } catch {\n return true;\n }\n });\n\n openInNewTab = computed(() => {\n if (!this.isExternal()) return false;\n\n const href = this.href();\n\n try {\n const parsed = new URL(href.startsWith('//') ? `https:${href}` : href);\n const internalPrimaryDomains = [\n getPrimaryDomain(this._document.location.host),\n ...this._config.internalHosts.map(getPrimaryDomain),\n ];\n return !internalPrimaryDomains.includes(getPrimaryDomain(parsed.host));\n } catch {\n return true;\n }\n });\n\n internalPath = computed(() => {\n const href = this.href();\n\n if (!href.startsWith('http://') && !href.startsWith('https://') && !href.startsWith('//')) {\n return href;\n }\n\n try {\n const url = new URL(href.startsWith('//') ? `https:${href}` : href);\n return url.pathname + url.search + url.hash;\n } catch {\n return href;\n }\n });\n\n linkClass = computed(() => {\n const base = 'et-contentful-rich-text-default-element et-contentful-rich-text-default-a';\n const extra = this.textClass();\n\n return extra ? `${base} ${extra}` : base;\n });\n}\n","import { RuntimeError } from '@ethlete/core';\n\nexport const RICH_TEXT_RENDERER_ERRORS = {\n rich_text_undefined:\n 'The property value given at richTextPath is undefined. Use the richTextPath input to specify the path to the rich text object.',\n rich_text_wrong_type:\n 'The rich text object does not satisfy the RichTextResponse interface. It should contain a property named \"nodeType\" with the value \"document\".',\n\n asset_id_not_found: 'The asset ID was not found. This node is not supported.',\n entry_id_not_found: 'The entry ID was not found. This node is not supported.',\n\n asset_not_found: 'The asset was not found. This node is not supported.',\n entry_not_found: 'The entry was not found. This node is not supported.',\n\n custom_component_not_found: 'No custom component found for entry type. Please provide one for this type.',\n\n text_parent_not_found: 'The parent node is not found. This structure is not supported.',\n text_parent_wrong_type:\n 'The parent node neither a html element nor a custom component. This structure is not supported.',\n} as const;\n\nconst RICH_TEXT_RENDERER_ERROR_CODES = Object.keys(RICH_TEXT_RENDERER_ERRORS).reduce(\n (acc, key, index) => {\n acc[key as keyof typeof RICH_TEXT_RENDERER_ERRORS] = index;\n return acc;\n },\n {} as Record<keyof typeof RICH_TEXT_RENDERER_ERRORS, number>,\n);\n\nexport const richTextRendererError = (code: keyof typeof RICH_TEXT_RENDERER_ERRORS, data?: unknown) => {\n const message = `<et-contentful-rich-text-renderer>: ${RICH_TEXT_RENDERER_ERRORS[code]}`;\n\n throw new RuntimeError(RICH_TEXT_RENDERER_ERROR_CODES[code], message, data);\n};\n","import { BLOCKS, INLINES } from '@contentful/rich-text-types';\nimport { isObject } from '@ethlete/core';\nimport { RichTextResponse } from '../../types';\n\nexport const isRichTextRootNode = (node: unknown): node is RichTextResponse => {\n return isObject(node) && 'nodeType' in node && node['nodeType'] === 'document';\n};\n\nexport const translateContentfulNodeTypeToHtmlTag = (nodeType: 'text' | BLOCKS | INLINES) => {\n switch (nodeType) {\n case BLOCKS.HEADING_1:\n return 'h1';\n case BLOCKS.HEADING_2:\n return 'h2';\n case BLOCKS.HEADING_3:\n return 'h3';\n case BLOCKS.HEADING_4:\n return 'h4';\n case BLOCKS.HEADING_5:\n return 'h5';\n case BLOCKS.HEADING_6:\n return 'h6';\n case BLOCKS.PARAGRAPH:\n return 'p';\n case BLOCKS.UL_LIST:\n return 'ul';\n case BLOCKS.OL_LIST:\n return 'ol';\n case BLOCKS.LIST_ITEM:\n return 'li';\n case BLOCKS.HR:\n return 'hr';\n case BLOCKS.QUOTE:\n return 'blockquote';\n case BLOCKS.TABLE:\n return 'table';\n case BLOCKS.TABLE_ROW:\n return 'tr';\n case BLOCKS.TABLE_CELL:\n return 'td';\n case BLOCKS.TABLE_HEADER_CELL:\n return 'th';\n case BLOCKS.EMBEDDED_ASSET:\n return 'div';\n\n case INLINES.ENTRY_HYPERLINK:\n return 'a';\n case INLINES.ASSET_HYPERLINK:\n return 'a';\n\n case 'text':\n return 'span';\n\n // Will be ignored by the renderer\n case 'document':\n return 'div';\n\n case BLOCKS.EMBEDDED_ENTRY:\n return 'div';\n case INLINES.EMBEDDED_ENTRY:\n return 'div';\n\n default:\n return 'div';\n }\n};\n","import { ComponentType } from '@angular/cdk/portal';\nimport { DOCUMENT } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n ComponentRef,\n ElementRef,\n EmbeddedViewRef,\n ViewContainerRef,\n ViewEncapsulation,\n computed,\n inject,\n input,\n isDevMode,\n reflectComponentType,\n} from '@angular/core';\nimport { takeUntilDestroyed, toObservable, toSignal } from '@angular/core/rxjs-interop';\nimport { BLOCKS, Block, INLINES, Inline, Mark, Text } from '@contentful/rich-text-types';\nimport { getObjectProperty, injectRenderer, isObject } from '@ethlete/core';\nimport { pairwise, startWith, tap } from 'rxjs';\nimport { CONTENTFUL_CONFIG } from '../../constants/contentful.constants';\nimport {\n ContentfulCollection,\n ContentfulEntry,\n ContentfulEntryLinkItem,\n ContentfulRestAsset,\n RichTextResponse,\n} from '../../types';\nimport { createContentfulConfig } from '../../utils/contentful-config';\nimport { richTextRendererError } from './rich-text-renderer.errors';\nimport { isRichTextRootNode, translateContentfulNodeTypeToHtmlTag } from './rich-text-renderer.util';\n\nexport const RENDER_COMMAND_TYPE = {\n HTML_OPEN: 0,\n HTML_CLOSE: 1,\n TEXT: 2,\n COMPONENT: 3,\n} as const;\n\nexport const RENDER_COMMAND_POSITION = {\n TYPE: 0,\n NESTING_LEVEL: 1,\n DOM_POSITION: 2,\n INDEX: 3,\n} as const;\n\nexport const HTML_OPEN_RENDER_COMMAND_POSITION = {\n ATTRIBUTES: 4,\n TAG_NAME: 5,\n ELEMENT_ID: 6,\n} as const;\n\nexport const HTML_CLOSE_RENDER_COMMAND_POSITION = {\n TAG_NAME: 4,\n ELEMENT_ID: 5,\n} as const;\n\nexport const TEXT_RENDER_COMMAND_POSITION = {\n ATTRIBUTES: 4,\n TEXT: 5,\n TEXT_ID: 6,\n} as const;\n\nexport const COMPONENT_RENDER_COMMAND_POSITION = {\n ATTRIBUTES: 4,\n COMPONENT: 5,\n INPUTS: 6,\n COMPONENT_ID: 7,\n} as const;\n\ntype HtmlOpenRenderCommand = [\n type: typeof RENDER_COMMAND_TYPE.HTML_OPEN,\n nestingLevel: number,\n domPosition: number,\n index: number,\n attributes: Record<string, string>,\n tagName: keyof HTMLElementTagNameMap,\n textId: string,\n];\n\ntype HtmlCloseRenderCommand = [\n type: typeof RENDER_COMMAND_TYPE.HTML_CLOSE,\n nestingLevel: number,\n domPosition: number,\n index: number,\n tagName: keyof HTMLElementTagNameMap,\n elementId: string,\n];\n\ntype TextRenderCommand = [\n type: typeof RENDER_COMMAND_TYPE.TEXT,\n nestingLevel: number,\n domPosition: number,\n index: number,\n attributes: Record<string, string>,\n text: string,\n elementId: string,\n];\n\ntype ComponentRenderCommand = [\n type: typeof RENDER_COMMAND_TYPE.COMPONENT,\n nestingLevel: number,\n domPosition: number,\n index: number,\n attributes: Record<string, string>,\n component: ComponentType<unknown>,\n inputs: Record<string, unknown>,\n componentId: string,\n];\n\ntype RenderCommand = HtmlOpenRenderCommand | HtmlCloseRenderCommand | TextRenderCommand | ComponentRenderCommand;\n\nexport const RENDER_INSTRUCTION_POSITION = {\n TYPE: 0,\n COMMAND: 1,\n} as const;\n\nexport const RENDER_INSTRUCTION_TYPE = {\n CREATE: 0,\n UPDATE: 1,\n DELETE: 2,\n MOVE: 3,\n} as const;\n\ntype RenderInstructionTypeValue = (typeof RENDER_INSTRUCTION_TYPE)[keyof typeof RENDER_INSTRUCTION_TYPE];\n\ntype RenderInstruction = [RenderInstructionTypeValue, RenderCommand];\n\nconst MARK_TAILWIND_MAP: Record<string, string> = {\n bold: 'font-bold',\n italic: 'italic',\n underline: 'underline',\n code: 'font-mono',\n};\n\nexport const marksToClass = (marks: Mark[]) => {\n const classes: string[] = [];\n\n for (const mark of marks) {\n let klass = MARK_TAILWIND_MAP[mark.type];\n\n if (!klass) {\n console.warn(`No class found for mark type! Falling back to \"${mark.type}\".`, mark);\n\n klass = mark.type;\n }\n\n classes.push(klass);\n }\n\n return classes.join(' ');\n};\n\nexport const isHtmlOpenRenderCommand = (command: RenderCommand): command is HtmlOpenRenderCommand => {\n return command[RENDER_COMMAND_POSITION.TYPE] === RENDER_COMMAND_TYPE.HTML_OPEN;\n};\n\nexport const isHtmlCloseRenderCommand = (command: RenderCommand): command is HtmlCloseRenderCommand => {\n return command[RENDER_COMMAND_POSITION.TYPE] === RENDER_COMMAND_TYPE.HTML_CLOSE;\n};\n\nexport const isTextRenderCommand = (command: RenderCommand): command is TextRenderCommand => {\n return command[RENDER_COMMAND_POSITION.TYPE] === RENDER_COMMAND_TYPE.TEXT;\n};\n\nexport const isComponentRenderCommand = (command: RenderCommand): command is ComponentRenderCommand => {\n return command[RENDER_COMMAND_POSITION.TYPE] === RENDER_COMMAND_TYPE.COMPONENT;\n};\n\nexport const getRenderCommandId = (command: RenderCommand) => {\n if (isHtmlOpenRenderCommand(command)) {\n return command[HTML_OPEN_RENDER_COMMAND_POSITION.ELEMENT_ID];\n } else if (isHtmlCloseRenderCommand(command)) {\n return command[HTML_CLOSE_RENDER_COMMAND_POSITION.ELEMENT_ID];\n } else if (isTextRenderCommand(command)) {\n return command[TEXT_RENDER_COMMAND_POSITION.TEXT_ID];\n } else {\n return command[COMPONENT_RENDER_COMMAND_POSITION.COMPONENT_ID];\n }\n};\n\nconst CLASS_ATTR = 'class';\nconst DEFAULT_COMPONENT_TYPES = {\n IMAGE: '$$$_et-image',\n VIDEO: '$$$_et-video',\n AUDIO: '$$$_et-audio',\n FILE: '$$$_et-file',\n LINK: '$$$_et-link',\n};\n\ntype ExecutedCommandCacheItemBase = {\n element: HTMLElement;\n};\n\ntype ExecutedComponentCommandCacheItem = {\n command: ComponentRenderCommand;\n componentRef: ComponentRef<unknown>;\n} & ExecutedCommandCacheItemBase;\n\ntype ExecutedHtmlCommandCacheItem = {\n command: HtmlOpenRenderCommand | HtmlCloseRenderCommand;\n} & ExecutedCommandCacheItemBase;\n\ntype ExecutedTextCommandCacheItem = {\n command: TextRenderCommand;\n textNode: unknown;\n} & ExecutedCommandCacheItemBase;\n\ntype ExecutedCommandCacheItem =\n | ExecutedComponentCommandCacheItem\n | ExecutedHtmlCommandCacheItem\n | ExecutedTextCommandCacheItem;\n\nexport const isExecutedComponentCommandCacheItem = (\n cache: ExecutedCommandCacheItem,\n): cache is ExecutedComponentCommandCacheItem => {\n return isComponentRenderCommand(cache.command);\n};\n\nexport const isExecutedHtmlOrTextCommandCacheItem = (\n cache: ExecutedCommandCacheItem,\n): cache is ExecutedHtmlCommandCacheItem => {\n return isHtmlCloseRenderCommand(cache.command) || isHtmlOpenRenderCommand(cache.command);\n};\n\nexport const isExecutedTextCommandCacheItem = (\n cache: ExecutedCommandCacheItem,\n): cache is ExecutedTextCommandCacheItem => {\n return isTextRenderCommand(cache.command);\n};\n\nexport const ET_CONTENTFUL_ANY_ENTRY_CONTENT_TYPE_SYS_ID = '$$$_et-contentful-any-entry-content-type-sys-id';\n\nexport type ContentfulIncludeMap = {\n /**\n * Select an entry by its ID and content type ID.\n *\n * The content type ID can be found inside the entry -> sys -> contentType -> sys -> id property.\n *\n * You can provide the `ET_CONTENTFUL_ANY_ENTRY_CONTENT_TYPE_SYS_ID` constant to match any entry sys ID.\n * But be aware that this will return the entry as is without any type checking.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n getEntry: <T extends { [key: string]: any }>(id: string, contentTypeId: string) => ContentfulEntry<T> | null;\n\n /**\n * Select multiple entries by their IDs and content type ID.\n * If an entry is not found, it will be omitted from the result.\n *\n * The content type ID can be found inside the entry -> sys -> contentType -> sys -> id property.\n *\n * You can provide the `ET_CONTENTFUL_ANY_ENTRY_CONTENT_TYPE_SYS_ID` constant to match any entry sys ID.\n * But be aware that this will return the entry as is without any type checking.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n getEntries: <T extends { [key: string]: any }>(\n ids: string[] | ContentfulEntryLinkItem[],\n contentTypeId: string,\n ) => ContentfulEntry<T>[];\n\n /**\n * Select an asset by its ID.\n */\n getAsset: (id: string) => ContentfulRestAsset | null;\n\n /**\n * Select multiple assets by their IDs. If an asset is not found, it will be omitted from the result.\n */\n getAssets: (ids: string[]) => ContentfulRestAsset[];\n};\n\nexport type CreateContentfulIncludeMapConfig = {\n /** The entries that should be present inside the map */\n entries: ContentfulEntry[];\n\n /** The assets that should be present inside the map */\n assets: ContentfulRestAsset[];\n};\n\n/**\n * Create a contentful include map using the provided entries and assets.\n */\nexport const createContentfulIncludeMap = (config: CreateContentfulIncludeMapConfig): ContentfulIncludeMap => {\n const { entries, assets } = config;\n\n const assetMap = new Map(assets.map((asset) => [asset.sys.id, asset]));\n const entryMap = new Map(entries.map((entry) => [entry.sys.id, entry]));\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const getEntry = <T extends { [key: string]: any }>(id: string, contentTypeId: string) => {\n const entry = entryMap.get(id);\n\n if (!entry) {\n if (isDevMode()) {\n console.warn('Entry not found! Will return null. Is the include query param to low?', { id, entryMap });\n }\n\n return null;\n }\n\n if (contentTypeId === ET_CONTENTFUL_ANY_ENTRY_CONTENT_TYPE_SYS_ID) {\n return entry as ContentfulEntry<T>;\n }\n\n if (entry.sys.contentType.sys.id !== contentTypeId) {\n if (isDevMode()) {\n console.warn('Entry sys ID does not match the provided sys ID! Will return null.', {\n entry,\n sysId: contentTypeId,\n });\n }\n\n return null;\n }\n\n return entry as ContentfulEntry<T>;\n };\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const getEntries = <T extends { [key: string]: any }>(\n ids: string[] | ContentfulEntryLinkItem[],\n contentTypeId: string,\n ) => {\n const entries = ids\n .map((id) => (typeof id === 'string' ? id : id.sys.id))\n .map((id) => getEntry<T>(id, contentTypeId))\n .filter((entry): entry is ContentfulEntry<T> => entry !== null);\n\n return entries;\n };\n\n const getAsset = (id: string) => {\n return assetMap.get(id) ?? null;\n };\n\n const getAssets = (ids: string[]) => {\n return ids.map((id) => getAsset(id)).filter((asset): asset is ContentfulRestAsset => asset !== null);\n };\n\n return {\n getEntry,\n getEntries,\n getAsset,\n getAssets,\n };\n};\n\n@Component({\n selector: 'et-contentful-rich-text-renderer',\n template: ``,\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n class: 'et-contentful-rich-text-renderer',\n },\n})\nexport class ContentfulRichTextRendererComponent {\n _viewContainerRef = inject(ViewContainerRef);\n _renderer = injectRenderer();\n _elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n _document = inject(DOCUMENT);\n _config = inject(CONTENTFUL_CONFIG, { optional: true }) ?? createContentfulConfig();\n\n /**\n * A cache for all executed commands that are not deleted.\n * This is used to keep track of all rendered elements and components.\n * The key is the render command element ID.\n */\n _executedCommandsCache = new Map<string, ExecutedCommandCacheItem>();\n\n /**\n * The contentful response gotten via their REST api.\n * @see https://www.contentful.com/developers/docs/references/content-delivery-api/#/reference/entries/entries-collection\n */\n content = input.required<ContentfulCollection | null | undefined>();\n\n /**\n * The path to where the rich text field is inside the contentful response. Dot and array notation is allowed.\n * @example \"items[0].fields.html\"\n */\n richTextPath = input.required<string>();\n\n /**\n * A map of all includes in the contentful response.\n * This is useful for looking up assets and entries that are referenced in the rich text without having to use loops.\n */\n contentIncludesMap = computed<ContentfulIncludeMap>(() => {\n const content = this.content();\n const assets = content?.includes.Asset;\n const entries = content?.includes.Entry;\n\n return createContentfulIncludeMap({ assets: assets ?? [], entries: entries ?? [] });\n });\n\n /**\n * The rich text data that should be rendered.\n */\n richTextData = computed(() => {\n const content = this.content();\n const richTextPath = this.richTextPath();\n\n if (!content) {\n return null;\n }\n\n const richText = getObjectProperty(content as unknown as Record<string, unknown>, richTextPath);\n\n if (!isObject(richText)) {\n throw richTextRendererError('rich_text_undefined', { content, richTextPath });\n }\n\n if (!isRichTextRootNode(richText)) {\n throw richTextRendererError('rich_text_wrong_type', { content, richTextPath });\n }\n\n return richText as RichTextResponse;\n });\n\n renderCommands = computed(() => {\n const richTextData = this.richTextData();\n\n if (!richTextData) {\n return [];\n }\n\n return this._createRenderCommands(richTextData);\n });\n\n renderCommandHistory = toSignal(\n toObservable(this.renderCommands).pipe(startWith([] as RenderCommand[]), pairwise()),\n { initialValue: [[], []] },\n );\n\n previousRenderCommandMap = computed(() => {\n const [prevCommands] = this.renderCommandHistory();\n\n const map = new Map<string | number, RenderCommand>();\n\n for (const command of prevCommands) {\n map.set(getRenderCommandId(command), command);\n }\n\n return map;\n });\n\n renderInstructions = computed(() => {\n const commands = this.renderCommands();\n const previousRenderCommandMap = new Map(this.previousRenderCommandMap());\n\n const instructions: RenderInstruction[] = [];\n\n // remove deleted components as well as all other elements\n for (const [, command] of previousRenderCommandMap) {\n if (isComponentRenderCommand(command)) {\n // keep the component around if it's still in the new commands\n if (commands.some((c) => getRenderCommandId(c) === getRenderCommandId(command))) {\n continue;\n }\n }\n\n instructions.push([RENDER_INSTRUCTION_TYPE.DELETE, command]);\n\n // remove from map to mark as used\n previousRenderCommandMap.delete(getRenderCommandId(command));\n }\n\n // Find the indexes of the commands remaining in the previousRenderCommandMap in the new commands array.\n const lastComponentIndexes: { newIndex: number; prevIndex: number; command: RenderCommand }[] = [];\n for (const [id, command] of previousRenderCommandMap) {\n const index = commands.findIndex((c) => getRenderCommandId(c) === id);\n const newCommand = commands[index]!;\n\n if (index === -1) {\n throw new Error('Command not found!');\n }\n\n lastComponentIndexes.push({\n newIndex: index,\n prevIndex: command[RENDER_COMMAND_POSITION.INDEX],\n command: newCommand,\n });\n }\n\n lastComponentIndexes.sort((a, b) => a.newIndex - b.newIndex);\n\n // check if the prevIndex are in order ascending\n // for indexes that are not in order, create a move instruction\n // for indexes that are in order, create an update instruction\n let moveCheckIndex = 0;\n while (moveCheckIndex < lastComponentIndexes.length - 1) {\n const moveCurr = lastComponentIndexes[moveCheckIndex];\n const moveNext = lastComponentIndexes[moveCheckIndex + 1];\n\n if (!moveCurr || !moveNext) {\n break;\n }\n\n if (moveCurr.prevIndex > moveNext.prevIndex) {\n lastComponentIndexes.splice(moveCheckIndex + 1, 1);\n instructions.push([RENDER_INSTRUCTION_TYPE.MOVE, moveNext.command]);\n } else {\n instructions.push([RENDER_INSTRUCTION_TYPE.UPDATE, moveNext.command]);\n moveCheckIndex++;\n }\n }\n\n for (const command of commands) {\n const id = getRenderCommandId(command);\n\n if (isComponentRenderCommand(command)) {\n const previousCommand = previousRenderCommandMap.get(id);\n\n if (!previousCommand) {\n // create\n instructions.push([RENDER_INSTRUCTION_TYPE.CREATE, command]);\n }\n } else {\n // create\n instructions.push([RENDER_INSTRUCTION_TYPE.CREATE, command]);\n }\n }\n\n return instructions;\n });\n\n constructor() {\n toObservable(this.renderInstructions)\n .pipe(\n takeUntilDestroyed(),\n tap((instructions) => {\n this._execInstructions(instructions);\n }),\n )\n .subscribe();\n }\n\n private _createRenderCommands(richTextData: RichTextResponse) {\n /** List of all render commands */\n const rootCommands: RenderCommand[] = [];\n\n /** Counter for generating unique html element IDs. */\n let elementOpenId = 0;\n\n /** Counter for generating unique html element IDs. */\n let elementCloseId = 0;\n\n /** Counter for generating unique component IDs. */\n const componentIdMap = new Map<string, number>();\n\n /** The nesting level of the current node. */\n let nestingLevel = 0;\n\n /** The position (index) of the current node inside the parent node. */\n let domPosition = 0;\n\n let textId = 0;\n\n let commandIndex = 0;\n\n const traverse = (node: Block | Inline | Text) => {\n switch (node.nodeType) {\n case 'text': {\n // Render media\n const type = RENDER_COMMAND_TYPE.TEXT;\n const text = node.value;\n\n if (!text) break;\n\n const attributes: Record<string, string> = {\n class: 'et-contentful-rich-text-default-element et-contentful-rich-text-default-span',\n };\n\n if (node.marks.length) {\n const markClasses = marksToClass(node.marks);\n\n if (CLASS_ATTR in attributes) {\n attributes[CLASS_ATTR] += ` ${markClasses}`;\n } else {\n attributes[CLASS_ATTR] = markClasses;\n }\n }\n\n const id = 't' + textId++;\n\n const command: TextRenderCommand = [type, nestingLevel, domPosition, commandIndex++, attributes, text, id];\n\n rootCommands.push(command);\n domPosition++;\n\n break;\n }\n\n case BLOCKS.EMBEDDED_ASSET: {\n // Render media\n const type = RENDER_COMMAND_TYPE.COMPONENT;\n const assetId = node.data['target']?.sys?.id;\n\n if (!assetId) {\n throw richTextRendererError('asset_id_not_found', { node });\n }\n\n const asset = this.contentIncludesMap().getAsset(assetId);\n\n if (!asset) {\n throw richTextRendererError('asset_not_found', { assetId, node });\n }\n\n const contentType = asset.fields.file.contentType;\n const assetComponents = this._config.components;\n\n // Every property inside the asset will be null if no file was provided for a translation.\n // In this case, we can assume that the asset is missing due to user error.\n const isMissing = !contentType && !asset.fields.file.url;\n\n if (isMissing) {\n if (isDevMode()) {\n console.warn(\n 'Asset is missing file data! Asset will be skipped. Did you forget to upload a file for the current translation in Contentful?',\n { asset },\n );\n }\n\n break;\n }\n\n const isImage = contentType?.startsWith('image/');\n const isVideo = contentType?.startsWith('video/');\n const isAudio = contentType?.startsWith('audio/');\n\n const component = isImage\n ? assetComponents.image\n : isVideo\n ? assetComponents.video\n : isAudio\n ? assetComponents.audio\n : assetComponents.file;\n\n const componentType = isImage\n ? DEFAULT_COMPONENT_TYPES.IMAGE\n : isVideo\n ? DEFAULT_COMPONENT_TYPES.VIDEO\n : isAudio\n ? DEFAULT_COMPONENT_TYPES.AUDIO\n : DEFAULT_COMPONENT_TYPES.FILE;\n\n let componentId = componentIdMap.get(componentType) ?? -1;\n const id = componentType + ++componentId;\n componentIdMap.set(componentType, componentId);\n\n const attributes = {};\n\n const inputs = {\n asset,\n };\n\n const command: ComponentRenderCommand = [\n type,\n nestingLevel,\n domPosition,\n commandIndex++,\n attributes,\n component,\n inputs,\n id,\n ];\n\n rootCommands.push(command);\n\n domPosition++;\n\n break;\n }\n\n case INLINES.HYPERLINK: {\n const uri = (node.data['uri'] as string) ?? '';\n\n // Collect all text and marks from children (hyperlink children are text nodes)\n let linkText = '';\n const linkMarks: Mark[] = [];\n\n for (const child of node.content) {\n if (child.nodeType === 'text') {\n linkText += child.value;\n linkMarks.push(...child.marks);\n }\n }\n\n const textClass = linkMarks.length ? marksToClass(linkMarks) : '';\n\n let linkComponentId = componentIdMap.get(DEFAULT_COMPONENT_TYPES.LINK) ?? -1;\n const linkId = DEFAULT_COMPONENT_TYPES.LINK + ++linkComponentId;\n componentIdMap.set(DEFAULT_COMPONENT_TYPES.LINK, linkComponentId);\n\n const linkCommand: ComponentRenderCommand = [\n RENDER_COMMAND_TYPE.COMPONENT,\n nestingLevel,\n domPosition,\n commandIndex++,\n {},\n this._config.components.link,\n { href: uri, text: linkText, textClass },\n linkId,\n ];\n\n rootCommands.push(linkCommand);\n domPosition++;\n\n break;\n }\n\n case BLOCKS.EMBEDDED_ENTRY:\n case INLINES.EMBEDDED_ENTRY: {\n // Render component\n const type = RENDER_COMMAND_TYPE.COMPONENT;\n const entryId = node.data['target']?.sys?.id;\n\n if (!entryId) {\n throw richTextRendererError('entry_id_not_found', { node });\n }\n\n const entry = this.contentIncludesMap().getEntry(entryId, ET_CONTENTFUL_ANY_ENTRY_CONTENT_TYPE_SYS_ID);\n\n if (!entry) {\n throw richTextRendererError('entry_not_found', { entryId, node });\n }\n\n const componentType = entry.sys.contentType.sys.id;\n\n const component = this._config.customComponents[componentType];\n\n if (!component) {\n throw richTextRendererError('custom_component_not_found', {\n componentType,\n customComponents: this._config.customComponents,\n entry,\n });\n }\n\n const attributes = {};\n let componentId = componentIdMap.get(componentType) ?? -1;\n const id = componentType + ++componentId;\n componentIdMap.set(componentType, componentId);\n\n const inputs = {\n fields: entry.fields,\n metadata: entry.metadata,\n sys: entry.sys,\n includes: this.contentIncludesMap(),\n };\n\n const command: ComponentRenderCommand = [\n type,\n nestingLevel,\n domPosition,\n commandIndex++,\n attributes,\n component,\n inputs,\n id,\n ];\n\n rootCommands.push(command);\n\n domPosition++;\n\n break;\n }\n\n default: {\n const type = RENDER_COMMAND_TYPE.HTML_OPEN;\n const tag = translateContentfulNodeTypeToHtmlTag(node.nodeType);\n const attributes: Record<string, string> = {\n class: `et-contentful-rich-text-default-element et-contentful-rich-text-default-${tag}`,\n };\n const id = 'e-o' + elementOpenId++;\n\n const command: HtmlOpenRenderCommand = [type, nestingLevel, domPosition, commandIndex++, attributes, tag, id];\n\n rootCommands.push(command);\n\n const domPositionAtThisLevel = domPosition;\n // Normal html elements can have children\n for (const child of node.content) {\n domPosition = 0;\n nestingLevel++;\n traverse(child);\n nestingLevel--;\n domPosition = domPositionAtThisLevel;\n }\n\n const lastCommand = rootCommands[rootCommands.length - 1];\n\n if (\n lastCommand?.[RENDER_COMMAND_POSITION.TYPE] === RENDER_COMMAND_TYPE.HTML_OPEN &&\n lastCommand[HTML_OPEN_RENDER_COMMAND_POSITION.TAG_NAME] !== 'td' &&\n lastCommand[HTML_OPEN_RENDER_COMMAND_POSITION.TAG_NAME] !== 'hr'\n ) {\n // If the last command is an open command, we can remove it since it's empty\n rootCommands.pop();\n elementOpenId--;\n commandIndex--;\n } else {\n const closeId = 'e-c' + elementCloseId++;\n\n const closeCommand: HtmlCloseRenderCommand = [\n RENDER_COMMAND_TYPE.HTML_CLOSE,\n nestingLevel,\n domPosition,\n commandIndex++,\n tag,\n closeId,\n ];\n rootCommands.push(closeCommand);\n\n domPosition++;\n }\n\n break;\n }\n }\n };\n\n for (const node of richTextData.content) {\n traverse(node);\n }\n\n return rootCommands;\n }\n\n private _execInstructions(instructions: RenderInstruction[]) {\n for (const instruction of instructions) {\n const type = instruction[RENDER_INSTRUCTION_POSITION.TYPE];\n const command = instruction[RENDER_INSTRUCTION_POSITION.COMMAND];\n\n switch (type) {\n case RENDER_INSTRUCTION_TYPE.CREATE:\n this._runCreateInstruction(command);\n break;\n case RENDER_INSTRUCTION_TYPE.UPDATE:\n this._runUpdateInstruction(command);\n break;\n case RENDER_INSTRUCTION_TYPE.MOVE:\n this._runMoveInstruction(command);\n break;\n case RENDER_INSTRUCTION_TYPE.DELETE:\n this._runDeleteInstruction(command);\n break;\n }\n }\n }\n\n private _runCreateInstruction(command: RenderCommand) {\n const id = getRenderCommandId(command);\n const parentElement = this._findParent(command);\n const nextElement = this._findFollowingElement(command);\n\n if (isComponentRenderCommand(command)) {\n const componentRef = this._viewContainerRef.createComponent(command[COMPONENT_RENDER_COMMAND_POSITION.COMPONENT]);\n\n this._updateComponentInputs(command, componentRef);\n\n const rootNode = this._getComponentRootNode(componentRef);\n\n this._renderInsertOrAppend(rootNode, parentElement, nextElement);\n\n this._executedCommandsCache.set(id, {\n command,\n componentRef,\n element: rootNode,\n });\n } else if (isTextRenderCommand(command)) {\n const text = command[TEXT_RENDER_COMMAND_POSITION.TEXT];\n const span = this._renderer.createElement('span');\n const attributes = command[TEXT_RENDER_COMMAND_POSITION.ATTRIBUTES];\n const textSplitInLineBreaks = text.split('\\n').filter((t) => t.trim().length > 0);\n\n const textNodes: unknown[] = [];\n\n for (const [key, value] of Object.entries(attributes)) {\n this._renderer.setAttribute(span, key, value);\n }\n\n if (text.startsWith('\\n')) {\n const brNode = this._renderer.createElement('br');\n this._renderer.appendChild(parentElement, brNode);\n }\n\n for (const [textPartIndex, textPart] of textSplitInLineBreaks.entries()) {\n if (textPartIndex > 0) {\n const brNode = this._renderer.createElement('br');\n this._renderer.appendChild(span, brNode);\n }\n\n const textNode = this._renderer.createText(textPart);\n\n this._renderer.appendChild(span, textNode);\n\n textNodes.push(textNode);\n }\n\n this._renderInsertOrAppend(span, parentElement, nextElement);\n\n this._executedCommandsCache.set(id, {\n command,\n element: span,\n textNode: textNodes,\n });\n } else if (isHtmlOpenRenderCommand(command)) {\n const tag = command[HTML_OPEN_RENDER_COMMAND_POSITION.TAG_NAME];\n const attributes = command[HTML_OPEN_RENDER_COMMAND_POSITION.ATTRIBUTES];\n const element = this._renderer.createElement(tag);\n\n for (const [key, value] of Object.entries(attributes)) {\n this._renderer.setAttribute(element, key, value);\n }\n\n this._renderInsertOrAppend(element, parentElement, nextElement);\n\n this._executedCommandsCache.set(id, {\n command,\n element,\n });\n }\n }\n\n private _runUpdateInstruction(command: RenderCommand) {\n const id = getRenderCommandId(command);\n const cached = this._executedCommandsCache.get(id);\n\n if (!cached) {\n throw new Error('Cached command not found!');\n }\n\n if (isComponentRenderCommand(command)) {\n if (!isExecutedComponentCommandCacheItem(cached)) {\n throw new Error('Cached command is not a component command!');\n }\n\n const componentRef = cached.componentRef;\n\n if (!componentRef) {\n throw new Error('Component ref not found!');\n }\n\n this._updateComponentInputs(command, componentRef);\n }\n\n this._executedCommandsCache.set(id, {\n ...cached,\n command: command as any,\n });\n }\n\n private _runMoveInstruction(command: RenderCommand) {\n const id = getRenderCommandId(command);\n const cached = this._executedCommandsCache.get(id);\n\n if (!cached) {\n throw new Error('Cached command not found!');\n }\n\n if (isComponentRenderCommand(command)) {\n if (!isExecutedComponentCommandCacheItem(cached)) {\n throw new Error('Cached command is not a component command!');\n }\n\n const componentRef = cached.componentRef;\n\n if (!componentRef) {\n throw new Error('Component ref not found!');\n }\n\n const rootNode = cached.element;\n const oldParentElement = cached.element.parentElement;\n\n if (oldParentElement) {\n this._renderer.removeChild(oldParentElement, rootNode);\n }\n\n const newParentElement = this._findParent(command);\n const nextElement = this._findFollowingElement(command);\n\n this._renderInsertOrAppend(rootNode, newParentElement, nextElement);\n\n this._updateComponentInputs(command, componentRef);\n\n this._executedCommandsCache.set(id, {\n ...cached,\n command: command as any,\n });\n }\n }\n\n private _runDeleteInstruction(command: RenderCommand) {\n const id = getRenderCommandId(command);\n const cached = this._executedCommandsCache.get(id);\n\n if (!cached) {\n if (isHtmlCloseRenderCommand(command)) {\n return;\n }\n\n throw new Error('Cached command not found!');\n }\n\n if (isComponentRenderCommand(command)) {\n if (!isExecutedComponentCommandCacheItem(cached)) {\n throw new Error('Cached command is not a component command!');\n }\n\n cached.componentRef?.destroy();\n } else if (isTextRenderCommand(command)) {\n if (cached.element?.parentElement) {\n this._renderer.removeChild(cached.element.parentElement, cached.element);\n }\n } else if (isHtmlOpenRenderCommand(command)) {\n if (cached.element?.parentElement) {\n this._renderer.removeChild(cached.element.parentElement, cached.element);\n }\n }\n\n this._executedCommandsCache.delete(id);\n }\n\n private _getComponentRootNode(componentRef: ComponentRef<any>): HTMLElement {\n return (componentRef.hostView as EmbeddedViewRef<any>).rootNodes[0] as HTMLElement;\n }\n\n private _updateComponentInputs(command: ComponentRenderCommand, componentRef: ComponentRef<any>) {\n const inputMeta = reflectComponentType(command[COMPONENT_RENDER_COMMAND_POSITION.COMPONENT])?.inputs ?? [];\n const inputsByProp = new Map(inputMeta.map((i) => [i.propName, i.templateName]));\n\n for (const [key, value] of Object.entries(command[COMPONENT_RENDER_COMMAND_POSITION.INPUTS])) {\n const publicName = inputsByProp.get(key);\n\n if (publicName === undefined) continue;\n\n componentRef.setInput(publicName, value);\n }\n }\n\n private _findParent(command: RenderCommand) {\n const hostElement = this._elementRef.nativeElement;\n const nestingLevel = command[RENDER_COMMAND_POSITION.NESTING_LEVEL];\n let parentElement: HTMLElement | undefined;\n\n if (nestingLevel === 0) {\n parentElement = hostElement;\n } else {\n // Reverse search all render commands beginning from the current one using a for loop.\n // The parent is found when the command's nesting level ist the same as the current nesting level minus 1.\n // If the parent is not found, throw an error.\n const allCommands = this.renderCommands();\n const currentCommandIndex = command[RENDER_COMMAND_POSITION.INDEX];\n\n let parentCommand: RenderCommand | null = null;\n\n for (let i = currentCommandIndex - 1; i >= 0; i--) {\n const cmd = allCommands[i];\n\n if (!cmd) {\n throw new Error('Command not found!');\n }\n\n if (cmd[RENDER_COMMAND_POSITION.NESTING_LEVEL] === nestingLevel - 1 && isHtmlOpenRenderCommand(cmd)) {\n parentCommand = cmd;\n break;\n }\n }\n\n if (!parentCommand) {\n throw new Error('Parent command not found!');\n }\n\n parentElement = this._executedCommandsCache.get(getRenderCommandId(parentCommand))?.element;\n }\n\n if (!parentElement) {\n throw new Error('Parent element not found!');\n }\n\n return parentElement;\n }\n\n private _findFollowingElement(command: RenderCommand) {\n const cacheArray = Array.from(this._executedCommandsCache.values());\n let nextElement: HTMLElement | undefined = undefined;\n\n const domPosition = command[RENDER_COMMAND_POSITION.DOM_POSITION];\n const nestingLevel = command[RENDER_COMMAND_POSITION.NESTING_LEVEL];\n const type = command[RENDER_COMMAND_POSITION.TYPE];\n\n // Try to find an already rendered element with a domPosition that is greater than the current domPosition. If there are multiple, use the one with the smallest domPosition.\n // If it does not exist, use .appendChild to simply append the element to the end of the parent element.\n // If it does exist, use .insertBefore to insert the element before the found element.\n for (const cached of cacheArray) {\n if (\n cached.command[RENDER_COMMAND_POSITION.DOM_POSITION] > domPosition &&\n cached.command[RENDER_COMMAND_POSITION.NESTING_LEVEL] === nestingLevel &&\n // Make sure the element does not find itself\n cached.command[RENDER_COMMAND_POSITION.TYPE] !== type\n ) {\n nextElement = cached.element;\n break;\n }\n }\n\n return nextElement;\n }\n\n private _renderInsertOrAppend(\n nodeToRender: HTMLElement,\n parentElement: HTMLElement,\n nextElement: HTMLElement | undefined,\n ) {\n if (nextElement) {\n this._renderer.insertBefore(parentElement, nodeToRender, nextElement);\n } else {\n this._renderer.appendChild(parentElement, nodeToRender);\n }\n }\n}\n\n// const stringifyRenderCommand = (command: RenderCommand) => {\n// const nestAttr = `nest=\"${command[RENDER_COMMAND_POSITION.NESTING_LEVEL]}\"`;\n// const domAttr = `dom=\"${command[RENDER_COMMAND_POSITION.DOM_POSITION]}\"`;\n\n// if (isHtmlOpenRenderCommand(command)) {\n// return `<${command[HTML_OPEN_RENDER_COMMAND_POSITION.TAG_NAME]} ${nestAttr} ${domAttr} _id=\"${command[HTML_OPEN_RENDER_COMMAND_POSITION.ELEMENT_ID]}\" _index=\"${command[RENDER_COMMAND_POSITION.INDEX]}\">`;\n// } else if (isHtmlCloseRenderCommand(command)) {\n// return `</${command[HTML_CLOSE_RENDER_COMMAND_POSITION.TAG_NAME]} ${nestAttr} ${domAttr}>`;\n// } else if (isTextRenderCommand(command)) {\n// let text = command[TEXT_RENDER_COMMAND_POSITION.TEXT];\n// const brStart = text.startsWith('\\n') ? '<br/>' : '';\n// text = brStart ? text.slice(1) : text;\n\n// return [\n// ...(brStart ? [brStart] : []),\n// `<span ${nestAttr} ${domAttr} _index=\"${command[RENDER_COMMAND_POSITION.INDEX]}\">`,\n// text.replace(/\\n/g, ' <br/> '),\n// '</span>',\n// ];\n// } else if (isComponentRenderCommand(command)) {\n// const selector = command[COMPONENT_RENDER_COMMAND_POSITION.COMPONENT_ID];\n// return [`<${selector} ${nestAttr} ${domAttr}>`, `</${selector}>`];\n// } else {\n// return 'UNKNOWN';\n// }\n// };\n\n// const formatHTMLStringArray = (html: string[]) => {\n// const result: string[] = [];\n// let indent = 0;\n\n// for (const tag of html) {\n// if (tag.startsWith('</')) {\n// indent--;\n// }\n\n// result.push(' '.repeat(indent * 2) + tag);\n\n// if (tag.startsWith('<') && !tag.startsWith('</') && !tag.startsWith('<br')) {\n// indent++;\n// }\n// }\n\n// return result.join('\\n');\n// };\n\n// const debugVisualizeRenderCommands = (commands: RenderCommand[]) => {\n// const debug = commands.map((command) => stringifyRenderCommand(command)).flat();\n\n// const prettified = formatHTMLStringArray(debug);\n\n// return prettified;\n// };\n\n// const stringifyRenderInstruction = (instruction: RenderInstruction) => {\n// const type = instruction[RENDER_INSTRUCTION_POSITION.TYPE];\n// const translatedType = Object.entries(RENDER_INSTRUCTION_TYPE).find(([, value]) => value === type)?.[0];\n\n// const command = stringifyRenderCommand(instruction[RENDER_INSTRUCTION_POSITION.COMMAND]);\n\n// return `${translatedType}: ${command}`;\n// };\n","import { ContentfulAudioComponent } from './components/audio';\nimport { ContentfulFileComponent } from './components/file';\nimport { ContentfulImageComponent } from './components/image';\nimport { ContentfulRichTextRendererComponent } from './components/rich-text-renderer';\nimport { ContentfulVideoComponent } from './components/video';\n\nexport const ContentfulImports = [\n ContentfulAudioComponent,\n ContentfulFileComponent,\n ContentfulImageComponent,\n ContentfulVideoComponent,\n ContentfulRichTextRendererComponent,\n] as const;\n","import { CONTENTFUL_CONFIG } from '../constants';\nimport { ContentfulConfig, ContentfulEntry } from '../types';\nimport { createContentfulConfig } from './contentful-config';\n\nexport const provideContentfulConfig = (contentfulConfig: Partial<ContentfulConfig> | null | undefined = {}) => {\n return { provide: CONTENTFUL_CONFIG, useValue: createContentfulConfig(contentfulConfig) };\n};\n\nexport const isContentfulEntryType = <T extends ContentfulEntry>(entry: ContentfulEntry, type: string): entry is T =>\n entry.sys.contentType.sys.id === type;\n","export * from './lib/components/audio';\nexport * from './lib/components/file';\nexport * from './lib/components/image';\nexport * from './lib/components/link';\nexport * from './lib/components/rich-text-renderer';\nexport * from './lib/components/video';\nexport * from './lib/constants';\nexport * from './lib/contentful.imports';\nexport * from './lib/gql';\nexport * from './lib/types';\nexport * from './lib/utils';\n\n// Burst cache\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;AAEO,MAAM,6BAA6B,GAAG,GAAG,CAAA;;;;;;;;;;;;;;AA4BhD;AACO,MAAM,oBAAoB,GAAG,CAAC,KAAU,KAAiC;AAC9E,IAAA,OAAO,KAAK,EAAE,GAAG,EAAE,EAAE,IAAI,KAAK,EAAE,GAAG,IAAI,OAAO,KAAK,EAAE,IAAI,KAAK,QAAQ;AACxE;;MCba,wBAAwB,CAAA;AAdrC,IAAA,WAAA,GAAA;AAeE,QAAA,IAAA,CAAA,KAAK,GAAG,KAAK,CAAC,QAAQ,2EAA+D;AACrF,QAAA,IAAA,CAAA,UAAU,GAAG,KAAK,CAAc,IAAI,iFAAC;AACrC,QAAA,IAAA,CAAA,WAAW,GAAG,KAAK,CAAc,IAAI,kFAAC;AACtC,QAAA,IAAA,CAAA,eAAe,GAA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AAA,mCAAmC,+aAPpC,CAAA,CAAE,EAAA,QAAA,EAAA,IAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,aAAA,EAAA,EAAA,CAAA,iBAAA,CAAA,IAAA,EAAA,CAAA,CAAA;;4FAOD,mCAAmC,EAAA,UAAA,EAAA,CAAA;kBAT/C,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,kCAAkC;AAC5C,oBAAA,QAAQ,EAAE,CAAA,CAAE;oBACZ,aAAa,EAAE,iBAAiB,CAAC,IAAI;oBACrC,eAAe,EAAE,uBAAuB,CAAC,MAAM;AAC/C,oBAAA,IAAI,EAAE;AACJ,wBAAA,KAAK,EAAE,kCAAkC;AAC1C,qBAAA;AACF,iBAAA;;;AC7VM,MAAM,iBAAiB,GAAG;IAC/B,wBAAwB;IACxB,uBAAuB;IACvB,wBAAwB;IACxB,wBAAwB;IACxB,mCAAmC;;;MCPxB,uBAAuB,GAAG,CAAC,gBAAA,GAAiE,EAAE,KAAI;AAC7G,IAAA,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,QAAQ,EAAE,sBAAsB,CAAC,gBAAgB,CAAC,EAAE;AAC3F;MAEa,qBAAqB,GAAG,CAA4B,KAAsB,EAAE,IAAY,KACnG,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,GAAG,CAAC,EAAE,KAAK;;ACGnC;;ACZA;;AAEG;;;;"}
|
package/package.json
CHANGED
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ethlete/contentful",
|
|
3
|
-
"version": "4.0.0-next.
|
|
3
|
+
"version": "4.0.0-next.2",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"peerDependencies": {
|
|
7
|
-
"@analogjs/vite-plugin-angular": "2.
|
|
8
|
-
"@angular/cdk": "21.2.
|
|
9
|
-
"@angular/common": "21.2.
|
|
10
|
-
"@angular/core": "21.2.
|
|
11
|
-
"@
|
|
7
|
+
"@analogjs/vite-plugin-angular": "2.5.1",
|
|
8
|
+
"@angular/cdk": "21.2.11",
|
|
9
|
+
"@angular/common": "21.2.13",
|
|
10
|
+
"@angular/core": "21.2.13",
|
|
11
|
+
"@angular/router": "21.2.13",
|
|
12
|
+
"@contentful/rich-text-types": "17.2.7",
|
|
12
13
|
"@ethlete/cdk": "^5.0.0-next.0",
|
|
13
14
|
"@ethlete/core": "^5.0.0-next.0",
|
|
14
15
|
"@ethlete/query": "^6.0.0-next.0",
|
|
15
|
-
"@nx/vite": "22.
|
|
16
|
+
"@nx/vite": "22.7.2",
|
|
16
17
|
"rxjs": "7.8.2",
|
|
17
|
-
"vite": "
|
|
18
|
+
"vite": "8.0.13"
|
|
18
19
|
},
|
|
19
20
|
"module": "fesm2022/ethlete-contentful.mjs",
|
|
20
21
|
"typings": "types/ethlete-contentful.d.ts",
|
|
@@ -27,6 +28,7 @@
|
|
|
27
28
|
"default": "./fesm2022/ethlete-contentful.mjs"
|
|
28
29
|
}
|
|
29
30
|
},
|
|
31
|
+
"type": "module",
|
|
30
32
|
"dependencies": {
|
|
31
33
|
"tslib": "^2.3.0"
|
|
32
34
|
}
|
|
@@ -242,7 +242,8 @@ declare class ContentfulRichTextRendererComponent {
|
|
|
242
242
|
removeClass: (element: HTMLElement, ...classes: string[]) => void;
|
|
243
243
|
toggleClass: (element: HTMLElement, className: string, force?: boolean) => boolean;
|
|
244
244
|
setStyle: (element: HTMLElement, style: Partial<Record<keyof CSSStyleDeclaration, string | null>>, flags?: _angular_core.RendererStyleFlags2) => void;
|
|
245
|
-
removeStyle: (element: HTMLElement,
|
|
245
|
+
removeStyle: (element: HTMLElement, style: keyof CSSStyleDeclaration | string, flags?: _angular_core.RendererStyleFlags2) => void;
|
|
246
|
+
removeStyles: (element: HTMLElement, ...styles: (keyof CSSStyleDeclaration | string)[]) => void;
|
|
246
247
|
setAttribute: (element: HTMLElement, name: string, value: string | null, namespace?: string | null) => void;
|
|
247
248
|
removeAttribute: (element: HTMLElement, ...names: string[]) => void;
|
|
248
249
|
setProperty: (element: HTMLElement, name: string, value: unknown) => void;
|
|
@@ -267,6 +268,11 @@ declare class ContentfulRichTextRendererComponent {
|
|
|
267
268
|
setDataAttributes: (element: HTMLElement, data: Record<string, string | null>) => void;
|
|
268
269
|
setCssProperty: (element: HTMLElement, name: string, value: string | null) => void;
|
|
269
270
|
setCssProperties: (element: HTMLElement, properties: Record<string, string | null>) => void;
|
|
271
|
+
moveBefore: (config: {
|
|
272
|
+
newParent: HTMLElement;
|
|
273
|
+
child: HTMLElement;
|
|
274
|
+
before?: Node | null;
|
|
275
|
+
}) => void;
|
|
270
276
|
renderer: _angular_core.Renderer2;
|
|
271
277
|
};
|
|
272
278
|
_elementRef: ElementRef<HTMLElement>;
|
|
@@ -325,6 +331,11 @@ type ContentfulImageFocusArea = 'top' | 'bottom' | 'left' | 'right' | 'center' |
|
|
|
325
331
|
type ComponentLikeWithAsset = ComponentType<{
|
|
326
332
|
asset: InputSignal<ContentfulRestAsset | ContentfulGqlAsset | null | undefined>;
|
|
327
333
|
}>;
|
|
334
|
+
type ComponentLikeWithLink = ComponentType<{
|
|
335
|
+
href: InputSignal<string>;
|
|
336
|
+
text: InputSignal<string>;
|
|
337
|
+
textClass: InputSignal<string>;
|
|
338
|
+
}>;
|
|
328
339
|
type ComponentLikeWithContentfulRendererInputs = ComponentType<{
|
|
329
340
|
fields?: InputSignal<any>;
|
|
330
341
|
includes?: InputSignal<ContentfulIncludeMap>;
|
|
@@ -336,6 +347,7 @@ type ContentfulAssetComponents = {
|
|
|
336
347
|
image: ComponentLikeWithAsset;
|
|
337
348
|
video: ComponentLikeWithAsset;
|
|
338
349
|
audio: ComponentLikeWithAsset;
|
|
350
|
+
link: ComponentLikeWithLink;
|
|
339
351
|
};
|
|
340
352
|
type ContentfulConfig = {
|
|
341
353
|
/**
|
|
@@ -350,6 +362,15 @@ type ContentfulConfig = {
|
|
|
350
362
|
* Determines if the contentful rich text renderer should render the contentful rich text with tailwind css classes
|
|
351
363
|
*/
|
|
352
364
|
useTailwindClasses: boolean;
|
|
365
|
+
/**
|
|
366
|
+
* Additional hostnames that should be treated as internal links (in addition to the current page's host).
|
|
367
|
+
* Useful when the app runs on localhost during development but Contentful content references the production domain.
|
|
368
|
+
* Comparison is done by primary domain (last two hostname labels), so adding "example.com" is sufficient
|
|
369
|
+
* to also treat "foo.example.com" as internal.
|
|
370
|
+
*
|
|
371
|
+
* @example ['example.com']
|
|
372
|
+
*/
|
|
373
|
+
internalHosts: string[];
|
|
353
374
|
/**
|
|
354
375
|
* Default options for the contentful image api
|
|
355
376
|
*/
|
|
@@ -534,6 +555,20 @@ declare const parseContentfulImageSize: (size: string) => {
|
|
|
534
555
|
};
|
|
535
556
|
declare const generateContentfulImageSources: (data: ContentfulRestAsset | ContentfulGqlAsset, srcsetSizes: string[], backgroundColor: string | null, quality: number | null, focusArea: ContentfulImageFocusArea | null, resizeBehavior: ContentfulImageResizeBehavior | null) => PictureSource[];
|
|
536
557
|
|
|
558
|
+
declare class ContentfulLinkComponent {
|
|
559
|
+
private readonly _document;
|
|
560
|
+
private readonly _config;
|
|
561
|
+
href: _angular_core.InputSignal<string>;
|
|
562
|
+
text: _angular_core.InputSignal<string>;
|
|
563
|
+
textClass: _angular_core.InputSignal<string>;
|
|
564
|
+
isExternal: _angular_core.Signal<boolean>;
|
|
565
|
+
openInNewTab: _angular_core.Signal<boolean>;
|
|
566
|
+
internalPath: _angular_core.Signal<string>;
|
|
567
|
+
linkClass: _angular_core.Signal<string>;
|
|
568
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ContentfulLinkComponent, never>;
|
|
569
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<ContentfulLinkComponent, "et-contentful-link", never, { "href": { "alias": "href"; "required": true; "isSignal": true; }; "text": { "alias": "text"; "required": true; "isSignal": true; }; "textClass": { "alias": "textClass"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
570
|
+
}
|
|
571
|
+
|
|
537
572
|
declare class ContentfulVideoComponent {
|
|
538
573
|
asset: _angular_core.InputSignal<ContentfulGqlAsset | ContentfulRestAsset | null | undefined>;
|
|
539
574
|
videoClass: _angular_core.InputSignal<NgClassType>;
|
|
@@ -557,5 +592,5 @@ declare const provideContentfulConfig: (contentfulConfig?: Partial<ContentfulCon
|
|
|
557
592
|
};
|
|
558
593
|
declare const isContentfulEntryType: <T extends ContentfulEntry>(entry: ContentfulEntry, type: string) => entry is T;
|
|
559
594
|
|
|
560
|
-
export { COMPONENT_RENDER_COMMAND_POSITION, CONTENTFUL_CONFIG, ContentfulAudioComponent, ContentfulFileComponent, ContentfulImageComponent, ContentfulImports, ContentfulRichTextRendererComponent, ContentfulVideoComponent, ET_CONTENTFUL_ANY_ENTRY_CONTENT_TYPE_SYS_ID, GQL_FRAGMENT_CONTENTFUL_ASSET, HTML_CLOSE_RENDER_COMMAND_POSITION, HTML_OPEN_RENDER_COMMAND_POSITION, RENDER_COMMAND_POSITION, RENDER_COMMAND_TYPE, RENDER_INSTRUCTION_POSITION, RENDER_INSTRUCTION_TYPE, TEXT_RENDER_COMMAND_POSITION, createContentfulConfig, createContentfulIncludeMap, generateContentfulImageSources, generateDefaultContentfulImageSource, getRenderCommandId, isComponentRenderCommand, isContentfulEntryType, isContentfulGqlAsset, isExecutedComponentCommandCacheItem, isExecutedHtmlOrTextCommandCacheItem, isExecutedTextCommandCacheItem, isHtmlCloseRenderCommand, isHtmlOpenRenderCommand, isRichTextRootNode, isTextRenderCommand, marksToClass, parseContentfulImageSize, provideContentfulConfig, translateContentfulNodeTypeToHtmlTag };
|
|
561
|
-
export type { ComponentLikeWithAsset, ComponentLikeWithContentfulRendererInputs, ContentfulAssetComponents, ContentfulAssetFileData, ContentfulAssetImageData, ContentfulAssetLink, ContentfulAssetLinkItem, ContentfulCollection, ContentfulConfig, ContentfulContentTypeLink, ContentfulEntry, ContentfulEntryLink, ContentfulEntryLinkItem, ContentfulEntrySys, ContentfulEnvironmentLink, ContentfulGqlAsset, ContentfulGqlCollectionFilterVariables, ContentfulGqlOrder, ContentfulGqlWhereFilter, ContentfulImageFocusArea, ContentfulImageResizeBehavior, ContentfulIncludeMap, ContentfulLink, ContentfulLinkType, ContentfulMetadata, ContentfulRestAsset, ContentfulSpaceLink, ContentfulSys, ContentfulTagLink, ContentfulTagLinkItem, CreateContentfulIncludeMapConfig, RichTextResponse };
|
|
595
|
+
export { COMPONENT_RENDER_COMMAND_POSITION, CONTENTFUL_CONFIG, ContentfulAudioComponent, ContentfulFileComponent, ContentfulImageComponent, ContentfulImports, ContentfulLinkComponent, ContentfulRichTextRendererComponent, ContentfulVideoComponent, ET_CONTENTFUL_ANY_ENTRY_CONTENT_TYPE_SYS_ID, GQL_FRAGMENT_CONTENTFUL_ASSET, HTML_CLOSE_RENDER_COMMAND_POSITION, HTML_OPEN_RENDER_COMMAND_POSITION, RENDER_COMMAND_POSITION, RENDER_COMMAND_TYPE, RENDER_INSTRUCTION_POSITION, RENDER_INSTRUCTION_TYPE, TEXT_RENDER_COMMAND_POSITION, createContentfulConfig, createContentfulIncludeMap, generateContentfulImageSources, generateDefaultContentfulImageSource, getRenderCommandId, isComponentRenderCommand, isContentfulEntryType, isContentfulGqlAsset, isExecutedComponentCommandCacheItem, isExecutedHtmlOrTextCommandCacheItem, isExecutedTextCommandCacheItem, isHtmlCloseRenderCommand, isHtmlOpenRenderCommand, isRichTextRootNode, isTextRenderCommand, marksToClass, parseContentfulImageSize, provideContentfulConfig, translateContentfulNodeTypeToHtmlTag };
|
|
596
|
+
export type { ComponentLikeWithAsset, ComponentLikeWithContentfulRendererInputs, ComponentLikeWithLink, ContentfulAssetComponents, ContentfulAssetFileData, ContentfulAssetImageData, ContentfulAssetLink, ContentfulAssetLinkItem, ContentfulCollection, ContentfulConfig, ContentfulContentTypeLink, ContentfulEntry, ContentfulEntryLink, ContentfulEntryLinkItem, ContentfulEntrySys, ContentfulEnvironmentLink, ContentfulGqlAsset, ContentfulGqlCollectionFilterVariables, ContentfulGqlOrder, ContentfulGqlWhereFilter, ContentfulImageFocusArea, ContentfulImageResizeBehavior, ContentfulIncludeMap, ContentfulLink, ContentfulLinkType, ContentfulMetadata, ContentfulRestAsset, ContentfulSpaceLink, ContentfulSys, ContentfulTagLink, ContentfulTagLinkItem, CreateContentfulIncludeMapConfig, RichTextResponse };
|