@ethlete/contentful 2.1.0 → 2.1.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.
Files changed (55) hide show
  1. package/CHANGELOG.md +216 -0
  2. package/esm2022/index.mjs +11 -2
  3. package/esm2022/lib/components/audio/contentful-audio.component.mjs +20 -16
  4. package/esm2022/lib/components/audio/index.mjs +2 -0
  5. package/esm2022/lib/components/file/contentful-file.component.mjs +18 -14
  6. package/esm2022/lib/components/file/index.mjs +2 -0
  7. package/esm2022/lib/components/image/contentful-image.component.mjs +6 -6
  8. package/esm2022/lib/components/image/contentful-image.component.utils.mjs +1 -1
  9. package/esm2022/lib/components/image/index.mjs +3 -2
  10. package/esm2022/lib/components/rich-text-renderer/index.mjs +5 -2
  11. package/esm2022/lib/components/rich-text-renderer/rich-text-renderer.component.mjs +6 -6
  12. package/esm2022/lib/components/rich-text-renderer/rich-text-renderer.util.mjs +1 -1
  13. package/esm2022/lib/components/video/contentful-video.component.mjs +18 -14
  14. package/esm2022/lib/components/video/index.mjs +2 -0
  15. package/esm2022/lib/constants/index.mjs +2 -2
  16. package/esm2022/lib/contentful.imports.mjs +6 -2
  17. package/esm2022/lib/gql/index.mjs +2 -0
  18. package/esm2022/lib/types/index.mjs +2 -2
  19. package/esm2022/lib/utils/contentful-config.mjs +5 -2
  20. package/esm2022/lib/utils/index.mjs +3 -2
  21. package/fesm2022/ethlete-contentful.mjs +156 -144
  22. package/fesm2022/ethlete-contentful.mjs.map +1 -1
  23. package/index.d.ts +10 -1
  24. package/lib/components/image/index.d.ts +2 -1
  25. package/lib/components/rich-text-renderer/index.d.ts +4 -1
  26. package/lib/components/rich-text-renderer/rich-text-renderer.util.d.ts +1 -1
  27. package/lib/constants/index.d.ts +1 -1
  28. package/lib/contentful.imports.d.ts +5 -1
  29. package/lib/types/index.d.ts +1 -1
  30. package/lib/utils/index.d.ts +2 -1
  31. package/package.json +4 -4
  32. package/esm2022/lib/components/audio/public-api.mjs +0 -2
  33. package/esm2022/lib/components/file/public-api.mjs +0 -2
  34. package/esm2022/lib/components/image/public-api.mjs +0 -3
  35. package/esm2022/lib/components/index.mjs +0 -2
  36. package/esm2022/lib/components/public-api.mjs +0 -6
  37. package/esm2022/lib/components/rich-text-renderer/public-api.mjs +0 -5
  38. package/esm2022/lib/components/video/public-api.mjs +0 -2
  39. package/esm2022/lib/constants/public-api.mjs +0 -2
  40. package/esm2022/lib/gql/public-api.mjs +0 -2
  41. package/esm2022/lib/public-api.mjs +0 -7
  42. package/esm2022/lib/types/public-api.mjs +0 -2
  43. package/esm2022/lib/utils/public-api.mjs +0 -3
  44. package/lib/components/image/public-api.d.ts +0 -2
  45. package/lib/components/index.d.ts +0 -1
  46. package/lib/components/public-api.d.ts +0 -5
  47. package/lib/components/rich-text-renderer/public-api.d.ts +0 -4
  48. package/lib/constants/public-api.d.ts +0 -1
  49. package/lib/public-api.d.ts +0 -6
  50. package/lib/types/public-api.d.ts +0 -1
  51. package/lib/utils/public-api.d.ts +0 -2
  52. /package/lib/components/audio/{public-api.d.ts → index.d.ts} +0 -0
  53. /package/lib/components/file/{public-api.d.ts → index.d.ts} +0 -0
  54. /package/lib/components/video/{public-api.d.ts → index.d.ts} +0 -0
  55. /package/lib/gql/{public-api.d.ts → index.d.ts} +0 -0
@@ -1,6 +1,6 @@
1
- import { NgIf, NgClass, NgOptimizedImage, DOCUMENT } from '@angular/common';
1
+ import { NgClass, NgOptimizedImage, DOCUMENT } from '@angular/common';
2
2
  import * as i0 from '@angular/core';
3
- import { InjectionToken, inject, ChangeDetectorRef, Component, ChangeDetectionStrategy, ViewEncapsulation, Input, Renderer2, ElementRef, ComponentFactoryResolver, ApplicationRef, Injector } from '@angular/core';
3
+ import { InjectionToken, inject, Component, ChangeDetectionStrategy, ViewEncapsulation, Input, ChangeDetectorRef, Renderer2, ElementRef, ComponentFactoryResolver, ApplicationRef, Injector } from '@angular/core';
4
4
  import { DomPortalOutlet, ComponentPortal } from '@angular/cdk/portal';
5
5
  import * as i1 from '@ethlete/cdk';
6
6
  import { PictureDataDirective, PictureComponent } from '@ethlete/cdk';
@@ -9,27 +9,58 @@ import { gql } from '@ethlete/query';
9
9
 
10
10
  const CONTENTFUL_CONFIG = new InjectionToken('ContentfulConfig');
11
11
 
12
- const createContentfulConfig = (config = {}) => ({
13
- // This default config must be inline and not saved inside a const for some weird webpack reason
14
- ...{
15
- useTailwindClasses: false,
16
- components: {
17
- audio: ContentfulAudioComponent,
18
- file: ContentfulFileComponent,
19
- image: ContentfulImageComponent,
20
- video: ContentfulVideoComponent,
21
- },
22
- customComponents: {},
23
- imageOptions: {
24
- srcsetSizes: ['375w', '1280w', '1920w', '2560w'],
25
- sizes: [],
26
- backgroundColor: null,
27
- },
28
- },
29
- ...(config || {}),
30
- });
31
-
32
- const RICH_TEXT_RENDERER_COMPONENT_DATA = new InjectionToken('RICH_TEXT_RENDERER_COMPONENT_DATA');
12
+ class ContentfulFileComponent {
13
+ constructor() {
14
+ this._richTextData = inject(RICH_TEXT_RENDERER_COMPONENT_DATA, { optional: true });
15
+ this._data = null;
16
+ this.fileClass = null;
17
+ }
18
+ get data() {
19
+ return this._data;
20
+ }
21
+ set data(v) {
22
+ if (v && !v.contentType) {
23
+ this._data = null;
24
+ console.warn('The provided asset is invalid', v);
25
+ return;
26
+ }
27
+ this._data = v ?? null;
28
+ }
29
+ ngOnInit() {
30
+ if (this._richTextData && !this.data) {
31
+ this.data = this._richTextData;
32
+ }
33
+ }
34
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.0", ngImport: i0, type: ContentfulFileComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
35
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.0", type: ContentfulFileComponent, isStandalone: true, selector: "et-contentful-file", inputs: { data: "data", fileClass: "fileClass" }, ngImport: i0, template: `
36
+ @if (data) {
37
+ <a [href]="data.url" [ngClass]="fileClass" class="underline" target="_blank">
38
+ {{ data.title }} ({{ data.size }} Bytes)
39
+ </a>
40
+ }
41
+ `, isInline: true, dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
42
+ }
43
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.0", ngImport: i0, type: ContentfulFileComponent, decorators: [{
44
+ type: Component,
45
+ args: [{
46
+ selector: 'et-contentful-file',
47
+ template: `
48
+ @if (data) {
49
+ <a [href]="data.url" [ngClass]="fileClass" class="underline" target="_blank">
50
+ {{ data.title }} ({{ data.size }} Bytes)
51
+ </a>
52
+ }
53
+ `,
54
+ changeDetection: ChangeDetectionStrategy.OnPush,
55
+ encapsulation: ViewEncapsulation.None,
56
+ standalone: true,
57
+ imports: [NgClass],
58
+ }]
59
+ }], propDecorators: { data: [{
60
+ type: Input
61
+ }], fileClass: [{
62
+ type: Input
63
+ }] } });
33
64
 
34
65
  const provideContentfulConfig = (contentfulConfig = {}) => {
35
66
  return { provide: CONTENTFUL_CONFIG, useValue: createContentfulConfig(contentfulConfig) };
@@ -191,8 +222,8 @@ class ContentfulImageComponent {
191
222
  this.sources = this._data ? generateContentfulImageSources(this._data, this.srcsetSizes, this.backgroundColor) : [];
192
223
  this._cdr.markForCheck();
193
224
  }
194
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.1", ngImport: i0, type: ContentfulImageComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
195
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.1", type: ContentfulImageComponent, isStandalone: true, selector: "et-contentful-image", inputs: { data: "data", sizes: "sizes", srcsetSizes: "srcsetSizes", backgroundColor: "backgroundColor" }, host: { classAttribute: "et-contentful-image" }, hostDirectives: [{ directive: i1.PictureDataDirective, inputs: ["imgClass", "imgClass", "hasPriority", "hasPriority", "figureClass", "figureClass", "pictureClass", "pictureClass", "figcaptionClass", "figcaptionClass"] }], ngImport: i0, template: `
225
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.0", ngImport: i0, type: ContentfulImageComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
226
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.0", type: ContentfulImageComponent, isStandalone: true, selector: "et-contentful-image", inputs: { data: "data", sizes: "sizes", srcsetSizes: "srcsetSizes", backgroundColor: "backgroundColor" }, host: { classAttribute: "et-contentful-image" }, hostDirectives: [{ directive: i1.PictureDataDirective, inputs: ["imgClass", "imgClass", "hasPriority", "hasPriority", "figureClass", "figureClass", "pictureClass", "pictureClass", "figcaptionClass", "figcaptionClass"] }], ngImport: i0, template: `
196
227
  <et-picture
197
228
  [imgClass]="pictureData.imgClass"
198
229
  [hasPriority]="pictureData.hasPriority"
@@ -209,7 +240,7 @@ class ContentfulImageComponent {
209
240
  />
210
241
  `, isInline: true, dependencies: [{ kind: "component", type: PictureComponent, selector: "et-picture", inputs: ["sources"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
211
242
  }
212
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.1", ngImport: i0, type: ContentfulImageComponent, decorators: [{
243
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.0", ngImport: i0, type: ContentfulImageComponent, decorators: [{
213
244
  type: Component,
214
245
  args: [{
215
246
  selector: 'et-contentful-image',
@@ -232,7 +263,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.1", ngImpor
232
263
  changeDetection: ChangeDetectionStrategy.OnPush,
233
264
  encapsulation: ViewEncapsulation.None,
234
265
  standalone: true,
235
- imports: [NgIf, NgClass, NgOptimizedImage, PictureComponent],
266
+ imports: [NgClass, NgOptimizedImage, PictureComponent],
236
267
  hostDirectives: [
237
268
  {
238
269
  directive: PictureDataDirective,
@@ -254,6 +285,84 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.1", ngImpor
254
285
  type: Input
255
286
  }] } });
256
287
 
288
+ class ContentfulVideoComponent {
289
+ constructor() {
290
+ this._richTextData = inject(RICH_TEXT_RENDERER_COMPONENT_DATA, { optional: true });
291
+ this._data = null;
292
+ this.videoClass = null;
293
+ }
294
+ get data() {
295
+ return this._data;
296
+ }
297
+ set data(v) {
298
+ if (v && !v.contentType) {
299
+ this._data = null;
300
+ console.warn('The provided asset is invalid', v);
301
+ return;
302
+ }
303
+ if (v && !v.contentType.startsWith('video/')) {
304
+ throw new Error('The provided asset is not an video');
305
+ }
306
+ this._data = v ?? null;
307
+ }
308
+ ngOnInit() {
309
+ if (this._richTextData && !this.data) {
310
+ this.data = this._richTextData;
311
+ }
312
+ }
313
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.0", ngImport: i0, type: ContentfulVideoComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
314
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.0", type: ContentfulVideoComponent, isStandalone: true, selector: "et-contentful-video", inputs: { data: "data", videoClass: "videoClass" }, ngImport: i0, template: `
315
+ @if (data) {
316
+ <video [ngClass]="videoClass" controls>
317
+ <source src="{{ data.url }}" type="{{ data.contentType }}" />
318
+ </video>
319
+ }
320
+ `, isInline: true, dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
321
+ }
322
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.0", ngImport: i0, type: ContentfulVideoComponent, decorators: [{
323
+ type: Component,
324
+ args: [{
325
+ selector: 'et-contentful-video',
326
+ template: `
327
+ @if (data) {
328
+ <video [ngClass]="videoClass" controls>
329
+ <source src="{{ data.url }}" type="{{ data.contentType }}" />
330
+ </video>
331
+ }
332
+ `,
333
+ changeDetection: ChangeDetectionStrategy.OnPush,
334
+ encapsulation: ViewEncapsulation.None,
335
+ standalone: true,
336
+ imports: [NgClass],
337
+ }]
338
+ }], propDecorators: { data: [{
339
+ type: Input
340
+ }], videoClass: [{
341
+ type: Input
342
+ }] } });
343
+
344
+ const createContentfulConfig = (config = {}) => ({
345
+ // This default config must be inline and not saved inside a const for some weird webpack reason
346
+ ...{
347
+ useTailwindClasses: false,
348
+ components: {
349
+ audio: ContentfulAudioComponent,
350
+ file: ContentfulFileComponent,
351
+ image: ContentfulImageComponent,
352
+ video: ContentfulVideoComponent,
353
+ },
354
+ customComponents: {},
355
+ imageOptions: {
356
+ srcsetSizes: ['375w', '1280w', '1920w', '2560w'],
357
+ sizes: [],
358
+ backgroundColor: null,
359
+ },
360
+ },
361
+ ...(config || {}),
362
+ });
363
+
364
+ const RICH_TEXT_RENDERER_COMPONENT_DATA = new InjectionToken('RICH_TEXT_RENDERER_COMPONENT_DATA');
365
+
257
366
  const createRenderCommandsFromContentfulRichText = (options) => {
258
367
  const { data, config } = options;
259
368
  const commands = [];
@@ -526,10 +635,10 @@ class ContentfulRichTextRendererComponent {
526
635
  this._executeCommand({ command: childCommand, parent: element ?? parent });
527
636
  }
528
637
  }
529
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.1", ngImport: i0, type: ContentfulRichTextRendererComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
530
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.1", type: ContentfulRichTextRendererComponent, isStandalone: true, selector: "et-contentful-rich-text-renderer", inputs: { richText: "richText" }, host: { classAttribute: "et-contentful-rich-text-renderer" }, ngImport: i0, template: ``, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
638
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.0", ngImport: i0, type: ContentfulRichTextRendererComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
639
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.0", type: ContentfulRichTextRendererComponent, isStandalone: true, selector: "et-contentful-rich-text-renderer", inputs: { richText: "richText" }, host: { classAttribute: "et-contentful-rich-text-renderer" }, ngImport: i0, template: ``, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
531
640
  }
532
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.1", ngImport: i0, type: ContentfulRichTextRendererComponent, decorators: [{
641
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.0", ngImport: i0, type: ContentfulRichTextRendererComponent, decorators: [{
533
642
  type: Component,
534
643
  args: [{
535
644
  selector: 'et-contentful-rich-text-renderer',
@@ -572,28 +681,32 @@ class ContentfulAudioComponent {
572
681
  this.data = this._richTextData;
573
682
  }
574
683
  }
575
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.1", ngImport: i0, type: ContentfulAudioComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
576
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.1", type: ContentfulAudioComponent, isStandalone: true, selector: "et-contentful-audio", inputs: { data: "data", audioClass: "audioClass", figureClass: "figureClass", figcaptionClass: "figcaptionClass" }, ngImport: i0, template: `
577
- <figure *ngIf="data" [ngClass]="figureClass">
578
- <figcaption [ngClass]="figcaptionClass">{{ data.title }}</figcaption>
579
- <audio [ngClass]="audioClass" controls src="{{ data.url }}"></audio>
580
- </figure>
581
- `, isInline: true, dependencies: [{ kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
684
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.0", ngImport: i0, type: ContentfulAudioComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
685
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.0", type: ContentfulAudioComponent, isStandalone: true, selector: "et-contentful-audio", inputs: { data: "data", audioClass: "audioClass", figureClass: "figureClass", figcaptionClass: "figcaptionClass" }, ngImport: i0, template: `
686
+ @if (data) {
687
+ <figure [ngClass]="figureClass">
688
+ <figcaption [ngClass]="figcaptionClass">{{ data.title }}</figcaption>
689
+ <audio [ngClass]="audioClass" controls src="{{ data.url }}"></audio>
690
+ </figure>
691
+ }
692
+ `, isInline: true, dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
582
693
  }
583
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.1", ngImport: i0, type: ContentfulAudioComponent, decorators: [{
694
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.0", ngImport: i0, type: ContentfulAudioComponent, decorators: [{
584
695
  type: Component,
585
696
  args: [{
586
697
  selector: 'et-contentful-audio',
587
698
  template: `
588
- <figure *ngIf="data" [ngClass]="figureClass">
589
- <figcaption [ngClass]="figcaptionClass">{{ data.title }}</figcaption>
590
- <audio [ngClass]="audioClass" controls src="{{ data.url }}"></audio>
591
- </figure>
699
+ @if (data) {
700
+ <figure [ngClass]="figureClass">
701
+ <figcaption [ngClass]="figcaptionClass">{{ data.title }}</figcaption>
702
+ <audio [ngClass]="audioClass" controls src="{{ data.url }}"></audio>
703
+ </figure>
704
+ }
592
705
  `,
593
706
  changeDetection: ChangeDetectionStrategy.OnPush,
594
707
  encapsulation: ViewEncapsulation.None,
595
708
  standalone: true,
596
- imports: [NgIf, NgClass],
709
+ imports: [NgClass],
597
710
  }]
598
711
  }], propDecorators: { data: [{
599
712
  type: Input
@@ -605,107 +718,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.1", ngImpor
605
718
  type: Input
606
719
  }] } });
607
720
 
608
- class ContentfulFileComponent {
609
- constructor() {
610
- this._richTextData = inject(RICH_TEXT_RENDERER_COMPONENT_DATA, { optional: true });
611
- this._data = null;
612
- this.fileClass = null;
613
- }
614
- get data() {
615
- return this._data;
616
- }
617
- set data(v) {
618
- if (v && !v.contentType) {
619
- this._data = null;
620
- console.warn('The provided asset is invalid', v);
621
- return;
622
- }
623
- this._data = v ?? null;
624
- }
625
- ngOnInit() {
626
- if (this._richTextData && !this.data) {
627
- this.data = this._richTextData;
628
- }
629
- }
630
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.1", ngImport: i0, type: ContentfulFileComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
631
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.1", type: ContentfulFileComponent, isStandalone: true, selector: "et-contentful-file", inputs: { data: "data", fileClass: "fileClass" }, ngImport: i0, template: `
632
- <a *ngIf="data" [href]="data.url" [ngClass]="fileClass" class="underline" target="_blank">
633
- {{ data.title }} ({{ data.size }} Bytes)
634
- </a>
635
- `, isInline: true, dependencies: [{ kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
636
- }
637
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.1", ngImport: i0, type: ContentfulFileComponent, decorators: [{
638
- type: Component,
639
- args: [{
640
- selector: 'et-contentful-file',
641
- template: `
642
- <a *ngIf="data" [href]="data.url" [ngClass]="fileClass" class="underline" target="_blank">
643
- {{ data.title }} ({{ data.size }} Bytes)
644
- </a>
645
- `,
646
- changeDetection: ChangeDetectionStrategy.OnPush,
647
- encapsulation: ViewEncapsulation.None,
648
- standalone: true,
649
- imports: [NgIf, NgClass],
650
- }]
651
- }], propDecorators: { data: [{
652
- type: Input
653
- }], fileClass: [{
654
- type: Input
655
- }] } });
656
-
657
- class ContentfulVideoComponent {
658
- constructor() {
659
- this._richTextData = inject(RICH_TEXT_RENDERER_COMPONENT_DATA, { optional: true });
660
- this._data = null;
661
- this.videoClass = null;
662
- }
663
- get data() {
664
- return this._data;
665
- }
666
- set data(v) {
667
- if (v && !v.contentType) {
668
- this._data = null;
669
- console.warn('The provided asset is invalid', v);
670
- return;
671
- }
672
- if (v && !v.contentType.startsWith('video/')) {
673
- throw new Error('The provided asset is not an video');
674
- }
675
- this._data = v ?? null;
676
- }
677
- ngOnInit() {
678
- if (this._richTextData && !this.data) {
679
- this.data = this._richTextData;
680
- }
681
- }
682
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.1", ngImport: i0, type: ContentfulVideoComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
683
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.1", type: ContentfulVideoComponent, isStandalone: true, selector: "et-contentful-video", inputs: { data: "data", videoClass: "videoClass" }, ngImport: i0, template: `
684
- <video *ngIf="data" [ngClass]="videoClass" controls>
685
- <source src="{{ data.url }}" type="{{ data.contentType }}" />
686
- </video>
687
- `, isInline: true, dependencies: [{ kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
688
- }
689
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.1", ngImport: i0, type: ContentfulVideoComponent, decorators: [{
690
- type: Component,
691
- args: [{
692
- selector: 'et-contentful-video',
693
- template: `
694
- <video *ngIf="data" [ngClass]="videoClass" controls>
695
- <source src="{{ data.url }}" type="{{ data.contentType }}" />
696
- </video>
697
- `,
698
- changeDetection: ChangeDetectionStrategy.OnPush,
699
- encapsulation: ViewEncapsulation.None,
700
- standalone: true,
701
- imports: [NgIf, NgClass],
702
- }]
703
- }], propDecorators: { data: [{
704
- type: Input
705
- }], videoClass: [{
706
- type: Input
707
- }] } });
708
-
709
721
  const ContentfulImports = [
710
722
  ContentfulAudioComponent,
711
723
  ContentfulFileComponent,
@@ -1 +1 @@
1
- {"version":3,"file":"ethlete-contentful.mjs","sources":["../../../../libs/contentful/src/lib/constants/contentful.constants.ts","../../../../libs/contentful/src/lib/utils/contentful-config.ts","../../../../libs/contentful/src/lib/components/rich-text-renderer/rich-text-renderer.constants.ts","../../../../libs/contentful/src/lib/utils/contentful.util.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/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/components/audio/contentful-audio.component.ts","../../../../libs/contentful/src/lib/components/file/contentful-file.component.ts","../../../../libs/contentful/src/lib/components/video/contentful-video.component.ts","../../../../libs/contentful/src/lib/contentful.imports.ts","../../../../libs/contentful/src/lib/gql/asset.fragments.ts","../../../../libs/contentful/src/ethlete-contentful.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\n\nimport { ContentfulConfig } from '../types';\n\nexport const CONTENTFUL_CONFIG = new InjectionToken<ContentfulConfig>('ContentfulConfig');\n","import {\n ContentfulAudioComponent,\n ContentfulFileComponent,\n ContentfulImageComponent,\n ContentfulVideoComponent,\n} from '../components';\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 { InjectionToken } from '@angular/core';\n\nexport const RICH_TEXT_RENDERER_COMPONENT_DATA = new InjectionToken<unknown>('RICH_TEXT_RENDERER_COMPONENT_DATA');\n","import { CONTENTFUL_CONFIG } from '../constants';\nimport { ContentfulAsset, ContentfulConfig, ContentfulImage } 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 isContentfulImage = (v: ContentfulAsset | ContentfulImage | null | undefined): v is ContentfulImage => {\n return !!v && 'asset' in v && 'alt' in v && 'resizeBehavior' in v && 'focusArea' in v;\n};\n\nexport const isContentfulAsset = (v: ContentfulAsset | ContentfulImage | null | undefined): v is ContentfulAsset => {\n return !!v && 'contentType' in v && 'description' in v && 'height' in v && 'url' in v && 'width' in v;\n};\n","import { PictureSource } from '@ethlete/cdk';\nimport { ContentfulAsset, ContentfulImage } from '../../types';\nimport { isContentfulImage } from '../../utils';\n\nexport const generateDefaultContentfulImageSource = (data: ContentfulAsset): PictureSource => {\n const { url, contentType } = data;\n\n return {\n type: contentType,\n srcset: 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: ContentfulAsset | ContentfulImage,\n srcsetSizes: string[],\n backgroundColor: string | null,\n): PictureSource[] => {\n const assetData = isContentfulImage(data) ? data.asset : data;\n const imageData = isContentfulImage(data) ? data : null;\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 = assetData.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 (imageData) {\n if (imageData.quality) {\n queryParams.push(`q=${imageData.quality}`);\n }\n\n if (imageData.focusArea) {\n queryParams.push(`f=${imageData.focusArea}`);\n }\n\n if (imageData.resizeBehavior) {\n queryParams.push(`fit=${imageData.resizeBehavior}`);\n }\n }\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 { NgClass, NgIf, NgOptimizedImage } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n Input,\n OnInit,\n ViewEncapsulation,\n inject,\n} from '@angular/core';\nimport { PictureComponent, PictureDataDirective, PictureSource } from '@ethlete/cdk';\nimport { ContentfulAsset, ContentfulImage } from '../../types';\nimport { isContentfulImage } from '../../utils';\nimport { RICH_TEXT_RENDERER_COMPONENT_DATA } from '../rich-text-renderer';\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]=\"pictureData.imgClass\"\n [hasPriority]=\"pictureData.hasPriority\"\n [figureClass]=\"pictureData.figureClass\"\n [pictureClass]=\"pictureData.pictureClass\"\n [figcaptionClass]=\"pictureData.figcaptionClass\"\n [defaultSrc]=\"pictureData.defaultSrc\"\n [alt]=\"pictureData.alt\"\n [figcaption]=\"pictureData.figcaption\"\n [width]=\"pictureData.width\"\n [height]=\"pictureData.height\"\n [sizes]=\"pictureData.sizes\"\n [sources]=\"sources\"\n />\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n standalone: true,\n imports: [NgIf, NgClass, NgOptimizedImage, PictureComponent],\n hostDirectives: [\n {\n directive: PictureDataDirective,\n // eslint-disable-next-line @angular-eslint/no-inputs-metadata-property\n inputs: ['imgClass', 'hasPriority', 'figureClass', 'pictureClass', 'figcaptionClass'],\n },\n ],\n host: {\n class: 'et-contentful-image',\n },\n})\nexport class ContentfulImageComponent implements OnInit {\n private _richTextData = inject<ContentfulAsset | ContentfulImage>(RICH_TEXT_RENDERER_COMPONENT_DATA, {\n optional: true,\n });\n\n protected readonly pictureData = inject(PictureDataDirective);\n readonly _cdr = inject(ChangeDetectorRef);\n\n @Input()\n get data() {\n return this._data;\n }\n set data(v: ContentfulAsset | ContentfulImage | null | undefined) {\n const assetData = isContentfulImage(v) ? v.asset : v;\n const imageData = isContentfulImage(v) ? v : null;\n\n if (assetData && !assetData.contentType) {\n this._data = null;\n\n console.warn('The provided asset is invalid', v);\n\n return;\n }\n\n if (assetData && !assetData.contentType.startsWith('image/')) {\n throw new Error('The provided asset is not an image');\n }\n\n this._data = v ?? null;\n this.pictureData.defaultSrc = assetData ? generateDefaultContentfulImageSource(assetData) : null;\n this.pictureData.alt = imageData?.alt ?? assetData?.description ?? null;\n this.pictureData.width = assetData?.width ?? null;\n this.pictureData.height = assetData?.height ?? null;\n this.pictureData.figcaption = imageData?.caption ?? null;\n\n this.updateSizes();\n }\n private _data: ContentfulAsset | ContentfulImage | null = null;\n\n @Input()\n get sizes(): string[] {\n return this._sizes;\n }\n set sizes(v: string[]) {\n this._sizes = v;\n this.pictureData.sizes = this.sizes?.join(', ') ?? null;\n }\n private _sizes: string[] = [];\n\n @Input()\n get srcsetSizes(): string[] {\n return this._srcsetSizes;\n }\n set srcsetSizes(v: string[]) {\n this._srcsetSizes = v;\n this.updateSizes();\n }\n private _srcsetSizes: string[] = [];\n\n @Input()\n get backgroundColor() {\n return this._backgroundColor;\n }\n set backgroundColor(v: string | null) {\n this._backgroundColor = v;\n this.updateSizes();\n }\n private _backgroundColor: string | null = null;\n\n protected sources: PictureSource[] = [];\n\n ngOnInit(): void {\n if (this._richTextData && !this.data) {\n this.data = this._richTextData;\n }\n }\n\n private updateSizes() {\n this.sources = this._data ? generateContentfulImageSources(this._data, this.srcsetSizes, this.backgroundColor) : [];\n\n this._cdr.markForCheck();\n }\n}\n","import { Block, BLOCKS, Inline, INLINES, Mark, Text } from '@contentful/rich-text-types';\nimport { ContentfulAsset, ContentfulConfig, ContentfulEntryBase, RichTextResponse } from '../../types';\nimport { ContentfulImageComponent } from '../image';\nimport { ContentfulResourceMap, RichTextRenderCommand } from './rich-text-renderer.types';\n\nexport const createRenderCommandsFromContentfulRichText = (options: {\n data: RichTextResponse;\n config: ContentfulConfig;\n}) => {\n const { data, config } = options;\n\n const commands: RichTextRenderCommand[] = [];\n const resourceMap = createContentfulResourceMap(data.links);\n\n createContentfulRenderCommand(data.json, { children: commands, payload: data.json.nodeType }, resourceMap, config);\n\n return commands;\n};\n\nexport const createContentfulRenderCommand = (\n node: Block | Inline | Text,\n parent: RichTextRenderCommand,\n resourceMap: ContentfulResourceMap,\n config: ContentfulConfig,\n) => {\n const { nodeType, data: nodeData } = node;\n\n const { children, marks, value } = getContentfulNodeProps(node);\n\n const command: RichTextRenderCommand = {\n payload: translateContentfulNodeTypeToHtmlTag(nodeType),\n data: value,\n attributes: {\n ...(marks\n ? {\n class: transformContentfulMarks(marks, config.useTailwindClasses),\n }\n : {}),\n ...(nodeData['uri'] ? { href: nodeData['uri'], target: '_blank' } : {}),\n },\n children: [],\n };\n\n const entryId = nodeData['target']?.sys?.id;\n\n if (nodeType === BLOCKS.EMBEDDED_ASSET) {\n const asset = resourceMap.assetsBlock.get(entryId);\n\n if (asset) {\n const isImage = asset.contentType.startsWith('image/');\n const isVideo = asset.contentType.startsWith('video/');\n const isAudio = asset.contentType.startsWith('audio/');\n\n command.data = asset;\n\n if (isImage) {\n command.payload = config.components.image;\n } else if (isVideo) {\n command.payload = config.components.video;\n } else if (isAudio) {\n command.payload = config.components.audio;\n } else {\n command.payload = config.components.file;\n }\n } else {\n console.warn(`No asset found for entry id \"${entryId}\"!`, nodeData);\n }\n } else if (nodeType === BLOCKS.EMBEDDED_ENTRY || nodeType === INLINES.EMBEDDED_ENTRY) {\n const entry = resourceMap.entriesBlock.get(entryId) ?? resourceMap.entriesInline.get(entryId);\n\n if (entry) {\n const type = entry?.__typename ?? 'ET_UNKNOWN';\n\n // \"Image\" is a special wrapper content model for contentful assets.\n // It must be created by the user.\n const component = type === 'Image' ? ContentfulImageComponent : config.customComponents?.[type];\n\n if (component) {\n command.payload = component;\n command.data = entry;\n } else {\n command.data = `ERROR: No component found for embedded entry \"${type}\" as \"${nodeType}\"!`;\n }\n } else {\n console.warn(`No entry found for entry id \"${entryId}\"!`, nodeData);\n }\n }\n\n if (children && (children.length !== 1 || children[0]?.nodeType !== 'text')) {\n children.forEach((child) => {\n createContentfulRenderCommand(child, command, resourceMap, config);\n });\n }\n\n parent.children.push(command);\n\n return command;\n};\n\nexport const getContentfulNodeProps = (node: Block | Inline | Text) => {\n const children = 'content' in node ? node.content : null;\n let marks: Mark[] | null = null;\n let value: string | null = null;\n\n if (children && children.length === 1 && children[0]?.nodeType === 'text') {\n marks = children[0].marks?.length ? children[0].marks : null;\n value = children[0].value;\n } else {\n marks = 'marks' in node ? (node.marks?.length ? node.marks : null) : null;\n value = 'value' in node ? node.value : null;\n }\n\n return {\n children,\n marks,\n value,\n };\n};\n\nexport const transformContentfulMarks = (marks: Mark[], useTailwindClasses: boolean) => {\n return marks\n .map((mark) => {\n switch (mark.type) {\n case 'bold':\n return useTailwindClasses ? 'font-bold' : mark.type;\n case 'italic':\n return useTailwindClasses ? 'italic' : mark.type;\n case 'underline':\n return useTailwindClasses ? 'underline' : mark.type;\n case 'code':\n return useTailwindClasses ? 'font-mono' : mark.type;\n default:\n return mark.type;\n }\n })\n .join(' ');\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 'document';\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\nexport const createContentfulResourceMap = (links: RichTextResponse['links']): ContentfulResourceMap => {\n const resourceMap = {\n assetsBlock: createContentfulMap<ContentfulAsset>(links?.assets?.block),\n entriesInline: createContentfulMap(links?.entries?.inline),\n entriesBlock: createContentfulMap(links?.entries?.block),\n } as const;\n\n return resourceMap;\n};\n\nexport const createContentfulMap = <T extends ContentfulEntryBase>(links: Array<T> | null | undefined) => {\n const assetMap = new Map<string, T>();\n\n if (links) {\n for (const link of links) {\n if (!link?.sys?.id) {\n console.warn('Link has no sys.id property. Please include it inside your query.', link);\n continue;\n }\n\n assetMap.set(link.sys.id, link);\n }\n }\n\n return assetMap;\n};\n","import { ComponentPortal, DomPortalOutlet } from '@angular/cdk/portal';\nimport { DOCUMENT } from '@angular/common';\nimport {\n ApplicationRef,\n ChangeDetectionStrategy,\n Component,\n ComponentFactoryResolver,\n ElementRef,\n inject,\n Injector,\n Input,\n Renderer2,\n ViewEncapsulation,\n} from '@angular/core';\nimport { ContentfulImageComponent } from '..';\nimport { CONTENTFUL_CONFIG } from '../../constants/contentful.constants';\nimport { RichTextResponse } from '../../types';\nimport { createContentfulConfig } from '../../utils/contentful-config';\nimport { RICH_TEXT_RENDERER_COMPONENT_DATA } from './rich-text-renderer.constants';\nimport { RichTextRenderCommand } from './rich-text-renderer.types';\nimport { createRenderCommandsFromContentfulRichText } from './rich-text-renderer.util';\n\n@Component({\n selector: 'et-contentful-rich-text-renderer',\n template: ``,\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true,\n host: {\n class: 'et-contentful-rich-text-renderer',\n },\n})\nexport class ContentfulRichTextRendererComponent {\n @Input()\n get richText() {\n return this._richText;\n }\n set richText(v: RichTextResponse | null | undefined) {\n this._richText = v ?? null;\n\n this.resetAndRender();\n }\n private _richText: RichTextResponse | null = null;\n\n private _renderer = inject(Renderer2);\n private _elementRef = inject(ElementRef);\n private _componentFactoryResolver = inject(ComponentFactoryResolver);\n private _document = inject<Document>(DOCUMENT);\n private _appRef = inject(ApplicationRef);\n private _injector = inject(Injector);\n private _config = inject(CONTENTFUL_CONFIG, { optional: true }) ?? createContentfulConfig();\n\n resetAndRender() {\n // clear childNodes to prevent appending new richtext elements to existing one\n const childElements = this._elementRef.nativeElement.childNodes;\n for (const child of childElements) {\n this._renderer.removeChild(this._elementRef.nativeElement, child);\n }\n\n if (!this._richText) {\n return;\n }\n\n const commands = createRenderCommandsFromContentfulRichText({ data: this._richText, config: this._config });\n\n this._render(commands);\n }\n\n private _render(commands: RichTextRenderCommand[]) {\n // create a document fragment to hold the elements while we create them\n const fragment = document.createDocumentFragment();\n\n const hostCommand: RichTextRenderCommand = {\n payload: 'document',\n children: commands,\n };\n\n // loop over the commands\n this._executeCommand({ command: hostCommand, parent: fragment });\n\n // append the fragment to the host element\n this._renderer.appendChild(this._elementRef.nativeElement, fragment);\n }\n\n private _executeCommand(data: { command: RichTextRenderCommand; parent: Element | DocumentFragment }) {\n const { command, parent } = data;\n\n let element: Element | null = null;\n if (command.payload !== 'document') {\n if (typeof command.payload === 'string') {\n element = this._renderer.createElement(command.payload);\n\n if (command.data) {\n this._renderer.setProperty(element, 'innerText', command.data);\n }\n\n if (command.attributes) {\n for (const [name, value] of Object.entries(command.attributes)) {\n this._renderer.setAttribute(element, name, value);\n }\n }\n this._renderer.appendChild(parent, element);\n } else {\n const injector = Injector.create({\n providers: [\n {\n provide: RICH_TEXT_RENDERER_COMPONENT_DATA,\n useValue: command.data,\n },\n ],\n parent: this._injector,\n });\n\n const portal = new DomPortalOutlet(\n parent as Element,\n this._componentFactoryResolver,\n this._appRef,\n injector,\n this._document,\n );\n\n const comp = new ComponentPortal(command.payload);\n const ref = comp.attach(portal);\n\n if (ref.instance instanceof ContentfulImageComponent) {\n ref.instance.sizes = this._config.imageOptions.sizes;\n ref.instance.srcsetSizes = this._config.imageOptions.srcsetSizes;\n ref.instance.backgroundColor = this._config.imageOptions.backgroundColor;\n }\n\n element = ref.location.nativeElement;\n }\n }\n\n // loop over the commands\n for (const childCommand of command.children) {\n this._executeCommand({ command: childCommand, parent: element ?? parent });\n }\n }\n}\n","import { NgClass, NgIf } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, inject, Input, OnInit, ViewEncapsulation } from '@angular/core';\nimport { NgClassType } from '@ethlete/core';\nimport { ContentfulAsset } from '../../types';\nimport { RICH_TEXT_RENDERER_COMPONENT_DATA } from '../rich-text-renderer';\n\n@Component({\n selector: 'et-contentful-audio',\n template: `\n <figure *ngIf=\"data\" [ngClass]=\"figureClass\">\n <figcaption [ngClass]=\"figcaptionClass\">{{ data.title }}</figcaption>\n <audio [ngClass]=\"audioClass\" controls src=\"{{ data.url }}\"></audio>\n </figure>\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n standalone: true,\n imports: [NgIf, NgClass],\n})\nexport class ContentfulAudioComponent implements OnInit {\n private _richTextData = inject<ContentfulAsset>(RICH_TEXT_RENDERER_COMPONENT_DATA, { optional: true });\n\n @Input()\n get data() {\n return this._data;\n }\n set data(v: ContentfulAsset | null | undefined) {\n if (v && !v.contentType) {\n this._data = null;\n\n console.warn('The provided asset is invalid', v);\n\n return;\n }\n\n if (v && !v.contentType.startsWith('audio/')) {\n throw new Error('The provided asset is not an audio');\n }\n\n this._data = v ?? null;\n }\n private _data: ContentfulAsset | null = null;\n\n @Input()\n audioClass: NgClassType = null;\n\n @Input()\n figureClass: NgClassType = null;\n\n @Input()\n figcaptionClass: NgClassType = null;\n\n ngOnInit(): void {\n if (this._richTextData && !this.data) {\n this.data = this._richTextData;\n }\n }\n}\n","import { NgClass, NgIf } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, inject, Input, OnInit, ViewEncapsulation } from '@angular/core';\nimport { NgClassType } from '@ethlete/core';\nimport { ContentfulAsset } from '../../types';\nimport { RICH_TEXT_RENDERER_COMPONENT_DATA } from '../rich-text-renderer';\n\n@Component({\n selector: 'et-contentful-file',\n template: `\n <a *ngIf=\"data\" [href]=\"data.url\" [ngClass]=\"fileClass\" class=\"underline\" target=\"_blank\">\n {{ data.title }} ({{ data.size }} Bytes)\n </a>\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n standalone: true,\n imports: [NgIf, NgClass],\n})\nexport class ContentfulFileComponent implements OnInit {\n private _richTextData = inject<ContentfulAsset>(RICH_TEXT_RENDERER_COMPONENT_DATA, { optional: true });\n\n @Input()\n get data() {\n return this._data;\n }\n set data(v: ContentfulAsset | null | undefined) {\n if (v && !v.contentType) {\n this._data = null;\n\n console.warn('The provided asset is invalid', v);\n\n return;\n }\n\n this._data = v ?? null;\n }\n private _data: ContentfulAsset | null = null;\n\n @Input()\n fileClass: NgClassType = null;\n\n ngOnInit(): void {\n if (this._richTextData && !this.data) {\n this.data = this._richTextData;\n }\n }\n}\n","import { NgClass, NgIf } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, inject, Input, OnInit, ViewEncapsulation } from '@angular/core';\nimport { NgClassType } from '@ethlete/core';\nimport { ContentfulAsset } from '../../types';\nimport { RICH_TEXT_RENDERER_COMPONENT_DATA } from '../rich-text-renderer';\n\n@Component({\n selector: 'et-contentful-video',\n template: `\n <video *ngIf=\"data\" [ngClass]=\"videoClass\" controls>\n <source src=\"{{ data.url }}\" type=\"{{ data.contentType }}\" />\n </video>\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n standalone: true,\n imports: [NgIf, NgClass],\n})\nexport class ContentfulVideoComponent implements OnInit {\n private _richTextData = inject<ContentfulAsset>(RICH_TEXT_RENDERER_COMPONENT_DATA, { optional: true });\n\n @Input()\n get data() {\n return this._data;\n }\n set data(v: ContentfulAsset | null | undefined) {\n if (v && !v.contentType) {\n this._data = null;\n\n console.warn('The provided asset is invalid', v);\n\n return;\n }\n\n if (v && !v.contentType.startsWith('video/')) {\n throw new Error('The provided asset is not an video');\n }\n\n this._data = v ?? null;\n }\n private _data: ContentfulAsset | null = null;\n\n @Input()\n videoClass: NgClassType = null;\n\n ngOnInit(): void {\n if (this._richTextData && !this.data) {\n this.data = this._richTextData;\n }\n }\n}\n","import {\n ContentfulAudioComponent,\n ContentfulFileComponent,\n ContentfulImageComponent,\n ContentfulRichTextRendererComponent,\n ContentfulVideoComponent,\n} from './public-api';\n\nexport const ContentfulImports = [\n ContentfulAudioComponent,\n ContentfulFileComponent,\n ContentfulImageComponent,\n ContentfulVideoComponent,\n ContentfulRichTextRendererComponent,\n] as const;\n","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 const GQL_FRAGMENT_CONTENTFUL_IMAGE = gql`\n fragment ImageData on Image {\n sys {\n id\n }\n asset {\n ...AssetData\n }\n alt\n caption\n resizeBehavior\n focusArea\n quality\n __typename\n }\n`;\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;MAIa,iBAAiB,GAAG,IAAI,cAAc,CAAmB,kBAAkB;;ACI3E,MAAA,sBAAsB,GAAG,CACpC,SAAuD,EAAE,MACnC;;IAEtB,GAAG;AACD,QAAA,kBAAkB,EAAE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EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,aAAA,EAAA,EAAA,CAAA,iBAAA,CAAA,IAAA,EAAA,CAAA,CAAA,EAAA;;2FAEZ,wBAAwB,EAAA,UAAA,EAAA,CAAA;kBAZpC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,qBAAqB;AAC/B,oBAAA,QAAQ,EAAE,CAAA;;;;AAIT,EAAA,CAAA;oBACD,eAAe,EAAE,uBAAuB,CAAC,MAAM;oBAC/C,aAAa,EAAE,iBAAiB,CAAC,IAAI;AACrC,oBAAA,UAAU,EAAE,IAAI;AAChB,oBAAA,OAAO,EAAE,CAAC,IAAI,EAAE,OAAO,CAAC;AACzB,iBAAA,CAAA;8BAKK,IAAI,EAAA,CAAA;sBADP,KAAK;gBAsBN,UAAU,EAAA,CAAA;sBADT,KAAK;;;AClCK,MAAA,iBAAiB,GAAG;IAC/B,wBAAwB;IACxB,uBAAuB;IACvB,wBAAwB;IACxB,wBAAwB;IACxB,mCAAmC;;;ACX9B,MAAM,6BAA6B,GAAG,GAAG,CAAA,CAAA;;;;;;;;;;;;;EAa9C;AAEK,MAAM,6BAA6B,GAAG,GAAG,CAAA,CAAA;;;;;;;;;;;;;;;;;ACjBhD;;AAEG;;;;"}
1
+ {"version":3,"file":"ethlete-contentful.mjs","sources":["../../../../libs/contentful/src/lib/constants/contentful.constants.ts","../../../../libs/contentful/src/lib/components/file/contentful-file.component.ts","../../../../libs/contentful/src/lib/utils/contentful.util.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.constants.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/components/audio/contentful-audio.component.ts","../../../../libs/contentful/src/lib/contentful.imports.ts","../../../../libs/contentful/src/lib/gql/asset.fragments.ts","../../../../libs/contentful/src/ethlete-contentful.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\n\nimport { ContentfulConfig } from '../types';\n\nexport const CONTENTFUL_CONFIG = new InjectionToken<ContentfulConfig>('ContentfulConfig');\n","import { NgClass } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, Input, OnInit, ViewEncapsulation, inject } from '@angular/core';\nimport { NgClassType } from '@ethlete/core';\nimport { ContentfulAsset } from '../../types';\nimport { RICH_TEXT_RENDERER_COMPONENT_DATA } from '../rich-text-renderer';\n\n@Component({\n selector: 'et-contentful-file',\n template: `\n @if (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 standalone: true,\n imports: [NgClass],\n})\nexport class ContentfulFileComponent implements OnInit {\n private _richTextData = inject<ContentfulAsset>(RICH_TEXT_RENDERER_COMPONENT_DATA, { optional: true });\n\n @Input()\n get data() {\n return this._data;\n }\n set data(v: ContentfulAsset | null | undefined) {\n if (v && !v.contentType) {\n this._data = null;\n\n console.warn('The provided asset is invalid', v);\n\n return;\n }\n\n this._data = v ?? null;\n }\n private _data: ContentfulAsset | null = null;\n\n @Input()\n fileClass: NgClassType = null;\n\n ngOnInit(): void {\n if (this._richTextData && !this.data) {\n this.data = this._richTextData;\n }\n }\n}\n","import { CONTENTFUL_CONFIG } from '../constants';\nimport { ContentfulAsset, ContentfulConfig, ContentfulImage } 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 isContentfulImage = (v: ContentfulAsset | ContentfulImage | null | undefined): v is ContentfulImage => {\n return !!v && 'asset' in v && 'alt' in v && 'resizeBehavior' in v && 'focusArea' in v;\n};\n\nexport const isContentfulAsset = (v: ContentfulAsset | ContentfulImage | null | undefined): v is ContentfulAsset => {\n return !!v && 'contentType' in v && 'description' in v && 'height' in v && 'url' in v && 'width' in v;\n};\n","import { PictureSource } from '@ethlete/cdk';\nimport { ContentfulAsset, ContentfulImage } from '../../types';\nimport { isContentfulImage } from '../../utils';\n\nexport const generateDefaultContentfulImageSource = (data: ContentfulAsset): PictureSource => {\n const { url, contentType } = data;\n\n return {\n type: contentType,\n srcset: 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: ContentfulAsset | ContentfulImage,\n srcsetSizes: string[],\n backgroundColor: string | null,\n): PictureSource[] => {\n const assetData = isContentfulImage(data) ? data.asset : data;\n const imageData = isContentfulImage(data) ? data : null;\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 = assetData.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 (imageData) {\n if (imageData.quality) {\n queryParams.push(`q=${imageData.quality}`);\n }\n\n if (imageData.focusArea) {\n queryParams.push(`f=${imageData.focusArea}`);\n }\n\n if (imageData.resizeBehavior) {\n queryParams.push(`fit=${imageData.resizeBehavior}`);\n }\n }\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 { NgClass, NgOptimizedImage } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n Input,\n OnInit,\n ViewEncapsulation,\n inject,\n} from '@angular/core';\nimport { PictureComponent, PictureDataDirective, PictureSource } from '@ethlete/cdk';\nimport { ContentfulAsset, ContentfulImage } from '../../types';\nimport { isContentfulImage } from '../../utils';\nimport { RICH_TEXT_RENDERER_COMPONENT_DATA } from '../rich-text-renderer';\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]=\"pictureData.imgClass\"\n [hasPriority]=\"pictureData.hasPriority\"\n [figureClass]=\"pictureData.figureClass\"\n [pictureClass]=\"pictureData.pictureClass\"\n [figcaptionClass]=\"pictureData.figcaptionClass\"\n [defaultSrc]=\"pictureData.defaultSrc\"\n [alt]=\"pictureData.alt\"\n [figcaption]=\"pictureData.figcaption\"\n [width]=\"pictureData.width\"\n [height]=\"pictureData.height\"\n [sizes]=\"pictureData.sizes\"\n [sources]=\"sources\"\n />\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n standalone: true,\n imports: [NgClass, NgOptimizedImage, PictureComponent],\n hostDirectives: [\n {\n directive: PictureDataDirective,\n // eslint-disable-next-line @angular-eslint/no-inputs-metadata-property\n inputs: ['imgClass', 'hasPriority', 'figureClass', 'pictureClass', 'figcaptionClass'],\n },\n ],\n host: {\n class: 'et-contentful-image',\n },\n})\nexport class ContentfulImageComponent implements OnInit {\n private _richTextData = inject<ContentfulAsset | ContentfulImage>(RICH_TEXT_RENDERER_COMPONENT_DATA, {\n optional: true,\n });\n\n protected readonly pictureData = inject(PictureDataDirective);\n readonly _cdr = inject(ChangeDetectorRef);\n\n @Input()\n get data() {\n return this._data;\n }\n set data(v: ContentfulAsset | ContentfulImage | null | undefined) {\n const assetData = isContentfulImage(v) ? v.asset : v;\n const imageData = isContentfulImage(v) ? v : null;\n\n if (assetData && !assetData.contentType) {\n this._data = null;\n\n console.warn('The provided asset is invalid', v);\n\n return;\n }\n\n if (assetData && !assetData.contentType.startsWith('image/')) {\n throw new Error('The provided asset is not an image');\n }\n\n this._data = v ?? null;\n this.pictureData.defaultSrc = assetData ? generateDefaultContentfulImageSource(assetData) : null;\n this.pictureData.alt = imageData?.alt ?? assetData?.description ?? null;\n this.pictureData.width = assetData?.width ?? null;\n this.pictureData.height = assetData?.height ?? null;\n this.pictureData.figcaption = imageData?.caption ?? null;\n\n this.updateSizes();\n }\n private _data: ContentfulAsset | ContentfulImage | null = null;\n\n @Input()\n get sizes(): string[] {\n return this._sizes;\n }\n set sizes(v: string[]) {\n this._sizes = v;\n this.pictureData.sizes = this.sizes?.join(', ') ?? null;\n }\n private _sizes: string[] = [];\n\n @Input()\n get srcsetSizes(): string[] {\n return this._srcsetSizes;\n }\n set srcsetSizes(v: string[]) {\n this._srcsetSizes = v;\n this.updateSizes();\n }\n private _srcsetSizes: string[] = [];\n\n @Input()\n get backgroundColor() {\n return this._backgroundColor;\n }\n set backgroundColor(v: string | null) {\n this._backgroundColor = v;\n this.updateSizes();\n }\n private _backgroundColor: string | null = null;\n\n protected sources: PictureSource[] = [];\n\n ngOnInit(): void {\n if (this._richTextData && !this.data) {\n this.data = this._richTextData;\n }\n }\n\n private updateSizes() {\n this.sources = this._data ? generateContentfulImageSources(this._data, this.srcsetSizes, this.backgroundColor) : [];\n\n this._cdr.markForCheck();\n }\n}\n","import { NgClass } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, Input, OnInit, ViewEncapsulation, inject } from '@angular/core';\nimport { NgClassType } from '@ethlete/core';\nimport { ContentfulAsset } from '../../types';\nimport { RICH_TEXT_RENDERER_COMPONENT_DATA } from '../rich-text-renderer';\n\n@Component({\n selector: 'et-contentful-video',\n template: `\n @if (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 standalone: true,\n imports: [NgClass],\n})\nexport class ContentfulVideoComponent implements OnInit {\n private _richTextData = inject<ContentfulAsset>(RICH_TEXT_RENDERER_COMPONENT_DATA, { optional: true });\n\n @Input()\n get data() {\n return this._data;\n }\n set data(v: ContentfulAsset | null | undefined) {\n if (v && !v.contentType) {\n this._data = null;\n\n console.warn('The provided asset is invalid', v);\n\n return;\n }\n\n if (v && !v.contentType.startsWith('video/')) {\n throw new Error('The provided asset is not an video');\n }\n\n this._data = v ?? null;\n }\n private _data: ContentfulAsset | null = null;\n\n @Input()\n videoClass: NgClassType = null;\n\n ngOnInit(): void {\n if (this._richTextData && !this.data) {\n this.data = this._richTextData;\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 { InjectionToken } from '@angular/core';\n\nexport const RICH_TEXT_RENDERER_COMPONENT_DATA = new InjectionToken<unknown>('RICH_TEXT_RENDERER_COMPONENT_DATA');\n","import { Block, BLOCKS, Inline, INLINES, Mark, Text } from '@contentful/rich-text-types';\nimport { ContentfulAsset, ContentfulConfig, ContentfulEntryBase, RichTextResponse } from '../../types';\nimport { ContentfulImageComponent } from '../image';\nimport { ContentfulResourceMap, RichTextRenderCommand } from './rich-text-renderer.types';\n\nexport const createRenderCommandsFromContentfulRichText = (options: {\n data: RichTextResponse;\n config: ContentfulConfig;\n}) => {\n const { data, config } = options;\n\n const commands: RichTextRenderCommand[] = [];\n const resourceMap = createContentfulResourceMap(data.links);\n\n createContentfulRenderCommand(data.json, { children: commands, payload: data.json.nodeType }, resourceMap, config);\n\n return commands;\n};\n\nexport const createContentfulRenderCommand = (\n node: Block | Inline | Text,\n parent: RichTextRenderCommand,\n resourceMap: ContentfulResourceMap,\n config: ContentfulConfig,\n) => {\n const { nodeType, data: nodeData } = node;\n\n const { children, marks, value } = getContentfulNodeProps(node);\n\n const command: RichTextRenderCommand = {\n payload: translateContentfulNodeTypeToHtmlTag(nodeType),\n data: value,\n attributes: {\n ...(marks\n ? {\n class: transformContentfulMarks(marks, config.useTailwindClasses),\n }\n : {}),\n ...(nodeData['uri'] ? { href: nodeData['uri'], target: '_blank' } : {}),\n },\n children: [],\n };\n\n const entryId = nodeData['target']?.sys?.id;\n\n if (nodeType === BLOCKS.EMBEDDED_ASSET) {\n const asset = resourceMap.assetsBlock.get(entryId);\n\n if (asset) {\n const isImage = asset.contentType.startsWith('image/');\n const isVideo = asset.contentType.startsWith('video/');\n const isAudio = asset.contentType.startsWith('audio/');\n\n command.data = asset;\n\n if (isImage) {\n command.payload = config.components.image;\n } else if (isVideo) {\n command.payload = config.components.video;\n } else if (isAudio) {\n command.payload = config.components.audio;\n } else {\n command.payload = config.components.file;\n }\n } else {\n console.warn(`No asset found for entry id \"${entryId}\"!`, nodeData);\n }\n } else if (nodeType === BLOCKS.EMBEDDED_ENTRY || nodeType === INLINES.EMBEDDED_ENTRY) {\n const entry = resourceMap.entriesBlock.get(entryId) ?? resourceMap.entriesInline.get(entryId);\n\n if (entry) {\n const type = entry?.__typename ?? 'ET_UNKNOWN';\n\n // \"Image\" is a special wrapper content model for contentful assets.\n // It must be created by the user.\n const component = type === 'Image' ? ContentfulImageComponent : config.customComponents?.[type];\n\n if (component) {\n command.payload = component;\n command.data = entry;\n } else {\n command.data = `ERROR: No component found for embedded entry \"${type}\" as \"${nodeType}\"!`;\n }\n } else {\n console.warn(`No entry found for entry id \"${entryId}\"!`, nodeData);\n }\n }\n\n if (children && (children.length !== 1 || children[0]?.nodeType !== 'text')) {\n children.forEach((child) => {\n createContentfulRenderCommand(child, command, resourceMap, config);\n });\n }\n\n parent.children.push(command);\n\n return command;\n};\n\nexport const getContentfulNodeProps = (node: Block | Inline | Text) => {\n const children = 'content' in node ? node.content : null;\n let marks: Mark[] | null = null;\n let value: string | null = null;\n\n if (children && children.length === 1 && children[0]?.nodeType === 'text') {\n marks = children[0].marks?.length ? children[0].marks : null;\n value = children[0].value;\n } else {\n marks = 'marks' in node ? (node.marks?.length ? node.marks : null) : null;\n value = 'value' in node ? node.value : null;\n }\n\n return {\n children,\n marks,\n value,\n };\n};\n\nexport const transformContentfulMarks = (marks: Mark[], useTailwindClasses: boolean) => {\n return marks\n .map((mark) => {\n switch (mark.type) {\n case 'bold':\n return useTailwindClasses ? 'font-bold' : mark.type;\n case 'italic':\n return useTailwindClasses ? 'italic' : mark.type;\n case 'underline':\n return useTailwindClasses ? 'underline' : mark.type;\n case 'code':\n return useTailwindClasses ? 'font-mono' : mark.type;\n default:\n return mark.type;\n }\n })\n .join(' ');\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 'document';\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\nexport const createContentfulResourceMap = (links: RichTextResponse['links']): ContentfulResourceMap => {\n const resourceMap = {\n assetsBlock: createContentfulMap<ContentfulAsset>(links?.assets?.block),\n entriesInline: createContentfulMap(links?.entries?.inline),\n entriesBlock: createContentfulMap(links?.entries?.block),\n } as const;\n\n return resourceMap;\n};\n\nexport const createContentfulMap = <T extends ContentfulEntryBase>(links: Array<T> | null | undefined) => {\n const assetMap = new Map<string, T>();\n\n if (links) {\n for (const link of links) {\n if (!link?.sys?.id) {\n console.warn('Link has no sys.id property. Please include it inside your query.', link);\n continue;\n }\n\n assetMap.set(link.sys.id, link);\n }\n }\n\n return assetMap;\n};\n","import { ComponentPortal, DomPortalOutlet } from '@angular/cdk/portal';\nimport { DOCUMENT } from '@angular/common';\nimport {\n ApplicationRef,\n ChangeDetectionStrategy,\n Component,\n ComponentFactoryResolver,\n ElementRef,\n Injector,\n Input,\n Renderer2,\n ViewEncapsulation,\n inject,\n} from '@angular/core';\nimport { CONTENTFUL_CONFIG } from '../../constants/contentful.constants';\nimport { RichTextResponse } from '../../types';\nimport { createContentfulConfig } from '../../utils/contentful-config';\nimport { ContentfulImageComponent } from '../image';\nimport { RICH_TEXT_RENDERER_COMPONENT_DATA } from './rich-text-renderer.constants';\nimport { RichTextRenderCommand } from './rich-text-renderer.types';\nimport { createRenderCommandsFromContentfulRichText } from './rich-text-renderer.util';\n\n@Component({\n selector: 'et-contentful-rich-text-renderer',\n template: ``,\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true,\n host: {\n class: 'et-contentful-rich-text-renderer',\n },\n})\nexport class ContentfulRichTextRendererComponent {\n @Input()\n get richText() {\n return this._richText;\n }\n set richText(v: RichTextResponse | null | undefined) {\n this._richText = v ?? null;\n\n this.resetAndRender();\n }\n private _richText: RichTextResponse | null = null;\n\n private _renderer = inject(Renderer2);\n private _elementRef = inject(ElementRef);\n private _componentFactoryResolver = inject(ComponentFactoryResolver);\n private _document = inject<Document>(DOCUMENT);\n private _appRef = inject(ApplicationRef);\n private _injector = inject(Injector);\n private _config = inject(CONTENTFUL_CONFIG, { optional: true }) ?? createContentfulConfig();\n\n resetAndRender() {\n // clear childNodes to prevent appending new richtext elements to existing one\n const childElements = this._elementRef.nativeElement.childNodes;\n for (const child of childElements) {\n this._renderer.removeChild(this._elementRef.nativeElement, child);\n }\n\n if (!this._richText) {\n return;\n }\n\n const commands = createRenderCommandsFromContentfulRichText({ data: this._richText, config: this._config });\n\n this._render(commands);\n }\n\n private _render(commands: RichTextRenderCommand[]) {\n // create a document fragment to hold the elements while we create them\n const fragment = document.createDocumentFragment();\n\n const hostCommand: RichTextRenderCommand = {\n payload: 'document',\n children: commands,\n };\n\n // loop over the commands\n this._executeCommand({ command: hostCommand, parent: fragment });\n\n // append the fragment to the host element\n this._renderer.appendChild(this._elementRef.nativeElement, fragment);\n }\n\n private _executeCommand(data: { command: RichTextRenderCommand; parent: Element | DocumentFragment }) {\n const { command, parent } = data;\n\n let element: Element | null = null;\n if (command.payload !== 'document') {\n if (typeof command.payload === 'string') {\n element = this._renderer.createElement(command.payload);\n\n if (command.data) {\n this._renderer.setProperty(element, 'innerText', command.data);\n }\n\n if (command.attributes) {\n for (const [name, value] of Object.entries(command.attributes)) {\n this._renderer.setAttribute(element, name, value);\n }\n }\n this._renderer.appendChild(parent, element);\n } else {\n const injector = Injector.create({\n providers: [\n {\n provide: RICH_TEXT_RENDERER_COMPONENT_DATA,\n useValue: command.data,\n },\n ],\n parent: this._injector,\n });\n\n const portal = new DomPortalOutlet(\n parent as Element,\n this._componentFactoryResolver,\n this._appRef,\n injector,\n this._document,\n );\n\n const comp = new ComponentPortal(command.payload);\n const ref = comp.attach(portal);\n\n if (ref.instance instanceof ContentfulImageComponent) {\n ref.instance.sizes = this._config.imageOptions.sizes;\n ref.instance.srcsetSizes = this._config.imageOptions.srcsetSizes;\n ref.instance.backgroundColor = this._config.imageOptions.backgroundColor;\n }\n\n element = ref.location.nativeElement;\n }\n }\n\n // loop over the commands\n for (const childCommand of command.children) {\n this._executeCommand({ command: childCommand, parent: element ?? parent });\n }\n }\n}\n","import { NgClass } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, Input, OnInit, ViewEncapsulation, inject } from '@angular/core';\nimport { NgClassType } from '@ethlete/core';\nimport { ContentfulAsset } from '../../types';\nimport { RICH_TEXT_RENDERER_COMPONENT_DATA } from '../rich-text-renderer';\n\n@Component({\n selector: 'et-contentful-audio',\n template: `\n @if (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 standalone: true,\n imports: [NgClass],\n})\nexport class ContentfulAudioComponent implements OnInit {\n private _richTextData = inject<ContentfulAsset>(RICH_TEXT_RENDERER_COMPONENT_DATA, { optional: true });\n\n @Input()\n get data() {\n return this._data;\n }\n set data(v: ContentfulAsset | null | undefined) {\n if (v && !v.contentType) {\n this._data = null;\n\n console.warn('The provided asset is invalid', v);\n\n return;\n }\n\n if (v && !v.contentType.startsWith('audio/')) {\n throw new Error('The provided asset is not an audio');\n }\n\n this._data = v ?? null;\n }\n private _data: ContentfulAsset | null = null;\n\n @Input()\n audioClass: NgClassType = null;\n\n @Input()\n figureClass: NgClassType = null;\n\n @Input()\n figcaptionClass: NgClassType = null;\n\n ngOnInit(): void {\n if (this._richTextData && !this.data) {\n this.data = this._richTextData;\n }\n }\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 { 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 const GQL_FRAGMENT_CONTENTFUL_IMAGE = gql`\n fragment ImageData on Image {\n sys {\n id\n }\n asset {\n ...AssetData\n }\n alt\n caption\n resizeBehavior\n focusArea\n quality\n __typename\n }\n`;\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;MAIa,iBAAiB,GAAG,IAAI,cAAc,CAAmB,kBAAkB;;MCgB3E,uBAAuB,CAAA;AAdpC,IAAA,WAAA,GAAA;QAeU,IAAa,CAAA,aAAA,GAAG,MAAM,CAAkB,iCAAiC,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;QAiB/F,IAAK,CAAA,KAAA,GAA2B,IAAI,CAAC;QAG7C,IAAS,CAAA,SAAA,GAAgB,IAAI,CAAC;AAO/B,KAAA;AAzBC,IAAA,IACI,IAAI,GAAA;QACN,OAAO,IAAI,CAAC,KAAK,CAAC;KACnB;IACD,IAAI,IAAI,CAAC,CAAqC,EAAA;AAC5C,QAAA,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,WAAW,EAAE;AACvB,YAAA,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;AAElB,YAAA,OAAO,CAAC,IAAI,CAAC,+BAA+B,EAAE,CAAC,CAAC,CAAC;YAEjD,OAAO;SACR;AAED,QAAA,IAAI,CAAC,KAAK,GAAG,CAAC,IAAI,IAAI,CAAC;KACxB;IAMD,QAAQ,GAAA;QACN,IAAI,IAAI,CAAC,aAAa,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE;AACpC,YAAA,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,aAAa,CAAC;SAChC;KACF;8GA3BU,uBAAuB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA,EAAA;AAAvB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,uB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