@aiconomy/aico-components 0.0.57 → 0.0.78
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/dist/aico-components/aico-components.css +1 -1
- package/dist/aico-components/aico-components.esm.js +1 -1
- package/dist/aico-components/aico-components.esm.js.map +1 -1
- package/dist/aico-components/p-0b6e7469.entry.js +2 -0
- package/dist/aico-components/p-0b6e7469.entry.js.map +1 -0
- package/dist/aico-components/p-19752961.entry.js +2 -0
- package/dist/aico-components/p-19752961.entry.js.map +1 -0
- package/dist/aico-components/p-2677f2ab.js +2 -0
- package/dist/aico-components/p-2677f2ab.js.map +1 -0
- package/dist/aico-components/{p-1c4a07ef.entry.js → p-368503ee.entry.js} +3 -3
- package/dist/aico-components/p-368503ee.entry.js.map +1 -0
- package/dist/aico-components/p-7e0074f7.entry.js +2 -0
- package/dist/aico-components/p-7e0074f7.entry.js.map +1 -0
- package/dist/aico-components/p-9ea26390.entry.js +2 -0
- package/dist/aico-components/p-9ea26390.entry.js.map +1 -0
- package/dist/aico-components/p-bccf08d0.entry.js +2 -0
- package/dist/aico-components/p-bccf08d0.entry.js.map +1 -0
- package/dist/aico-components/p-c9eea1b1.entry.js +2 -0
- package/dist/aico-components/p-c9eea1b1.entry.js.map +1 -0
- package/dist/cjs/aico-album-content_19.cjs.entry.js +76 -53
- package/dist/cjs/aico-album-content_19.cjs.entry.js.map +1 -1
- package/dist/cjs/aico-article-detail.cjs.entry.js +18 -17
- package/dist/cjs/aico-article-detail.cjs.entry.js.map +1 -1
- package/dist/cjs/aico-components.cjs.js +1 -1
- package/dist/cjs/aico-fetch-article-detail.cjs.entry.js +3 -2
- package/dist/cjs/aico-fetch-article-detail.cjs.entry.js.map +1 -1
- package/dist/cjs/aico-news-list-item.cjs.entry.js +1 -1
- package/dist/cjs/aico-news-list-item.cjs.entry.js.map +1 -1
- package/dist/cjs/aico-news-list.cjs.entry.js +4 -3
- package/dist/cjs/aico-news-list.cjs.entry.js.map +1 -1
- package/dist/cjs/aico-no-content_2.cjs.entry.js +5 -3
- package/dist/cjs/aico-no-content_2.cjs.entry.js.map +1 -1
- package/dist/cjs/aico-special-news-carousel.cjs.entry.js +4 -3
- package/dist/cjs/aico-special-news-carousel.cjs.entry.js.map +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{utils-095ed22b.js → utils-c1b7a052.js} +11 -5
- package/dist/cjs/utils-c1b7a052.js.map +1 -0
- package/dist/collection/components/aico-article-detail/aico-article-detail.js +36 -17
- package/dist/collection/components/aico-article-detail/aico-article-detail.js.map +1 -1
- package/dist/collection/components/aico-fetch-article-detail/aico-fetch-article-detail.js +20 -1
- package/dist/collection/components/aico-fetch-article-detail/aico-fetch-article-detail.js.map +1 -1
- package/dist/collection/components/aico-news-list/aico-news-list.js +19 -2
- package/dist/collection/components/aico-news-list/aico-news-list.js.map +1 -1
- package/dist/collection/components/aico-news-list-item/aico-news-list-item.js +1 -1
- package/dist/collection/components/aico-news-list-item/aico-news-list-item.js.map +1 -1
- package/dist/collection/components/aico-special-news-carousel/aico-special-news-carousel.js +19 -2
- package/dist/collection/components/aico-special-news-carousel/aico-special-news-carousel.js.map +1 -1
- package/dist/collection/components/content/aico-asking-content/aico-asking-content.js +22 -3
- package/dist/collection/components/content/aico-asking-content/aico-asking-content.js.map +1 -1
- package/dist/collection/components/content/aico-asking-content/aico-asking-content.stories.js +16 -0
- package/dist/collection/components/content/aico-asking-content/aico-asking-content.stories.js.map +1 -1
- package/dist/collection/components/content/aico-block-quote-content/aico-block-quote-content.js +21 -1
- package/dist/collection/components/content/aico-block-quote-content/aico-block-quote-content.js.map +1 -1
- package/dist/collection/components/content/aico-block-quote-content/aico-block-quote-content.stories.js +18 -0
- package/dist/collection/components/content/aico-block-quote-content/aico-block-quote-content.stories.js.map +1 -1
- package/dist/collection/components/content/aico-bullet-content/aico-bullet-content.js +25 -5
- package/dist/collection/components/content/aico-bullet-content/aico-bullet-content.js.map +1 -1
- package/dist/collection/components/content/aico-bullet-content/aico-bullet-content.stories.js +29 -0
- package/dist/collection/components/content/aico-bullet-content/aico-bullet-content.stories.js.map +1 -1
- package/dist/collection/components/content/aico-carousel-content/aico-carousel-content.js +25 -3
- package/dist/collection/components/content/aico-carousel-content/aico-carousel-content.js.map +1 -1
- package/dist/collection/components/content/aico-carousel-content/aico-carousel-content.stories.js +35 -3
- package/dist/collection/components/content/aico-carousel-content/aico-carousel-content.stories.js.map +1 -1
- package/dist/collection/components/content/aico-content-card-content/aico-content-card-content.js +22 -3
- package/dist/collection/components/content/aico-content-card-content/aico-content-card-content.js.map +1 -1
- package/dist/collection/components/content/aico-content-card-content/aico-content-card-content.stories.js +10 -0
- package/dist/collection/components/content/aico-content-card-content/aico-content-card-content.stories.js.map +1 -1
- package/dist/collection/components/content/aico-divider-content/aico-divider-content.js +21 -1
- package/dist/collection/components/content/aico-divider-content/aico-divider-content.js.map +1 -1
- package/dist/collection/components/content/aico-divider-content/aico-divider-content.stories.js +9 -0
- package/dist/collection/components/content/aico-divider-content/aico-divider-content.stories.js.map +1 -1
- package/dist/collection/components/content/aico-document-content/aico-document-content.js +22 -3
- package/dist/collection/components/content/aico-document-content/aico-document-content.js.map +1 -1
- package/dist/collection/components/content/aico-document-content/aico-document-content.stories.js +11 -0
- package/dist/collection/components/content/aico-document-content/aico-document-content.stories.js.map +1 -1
- package/dist/collection/components/content/aico-faq-content/aico-faq-content.js +21 -1
- package/dist/collection/components/content/aico-faq-content/aico-faq-content.js.map +1 -1
- package/dist/collection/components/content/aico-faq-content/aico-faq-content.stories.js +25 -0
- package/dist/collection/components/content/aico-faq-content/aico-faq-content.stories.js.map +1 -1
- package/dist/collection/components/content/aico-heading-content/aico-heading-content.js +22 -2
- package/dist/collection/components/content/aico-heading-content/aico-heading-content.js.map +1 -1
- package/dist/collection/components/content/aico-heading-content/aico-heading-content.stories.js +10 -0
- package/dist/collection/components/content/aico-heading-content/aico-heading-content.stories.js.map +1 -1
- package/dist/collection/components/content/aico-html-content/aico-html-content.js +22 -4
- package/dist/collection/components/content/aico-html-content/aico-html-content.js.map +1 -1
- package/dist/collection/components/content/aico-link-content/aico-link-content.js +22 -3
- package/dist/collection/components/content/aico-link-content/aico-link-content.js.map +1 -1
- package/dist/collection/components/content/aico-link-content/aico-link-content.stories.js +24 -0
- package/dist/collection/components/content/aico-link-content/aico-link-content.stories.js.map +1 -1
- package/dist/collection/components/content/aico-page-content/aico-page-content.js +23 -4
- package/dist/collection/components/content/aico-page-content/aico-page-content.js.map +1 -1
- package/dist/collection/components/content/aico-page-content/aico-page-content.stories.js +11 -0
- package/dist/collection/components/content/aico-page-content/aico-page-content.stories.js.map +1 -1
- package/dist/collection/components/content/aico-table-content/aico-table-content.js +26 -6
- package/dist/collection/components/content/aico-table-content/aico-table-content.js.map +1 -1
- package/dist/collection/components/content/aico-table-content/aico-table-content.stories.js +58 -0
- package/dist/collection/components/content/aico-table-content/aico-table-content.stories.js.map +1 -1
- package/dist/collection/components/content/aico-text-content/aico-text-content.js +25 -9
- package/dist/collection/components/content/aico-text-content/aico-text-content.js.map +1 -1
- package/dist/collection/components/content/aico-text-content/aico-text-content.stories.js +55 -0
- package/dist/collection/components/content/aico-text-content/aico-text-content.stories.js.map +1 -1
- package/dist/collection/components/content/aico-title-content/aico-title-content.js +23 -3
- package/dist/collection/components/content/aico-title-content/aico-title-content.js.map +1 -1
- package/dist/collection/components/content/aico-title-content/aico-title-content.stories.js +12 -1
- package/dist/collection/components/content/aico-title-content/aico-title-content.stories.js.map +1 -1
- package/dist/collection/components/content/aico-upload-content/aico-upload-content.js +22 -2
- package/dist/collection/components/content/aico-upload-content/aico-upload-content.js.map +1 -1
- package/dist/collection/components/content/aico-upload-content/aico-upload-content.stories.js +8 -0
- package/dist/collection/components/content/aico-upload-content/aico-upload-content.stories.js.map +1 -1
- package/dist/collection/components/content/aico-video-content/aico-video-content.js +22 -2
- package/dist/collection/components/content/aico-video-content/aico-video-content.js.map +1 -1
- package/dist/collection/components/content/aico-video-content/aico-video-content.stories.js +17 -0
- package/dist/collection/components/content/aico-video-content/aico-video-content.stories.js.map +1 -1
- package/dist/collection/model/article/content/CarouselContent.js.map +1 -1
- package/dist/collection/utils/utils.js +10 -4
- package/dist/collection/utils/utils.js.map +1 -1
- package/dist/components/aico-article-detail2.js +20 -18
- package/dist/components/aico-article-detail2.js.map +1 -1
- package/dist/components/aico-asking-content2.js +6 -4
- package/dist/components/aico-asking-content2.js.map +1 -1
- package/dist/components/aico-block-quote-content2.js +5 -2
- package/dist/components/aico-block-quote-content2.js.map +1 -1
- package/dist/components/aico-bullet-content2.js +9 -6
- package/dist/components/aico-bullet-content2.js.map +1 -1
- package/dist/components/aico-carousel-content2.js +9 -4
- package/dist/components/aico-carousel-content2.js.map +1 -1
- package/dist/components/aico-content-card-content2.js +6 -4
- package/dist/components/aico-content-card-content2.js.map +1 -1
- package/dist/components/aico-divider-content2.js +5 -2
- package/dist/components/aico-divider-content2.js.map +1 -1
- package/dist/components/aico-document-content2.js +6 -4
- package/dist/components/aico-document-content2.js.map +1 -1
- package/dist/components/aico-faq-content2.js +5 -2
- package/dist/components/aico-faq-content2.js.map +1 -1
- package/dist/components/aico-fetch-article-detail.js +3 -1
- package/dist/components/aico-fetch-article-detail.js.map +1 -1
- package/dist/components/aico-heading-content2.js +6 -3
- package/dist/components/aico-heading-content2.js.map +1 -1
- package/dist/components/aico-html-content2.js +7 -12
- package/dist/components/aico-html-content2.js.map +1 -1
- package/dist/components/aico-link-content2.js +6 -4
- package/dist/components/aico-link-content2.js.map +1 -1
- package/dist/components/aico-news-list-item2.js +1 -1
- package/dist/components/aico-news-list-item2.js.map +1 -1
- package/dist/components/aico-news-list.js +4 -2
- package/dist/components/aico-news-list.js.map +1 -1
- package/dist/components/aico-page-content2.js +7 -5
- package/dist/components/aico-page-content2.js.map +1 -1
- package/dist/components/aico-special-news-carousel.js +4 -2
- package/dist/components/aico-special-news-carousel.js.map +1 -1
- package/dist/components/aico-table-content2.js +10 -7
- package/dist/components/aico-table-content2.js.map +1 -1
- package/dist/components/aico-text-content2.js +9 -10
- package/dist/components/aico-text-content2.js.map +1 -1
- package/dist/components/aico-title-content2.js +7 -4
- package/dist/components/aico-title-content2.js.map +1 -1
- package/dist/components/aico-upload-content2.js +6 -3
- package/dist/components/aico-upload-content2.js.map +1 -1
- package/dist/components/aico-video-content2.js +6 -3
- package/dist/components/aico-video-content2.js.map +1 -1
- package/dist/components/utils.js +10 -4
- package/dist/components/utils.js.map +1 -1
- package/dist/esm/aico-album-content_19.entry.js +76 -53
- package/dist/esm/aico-album-content_19.entry.js.map +1 -1
- package/dist/esm/aico-article-detail.entry.js +18 -17
- package/dist/esm/aico-article-detail.entry.js.map +1 -1
- package/dist/esm/aico-components.js +1 -1
- package/dist/esm/aico-fetch-article-detail.entry.js +3 -2
- package/dist/esm/aico-fetch-article-detail.entry.js.map +1 -1
- package/dist/esm/aico-news-list-item.entry.js +1 -1
- package/dist/esm/aico-news-list-item.entry.js.map +1 -1
- package/dist/esm/aico-news-list.entry.js +4 -3
- package/dist/esm/aico-news-list.entry.js.map +1 -1
- package/dist/esm/aico-no-content_2.entry.js +5 -3
- package/dist/esm/aico-no-content_2.entry.js.map +1 -1
- package/dist/esm/aico-special-news-carousel.entry.js +4 -3
- package/dist/esm/aico-special-news-carousel.entry.js.map +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{utils-54ffec33.js → utils-b4eec8e9.js} +11 -5
- package/dist/esm/utils-b4eec8e9.js.map +1 -0
- package/dist/types/components/aico-article-detail/aico-article-detail.d.ts +1 -0
- package/dist/types/components/aico-fetch-article-detail/aico-fetch-article-detail.d.ts +1 -0
- package/dist/types/components/aico-news-list/aico-news-list.d.ts +1 -0
- package/dist/types/components/aico-special-news-carousel/aico-special-news-carousel.d.ts +1 -0
- package/dist/types/components/content/aico-asking-content/aico-asking-content.d.ts +1 -0
- package/dist/types/components/content/aico-block-quote-content/aico-block-quote-content.d.ts +1 -0
- package/dist/types/components/content/aico-bullet-content/aico-bullet-content.d.ts +1 -0
- package/dist/types/components/content/aico-carousel-content/aico-carousel-content.d.ts +1 -0
- package/dist/types/components/content/aico-content-card-content/aico-content-card-content.d.ts +1 -0
- package/dist/types/components/content/aico-divider-content/aico-divider-content.d.ts +1 -0
- package/dist/types/components/content/aico-document-content/aico-document-content.d.ts +1 -0
- package/dist/types/components/content/aico-faq-content/aico-faq-content.d.ts +1 -0
- package/dist/types/components/content/aico-heading-content/aico-heading-content.d.ts +1 -0
- package/dist/types/components/content/aico-html-content/aico-html-content.d.ts +1 -0
- package/dist/types/components/content/aico-link-content/aico-link-content.d.ts +1 -0
- package/dist/types/components/content/aico-page-content/aico-page-content.d.ts +1 -0
- package/dist/types/components/content/aico-table-content/aico-table-content.d.ts +1 -0
- package/dist/types/components/content/aico-text-content/aico-text-content.d.ts +1 -0
- package/dist/types/components/content/aico-title-content/aico-title-content.d.ts +1 -0
- package/dist/types/components/content/aico-upload-content/aico-upload-content.d.ts +1 -0
- package/dist/types/components/content/aico-video-content/aico-video-content.d.ts +1 -0
- package/dist/types/components.d.ts +42 -0
- package/dist/types/model/article/content/CarouselContent.d.ts +4 -2
- package/dist/types/utils/utils.d.ts +2 -2
- package/package.json +3 -2
- package/dist/aico-components/p-0ca1f065.entry.js +0 -2
- package/dist/aico-components/p-0ca1f065.entry.js.map +0 -1
- package/dist/aico-components/p-1c4a07ef.entry.js.map +0 -1
- package/dist/aico-components/p-406fa2e5.entry.js +0 -2
- package/dist/aico-components/p-406fa2e5.entry.js.map +0 -1
- package/dist/aico-components/p-4c0f3325.entry.js +0 -2
- package/dist/aico-components/p-4c0f3325.entry.js.map +0 -1
- package/dist/aico-components/p-5109399b.entry.js +0 -2
- package/dist/aico-components/p-5109399b.entry.js.map +0 -1
- package/dist/aico-components/p-6464810e.entry.js +0 -2
- package/dist/aico-components/p-6464810e.entry.js.map +0 -1
- package/dist/aico-components/p-b1f8308f.entry.js +0 -2
- package/dist/aico-components/p-b1f8308f.entry.js.map +0 -1
- package/dist/aico-components/p-dfd3b0d3.js +0 -2
- package/dist/aico-components/p-dfd3b0d3.js.map +0 -1
- package/dist/cjs/utils-095ed22b.js.map +0 -1
- package/dist/esm/utils-54ffec33.js.map +0 -1
|
@@ -44,6 +44,7 @@ const AicoArticleDetail = class {
|
|
|
44
44
|
index.registerInstance(this, hostRef);
|
|
45
45
|
this.dateOptions = { day: 'numeric', month: 'long', year: 'numeric' };
|
|
46
46
|
this.article = undefined;
|
|
47
|
+
this.locale = 'de';
|
|
47
48
|
}
|
|
48
49
|
render() {
|
|
49
50
|
const articleDate = new Date(this.article.attributes.publishDate);
|
|
@@ -66,43 +67,43 @@ const AicoArticleDetail = class {
|
|
|
66
67
|
case ContentType.ALBUM:
|
|
67
68
|
return index.h("aico-album-content", { content: content });
|
|
68
69
|
case ContentType.ASKING:
|
|
69
|
-
return index.h("aico-asking-content", { content: content });
|
|
70
|
+
return index.h("aico-asking-content", { content: content, locale: this.locale });
|
|
70
71
|
case ContentType.BLOCK_QUOTE:
|
|
71
|
-
return index.h("aico-block-quote-content", { content: content });
|
|
72
|
+
return index.h("aico-block-quote-content", { content: content, locale: this.locale });
|
|
72
73
|
case ContentType.BULLET:
|
|
73
|
-
return index.h("aico-bullet-content", { content: content });
|
|
74
|
+
return index.h("aico-bullet-content", { content: content, locale: this.locale });
|
|
74
75
|
case ContentType.CAROUSEL:
|
|
75
|
-
return index.h("aico-carousel-content", { content: content });
|
|
76
|
+
return index.h("aico-carousel-content", { content: content, locale: this.locale });
|
|
76
77
|
case ContentType.CONTENT_CARD:
|
|
77
|
-
return index.h("aico-content-card-content", { content: content });
|
|
78
|
+
return index.h("aico-content-card-content", { content: content, locale: this.locale });
|
|
78
79
|
case ContentType.DIVIDER:
|
|
79
|
-
return index.h("aico-divider-content", { content: content });
|
|
80
|
+
return index.h("aico-divider-content", { content: content, locale: this.locale });
|
|
80
81
|
case ContentType.DOCUMENT:
|
|
81
|
-
return index.h("aico-document-content", { content: content });
|
|
82
|
+
return index.h("aico-document-content", { content: content, locale: this.locale });
|
|
82
83
|
case ContentType.FAQ:
|
|
83
|
-
return index.h("aico-faq-content", { content: content });
|
|
84
|
+
return index.h("aico-faq-content", { content: content, locale: this.locale });
|
|
84
85
|
case ContentType.HEADING:
|
|
85
|
-
return index.h("aico-heading-content", { content: content });
|
|
86
|
+
return index.h("aico-heading-content", { content: content, locale: this.locale });
|
|
86
87
|
case ContentType.HTML:
|
|
87
|
-
return index.h("aico-html-content", { content: content });
|
|
88
|
+
return index.h("aico-html-content", { content: content, locale: this.locale });
|
|
88
89
|
case ContentType.LINK:
|
|
89
|
-
return index.h("aico-link-content", { content: content });
|
|
90
|
+
return index.h("aico-link-content", { content: content, locale: this.locale });
|
|
90
91
|
case ContentType.NEWS:
|
|
91
92
|
return index.h("aico-news-content", { content: content });
|
|
92
93
|
case ContentType.PAGE:
|
|
93
|
-
return index.h("aico-page-content", { content: content });
|
|
94
|
+
return index.h("aico-page-content", { content: content, locale: this.locale });
|
|
94
95
|
case ContentType.TABLE:
|
|
95
|
-
return index.h("aico-table-content", { content: content });
|
|
96
|
+
return index.h("aico-table-content", { content: content, locale: this.locale });
|
|
96
97
|
case ContentType.TESTIMONIAL:
|
|
97
98
|
return index.h("aico-testimonial-content", { content: content });
|
|
98
99
|
case ContentType.TEXT:
|
|
99
|
-
return index.h("aico-text-content", { content: content });
|
|
100
|
+
return index.h("aico-text-content", { content: content, locale: this.locale });
|
|
100
101
|
case ContentType.TITLE:
|
|
101
|
-
return index.h("aico-title-content", { content: content });
|
|
102
|
+
return index.h("aico-title-content", { content: content, locale: this.locale });
|
|
102
103
|
case ContentType.UPLOAD:
|
|
103
|
-
return index.h("aico-upload-content", { content: content });
|
|
104
|
+
return index.h("aico-upload-content", { content: content, locale: this.locale });
|
|
104
105
|
case ContentType.VIDEO:
|
|
105
|
-
return index.h("aico-video-content", { content: content });
|
|
106
|
+
return index.h("aico-video-content", { content: content, locale: this.locale });
|
|
106
107
|
case Cont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-article-detail.css?tag=aico-article-detail&encapsulation=scoped","src/components/aico-article-detail/aico-article-detail.tsx"],"sourcesContent":["export enum ContentType {\n BULLET = 'BULLET',\n TEXT = 'TEXT',\n VIDEO = 'VIDEO',\n TABLE = 'TABLE',\n HEADING = 'HEADING',\n TITLE = 'TITLE',\n CONTENT_CARD = 'CONTENT_CARD',\n TESTIMONIAL = 'TESTIMONIAL',\n PRODUCT = 'PRODUCT',\n NEWS = 'NEWS',\n ASKING = 'ASKING',\n AGENDA = 'AGENDA',\n LIST_ASKING = 'LIST_ASKING',\n LIST_AGENDA = 'LIST_AGENDA',\n CRM = 'CRM',\n B2B = 'B2B',\n FORM_BUILDER = 'FORM_BUILDER',\n BLOCK_QUOTE = 'BLOCK_QUOTE',\n FAQ = 'FAQ',\n COURSE = 'COURSE',\n DOCUMENT = 'DOCUMENT',\n LINK = 'LINK',\n HTML = 'HTML',\n DIVIDER = 'DIVIDER',\n COLLECTION = 'COLLECTION',\n CAROUSEL = 'CAROUSEL',\n PAGE = 'PAGE',\n ALBUM = 'ALBUM',\n UPLOAD = 'UPLOAD',\n}\n","","import { Component, Host, Prop, h } from '@stencil/core';\nimport { ContentType } from '../../model/article/ContentType';\nimport type { Article, ArticleContent, ArticleContentBuilderColumn, ArticleContentBuilderRow } from '../../model/Article';\nimport type { HtmlContent } from '../../model/article/content/HtmlContent';\nimport type { AlbumContent } from '../../model/article/content/AlbumContent';\nimport type { TitleContent } from '../../model/article/content/TitleContent';\nimport type { BlockQuoteContent } from '../../model/article/content/BlockQuoteContent';\nimport type { BulletContent } from '../../model/article/content/BulletContent';\nimport type { CardContent } from '../../model/article/content/CardContent';\nimport type { CarouselContent } from '../../model/article/content/CarouselContent';\nimport type { DividerContent } from '../../model/article/content/DividerContent';\nimport type { DocumentContent } from '../../model/article/content/DocumentContent';\nimport type { HeadingContent } from '../../model/article/content/HeadingContent';\nimport type { LinkContent } from '../../model/article/content/LinkContent';\nimport type { TableContent } from '../../model/article/content/TableContet';\nimport type { TestimonialContent } from '../../model/article/content/TestimonialContent';\nimport type { TextContent } from '../../model/article/content/TextContent';\nimport type { VideoContent } from '../../model/article/content/VideoContent';\nimport type { AskingContent } from '../../model/article/content/AskingContent';\nimport type { FaqContent } from '../../model/article/content/FaqContent';\nimport type { NewsContent } from '../../model/article/content/NewsContent';\nimport type { PageContent } from '../../model/article/content/PageContent';\nimport type { UploadContent } from '../../model/article/content/UploadContent';\n\n@Component({\n tag: 'aico-article-detail',\n styleUrl: 'aico-article-detail.css',\n scoped: true,\n})\nexport class AicoArticleDetail {\n @Prop() article!: Article;\n\n private readonly dateOptions: Intl.DateTimeFormatOptions = { day: 'numeric', month: 'long', year: 'numeric' };\n\n render() {\n const articleDate = new Date(this.article.attributes.publishDate);\n const content = this.article.attributes.contentBuilder.rows.sort((a, b) => a.order - b.order).map((row, index) => this.mapRowContent(row, index));\n return (\n <Host>\n <figure>\n <blockquote class=\"blockquote\">\n <h2 class=\"text-uppercase\">{this.article.attributes.name}</h2>\n </blockquote>\n <figcaption class=\"blockquote-footer\">\n {articleDate.toLocaleDateString('en-US', this.dateOptions)} by <cite title=\"Author\">{this.article.attributes.author}</cite>\n </figcaption>\n </figure>\n <div class=\"content-wrapper\">{content}</div>\n </Host>\n );\n }\n\n private mapRowContent(row: ArticleContentBuilderRow, index: number) {\n const rowContent = row.columns.map((column, columnIndex) => this.mapColumnContent(column, columnIndex));\n return <div class={`content-row content-row-index-${index}`}>{rowContent}</div>;\n }\n\n private mapColumnContent(column: ArticleContentBuilderColumn, index: number) {\n const columnContent = column.contentContainer.contents.sort((a, b) => (a.sort ?? 0) - (b.sort ?? 0)).map((content, contentIndex) => this.mapContent(content, contentIndex));\n return <div class={`content-column content-column-index-${index}`}>{columnContent}</div>;\n }\n\n private mapContent(content: ArticleContent, index: number) {\n return <div class={`content-data-wrapper content-data-wrapper-index-${index}`}>{this.mapContentData(content.type, content.contentData)}</div>;\n }\n\n private mapContentData(contentType: ContentType | undefined, content: object) {\n switch (contentType) {\n case ContentType.ALBUM:\n return <aico-album-content content={content as AlbumContent} />;\n\n case ContentType.ASKING:\n return <aico-asking-content content={content as AskingContent} />;\n\n case ContentType.BLOCK_QUOTE:\n return <aico-block-quote-content content={content as BlockQuoteContent} />;\n\n case ContentType.BULLET:\n return <aico-bullet-content content={content as BulletContent} />;\n\n case ContentType.CAROUSEL:\n return <aico-carousel-content content={content as CarouselContent} />;\n\n case ContentType.CONTENT_CARD:\n return <aico-content-card-content content={content as CardContent} />;\n\n case ContentType.DIVIDER:\n return <aico-divider-content content={content as DividerContent} />;\n\n case ContentType.DOCUMENT:\n return <aico-document-content content={content as DocumentContent} />;\n\n case ContentType.FAQ:\n return <aico-faq-content content={content as FaqContent} />;\n\n case ContentType.HEADING:\n return <aico-heading-content content={content as HeadingContent} />;\n\n case ContentType.HTML:\n return <aico-html-content content={content as HtmlContent} />;\n\n case ContentType.LINK:\n return <aico-link-content content={content as LinkContent} />;\n\n case ContentType.NEWS:\n return <aico-news-content content={content as NewsContent} />;\n\n case ContentType.PAGE:\n return <aico-page-content content={content as PageContent} />;\n\n case ContentType.TABLE:\n return <aico-table-content content={content as TableContent} />;\n\n case ContentType.TESTIMONIAL:\n return <aico-testimonial-content content={content as TestimonialContent} />;\n\n case ContentType.TEXT:\n return <aico-text-content content={content as TextContent} />;\n\n case ContentType.TITLE:\n return <aico-title-content content={content as TitleContent} />;\n\n case ContentType.UPLOAD:\n return <aico-upload-content content={content as UploadContent} />;\n\n case ContentType.VIDEO:\n return <aico-video-content content={content as VideoContent} />;\n\n case ContentType.PRODUCT:\n case ContentType.AGENDA:\n case ContentType.LIST_ASKING:\n case ContentType.LIST_AGENDA:\n case ContentType.CRM:\n case ContentType.B2B:\n case ContentType.FORM_BUILDER:\n case ContentType.COURSE:\n case ContentType.COLLECTION:\n default:\n return <div class=\"content-data content-data-not-handled\">Content type not handled.</div>;\n }\n }\n}\n"],"version":3}
|
|
1
|
+
{"file":"aico-article-detail.entry.cjs.js","mappings":";;;;;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AC,MAAM,GAAI,CAAC;YAEvF,KAAK,WAAW,CAAC,OAAO,CAAC;YACzB,KAAK,WAAW,CAAC,MAAM,CAAC;YACxB,KAAK,WAAW,CAAC,WAAW,CAAC;YAC7B,KAAK,WAAW,CAAC,WAAW,CAAC;YAC7B,KAAK,WAAW,CAAC,GAAG,CAAC;YACrB,KAAK,WAAW,CAAC,GAAG,CAAC;YACrB,KAAK,WAAW,CAAC,YAAY,CAAC;YAC9B,KAAK,WAAW,CAAC,MAAM,CAAC;YACxB,KAAK,WAAW,CAAC,UAAU,CAAC;YAC5B;gBACE,OAAOA,iBAAK,KAAK,EAAC,uCAAuC,gCAAgC,CAAC;SAC7F;KACF;;;;;;","names":["h","Host","index"],"sources":["src/model/article/ContentType.ts","src/components/aico-article-detail/aico-article-detail.css?tag=aico-article-detail&encapsulation=scoped","src/components/aico-article-detail/aico-article-detail.tsx"],"sourcesContent":["export enum ContentType {\n BULLET = 'BULLET',\n TEXT = 'TEXT',\n VIDEO = 'VIDEO',\n TABLE = 'TABLE',\n HEADING = 'HEADING',\n TITLE = 'TITLE',\n CONTENT_CARD = 'CONTENT_CARD',\n TESTIMONIAL = 'TESTIMONIAL',\n PRODUCT = 'PRODUCT',\n NEWS = 'NEWS',\n ASKING = 'ASKING',\n AGENDA = 'AGENDA',\n LIST_ASKING = 'LIST_ASKING',\n LIST_AGENDA = 'LIST_AGENDA',\n CRM = 'CRM',\n B2B = 'B2B',\n FORM_BUILDER = 'FORM_BUILDER',\n BLOCK_QUOTE = 'BLOCK_QUOTE',\n FAQ = 'FAQ',\n COURSE = 'COURSE',\n DOCUMENT = 'DOCUMENT',\n LINK = 'LINK',\n HTML = 'HTML',\n DIVIDER = 'DIVIDER',\n COLLECTION = 'COLLECTION',\n CAROUSEL = 'CAROUSEL',\n PAGE = 'PAGE',\n ALBUM = 'ALBUM',\n UPLOAD = 'UPLOAD',\n}\n","","import { Component, Host, Prop, h } from '@stencil/core';\nimport { ContentType } from '../../model/article/ContentType';\nimport type { Article, ArticleContent, ArticleContentBuilderColumn, ArticleContentBuilderRow } from '../../model/Article';\nimport type { HtmlContent } from '../../model/article/content/HtmlContent';\nimport type { AlbumContent } from '../../model/article/content/AlbumContent';\nimport type { TitleContent } from '../../model/article/content/TitleContent';\nimport type { BlockQuoteContent } from '../../model/article/content/BlockQuoteContent';\nimport type { BulletContent } from '../../model/article/content/BulletContent';\nimport type { CardContent } from '../../model/article/content/CardContent';\nimport type { CarouselContent } from '../../model/article/content/CarouselContent';\nimport type { DividerContent } from '../../model/article/content/DividerContent';\nimport type { DocumentContent } from '../../model/article/content/DocumentContent';\nimport type { HeadingContent } from '../../model/article/content/HeadingContent';\nimport type { LinkContent } from '../../model/article/content/LinkContent';\nimport type { TableContent } from '../../model/article/content/TableContet';\nimport type { TestimonialContent } from '../../model/article/content/TestimonialContent';\nimport type { TextContent } from '../../model/article/content/TextContent';\nimport type { VideoContent } from '../../model/article/content/VideoContent';\nimport type { AskingContent } from '../../model/article/content/AskingContent';\nimport type { FaqContent } from '../../model/article/content/FaqContent';\nimport type { NewsContent } from '../../model/article/content/NewsContent';\nimport type { PageContent } from '../../model/article/content/PageContent';\nimport type { UploadContent } from '../../model/article/content/UploadContent';\n\n@Component({\n tag: 'aico-article-detail',\n styleUrl: 'aico-article-detail.css',\n scoped: true,\n})\nexport class AicoArticleDetail {\n @Prop() article!: Article;\n\n @Prop() locale: string = 'de';\n\n private readonly dateOptions: Intl.DateTimeFormatOptions = { day: 'numeric', month: 'long', year: 'numeric' };\n\n render() {\n const articleDate = new Date(this.article.attributes.publishDate);\n const content = this.article.attributes.contentBuilder.rows.sort((a, b) => a.order - b.order).map((row, index) => this.mapRowContent(row, index));\n return (\n <Host>\n <figure>\n <blockquote class=\"blockquote\">\n <h2 class=\"text-uppercase\">{this.article.attributes.name}</h2>\n </blockquote>\n <figcaption class=\"blockquote-footer\">\n {articleDate.toLocaleDateString('en-US', this.dateOptions)} by <cite title=\"Author\">{this.article.attributes.author}</cite>\n </figcaption>\n </figure>\n <div class=\"content-wrapper\">{content}</div>\n </Host>\n );\n }\n\n private mapRowContent(row: ArticleContentBuilderRow, index: number) {\n const rowContent = row.columns.map((column, columnIndex) => this.mapColumnContent(column, columnIndex));\n return <div class={`content-row content-row-index-${index}`}>{rowContent}</div>;\n }\n\n private mapColumnContent(column: ArticleContentBuilderColumn, index: number) {\n const columnContent = column.contentContainer.contents.sort((a, b) => (a.sort ?? 0) - (b.sort ?? 0)).map((content, contentIndex) => this.mapContent(content, contentIndex));\n return <div class={`content-column content-column-index-${index}`}>{columnContent}</div>;\n }\n\n private mapContent(content: ArticleContent, index: number) {\n return <div class={`content-data-wrapper content-data-wrapper-index-${index}`}>{this.mapContentData(content.type, content.contentData)}</div>;\n }\n\n private mapContentData(contentType: ContentType | undefined, content: object) {\n switch (contentType) {\n case ContentType.ALBUM:\n return <aico-album-content content={content as AlbumContent} />;\n\n case ContentType.ASKING:\n return <aico-asking-content content={content as AskingContent} locale={this.locale} />;\n\n case ContentType.BLOCK_QUOTE:\n return <aico-block-quote-content content={content as BlockQuoteContent} locale={this.locale} />;\n\n case ContentType.BULLET:\n return <aico-bullet-content content={content as BulletContent} locale={this.locale} />;\n\n case ContentType.CAROUSEL:\n return <aico-carousel-content content={content as CarouselContent} locale={this.locale} />;\n\n case ContentType.CONTENT_CARD:\n return <aico-content-card-content content={content as CardContent} locale={this.locale} />;\n\n case ContentType.DIVIDER:\n return <aico-divider-content content={content as DividerContent} locale={this.locale} />;\n\n case ContentType.DOCUMENT:\n return <aico-document-content content={content as DocumentContent} locale={this.locale} />;\n\n case ContentType.FAQ:\n return <aico-faq-content content={content as FaqContent} locale={this.locale} />;\n\n case ContentType.HEADING:\n return <aico-heading-content content={content as HeadingContent} locale={this.locale} />;\n\n case ContentType.HTML:\n return <aico-html-content content={content as HtmlContent} locale={this.locale} />;\n\n case ContentType.LINK:\n return <aico-link-content content={content as LinkContent} locale={this.locale} />;\n\n case ContentType.NEWS:\n return <aico-news-content content={content as NewsContent} />;\n\n case ContentType.PAGE:\n return <aico-page-content content={content as PageContent} locale={this.locale} />;\n\n case ContentType.TABLE:\n return <aico-table-content content={content as TableContent} locale={this.locale} />;\n\n case ContentType.TESTIMONIAL:\n return <aico-testimonial-content content={content as TestimonialContent} />;\n\n case ContentType.TEXT:\n return <aico-text-content content={content as TextContent} locale={this.locale} />;\n\n case ContentType.TITLE:\n return <aico-title-content content={content as TitleContent} locale={this.locale} />;\n\n case ContentType.UPLOAD:\n return <aico-upload-content content={content as UploadContent} locale={this.locale} />;\n\n case ContentType.VIDEO:\n return <aico-video-content content={content as VideoContent} locale={this.locale} />;\n\n case ContentType.PRODUCT:\n case ContentType.AGENDA:\n case ContentType.LIST_ASKING:\n case ContentType.LIST_AGENDA:\n case ContentType.CRM:\n case ContentType.B2B:\n case ContentType.FORM_BUILDER:\n case ContentType.COURSE:\n case ContentType.COLLECTION:\n default:\n return <div class=\"content-data content-data-not-handled\">Content type not handled.</div>;\n }\n }\n}\n"],"version":3}
|
|
@@ -17,7 +17,7 @@ const patchBrowser = () => {
|
|
|
17
17
|
};
|
|
18
18
|
|
|
19
19
|
patchBrowser().then(options => {
|
|
20
|
-
return index.bootstrapLazy([["aico-fetch-article-detail.cjs",[[2,"aico-fetch-article-detail",{"aicoUrl":[1,"aico-url"],"aicoBearerToken":[1,"aico-bearer-token"],"articleId":[1,"article-id"],"articleUrlHandle":[1,"article-url-handle"],"article":[32]}]]],["aico-news-list.cjs",[[2,"aico-news-list",{"aicoUrl":[1,"aico-url"],"aicoBearerToken":[1,"aico-bearer-token"],"nextButtonText":[1,"next-button-text"],"previousButtonText":[1,"previous-button-text"],"newsResponse":[32],"pageNumber":[32]}]]],["aico-asking-list-content.cjs",[[6,"aico-asking-list-content"]]],["aico-collection-content.cjs",[[6,"aico-collection-content"]]],["aico-special-news-carousel.cjs",[[2,"aico-special-news-carousel",{"aicoUrl":[1,"aico-url"],"aicoBearerToken":[1,"aico-bearer-token"],"numberOfArticles":[2,"number-of-articles"],"newsResponse":[32]}]]],["aico-no-content_2.cjs",[[2,"aico-title-content",{"content":[16]}],[2,"aico-no-content"]]],["aico-album-content_19.cjs",[[2,"aico-bullet-content",{"content":[16]}],[2,"aico-carousel-content",{"content":[16],"hasArrows":[4,"has-arrows"]}],[2,"aico-content-card-content",{"content":[16]}],[2,"aico-heading-content",{"content":[16]}],[2,"aico-table-content",{"content":[16]}],[2,"aico-text-content",{"content":[16]}],[2,"aico-upload-content",{"content":[16]}],[2,"aico-video-content",{"content":[16]}],[2,"aico-
|
|
20
|
+
return index.bootstrapLazy([["aico-fetch-article-detail.cjs",[[2,"aico-fetch-article-detail",{"aicoUrl":[1,"aico-url"],"aicoBearerToken":[1,"aico-bearer-token"],"locale":[1],"articleId":[1,"article-id"],"articleUrlHandle":[1,"article-url-handle"],"article":[32]}]]],["aico-news-list.cjs",[[2,"aico-news-list",{"aicoUrl":[1,"aico-url"],"aicoBearerToken":[1,"aico-bearer-token"],"newsChannels":[16],"nextButtonText":[1,"next-button-text"],"previousButtonText":[1,"previous-button-text"],"newsResponse":[32],"pageNumber":[32]}]]],["aico-asking-list-content.cjs",[[6,"aico-asking-list-content"]]],["aico-collection-content.cjs",[[6,"aico-collection-content"]]],["aico-special-news-carousel.cjs",[[2,"aico-special-news-carousel",{"aicoUrl":[1,"aico-url"],"aicoBearerToken":[1,"aico-bearer-token"],"newsChannels":[16],"numberOfArticles":[2,"number-of-articles"],"newsResponse":[32]}]]],["aico-no-content_2.cjs",[[2,"aico-title-content",{"content":[16],"locale":[1]}],[2,"aico-no-content"]]],["aico-album-content_19.cjs",[[2,"aico-bullet-content",{"content":[16],"locale":[1]}],[2,"aico-carousel-content",{"content":[16],"hasArrows":[4,"has-arrows"],"locale":[1]}],[2,"aico-content-card-content",{"content":[16],"locale":[1]}],[2,"aico-heading-content",{"content":[16],"locale":[1]}],[2,"aico-table-content",{"content":[16],"locale":[1]}],[2,"aico-text-content",{"content":[16],"locale":[1]}],[2,"aico-upload-content",{"content":[16],"locale":[1]}],[2,"aico-video-content",{"content":[16],"locale":[1]}],[2,"aico-album-content",{"content":[16]}],[2,"aico-asking-content",{"content":[16],"locale":[1]}],[2,"aico-block-quote-content",{"content":[16],"locale":[1]}],[2,"aico-divider-content",{"content":[16],"locale":[1]}],[2,"aico-document-content",{"content":[16],"locale":[1]}],[2,"aico-faq-content",{"content":[16],"locale":[1]}],[2,"aico-html-content",{"content":[16],"locale":[1]}],[2,"aico-link-content",{"content":[16],"locale":[1]}],[2,"aico-news-content",{"content":[16]}],[2,"aico-page-content",{"content":[16],"locale":[1]}],[2,"aico-testimonial-content",{"content":[16]}]]],["aico-article-detail.cjs",[[2,"aico-article-detail",{"article":[16],"locale":[1]}]]],["aico-news-list-item.cjs",[[2,"aico-news-list-item",{"article":[16]}]]]], options);
|
|
21
21
|
});
|
|
22
22
|
|
|
23
23
|
exports.setNonce = index.setNonce;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-e52034b7.js');
|
|
6
|
-
const utils = require('./utils-
|
|
6
|
+
const utils = require('./utils-c1b7a052.js');
|
|
7
7
|
|
|
8
8
|
const aicoFetchArticleDetailCss = "";
|
|
9
9
|
|
|
@@ -13,6 +13,7 @@ const AicoFetchArticleDetail = class {
|
|
|
13
13
|
this.article = undefined;
|
|
14
14
|
this.aicoUrl = undefined;
|
|
15
15
|
this.aicoBearerToken = undefined;
|
|
16
|
+
this.locale = 'de';
|
|
16
17
|
this.articleId = undefined;
|
|
17
18
|
this.articleUrlHandle = undefined;
|
|
18
19
|
}
|
|
@@ -34,7 +35,7 @@ const AicoFetchArticleDetail = class {
|
|
|
34
35
|
this.article = await utils.fetchNewsArticle(this.api, this.articleId, this.articleFetchController.signal);
|
|
35
36
|
}
|
|
36
37
|
render() {
|
|
37
|
-
return index.h("aico-article-detail", { article: this.article });
|
|
38
|
+
return index.h("aico-article-detail", { article: this.article, locale: this.locale });
|
|
38
39
|
}
|
|
39
40
|
};
|
|
40
41
|
AicoFetchArticleDetail.style = aicoFetchArticleDetailCss;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"aico-fetch-article-detail.entry.cjs.js","mappings":";;;;;;;AAAA,MAAM,yBAAyB,GAAG,EAAE;;MCUvB,sBAAsB
|
|
1
|
+
{"file":"aico-fetch-article-detail.entry.cjs.js","mappings":";;;;;;;AAAA,MAAM,yBAAyB,GAAG,EAAE;;MCUvB,sBAAsB;;;;;;sBAOR,IAAI;;;;IAqB7B,iBAAiB;QACf,IAAI,CAAC,sBAAsB,GAAG,IAAI,eAAe,EAAE,CAAC;QACpD,IAAI,CAAC,GAAG,GAAG,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,WAAW,EAAE,IAAI,CAAC,eAAe,EAAE,CAAC;KACzE;IAED,oBAAoB;QAClB,IAAI,CAAC,sBAAuB,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;KACpD;IAED,MAAM,iBAAiB;QACrB,IAAI,CAAC,IAAI,CAAC,SAAS,IAAI,CAAC,IAAI,CAAC,gBAAgB,EAAE;YAC7C,MAAM,IAAI,KAAK,CAAC,2DAA2D,CAAC,CAAC;SAC9E;QAED,IAAI,IAAI,CAAC,gBAAgB,EAAE;YACzB,IAAI,CAAC,OAAO,GAAG,MAAMA,8BAAwB,CAAC,IAAI,CAAC,GAAI,EAAE,IAAI,CAAC,gBAAgB,EAAE,IAAI,CAAC,sBAAuB,CAAC,MAAM,CAAC,CAAC;YACrH,OAAO;SACR;QAED,IAAI,CAAC,OAAO,GAAG,MAAMC,sBAAgB,CAAC,IAAI,CAAC,GAAI,EAAE,IAAI,CAAC,SAAU,EAAE,IAAI,CAAC,sBAAuB,CAAC,MAAM,CAAC,CAAC;KACxG;IAED,MAAM;QACJ,OAAOC,iCAAqB,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,GAAI,CAAC;KAC5E;;;;;;","names":["fetchNewsArticleByHandle","fetchNewsArticle","h"],"sources":["src/components/aico-fetch-article-detail/aico-fetch-article-detail.css?tag=aico-fetch-article-detail&encapsulation=scoped","src/components/aico-fetch-article-detail/aico-fetch-article-detail.tsx"],"sourcesContent":["","import { Component, Prop, State, h } from '@stencil/core';\nimport { fetchNewsArticle, fetchNewsArticleByHandle } from '../../utils/utils';\nimport { Article } from '../../model/Article';\nimport { AicoApiRequestInfo } from '../../model/AicoApiRequestInfo';\n\n@Component({\n tag: 'aico-fetch-article-detail',\n styleUrl: 'aico-fetch-article-detail.css',\n scoped: true,\n})\nexport class AicoFetchArticleDetail {\n @State() article!: Article;\n\n @Prop() aicoUrl!: string;\n\n @Prop() aicoBearerToken!: string;\n\n @Prop() locale: string = 'de';\n\n /**\n * The id will be used to fetch the article.\n *\n * If both the {@link AicoFetchArticleDetail#articleId} and {@link AicoFetchArticleDetail#articleUrlHandle} are\n * provided, the latter will be used. If neither are provided, an error is thrown.\n */\n @Prop() articleId?: string;\n\n /**\n * The url handle will be used to fetch the article.\n *\n * If both the {@link AicoFetchArticleDetail#articleId} and {@link AicoFetchArticleDetail#articleUrlHandle} are\n * provided, the latter will be used. If neither are provided, an error is thrown.\n */\n @Prop() articleUrlHandle?: string;\n\n private api?: AicoApiRequestInfo;\n private articleFetchController?: AbortController;\n\n connectedCallback() {\n this.articleFetchController = new AbortController();\n this.api = { baseApi: this.aicoUrl, bearerToken: this.aicoBearerToken };\n }\n\n disconnectedCallback() {\n this.articleFetchController!.abort('disconnected');\n }\n\n async componentWillLoad(): Promise<void> {\n if (!this.articleId && !this.articleUrlHandle) {\n throw new Error('Either the article id or the url handle must be provided.');\n }\n\n if (this.articleUrlHandle) {\n this.article = await fetchNewsArticleByHandle(this.api!, this.articleUrlHandle, this.articleFetchController!.signal);\n return;\n }\n\n this.article = await fetchNewsArticle(this.api!, this.articleId!, this.articleFetchController!.signal);\n }\n\n render() {\n return <aico-article-detail article={this.article} locale={this.locale} />;\n }\n}\n"],"version":3}
|
|
@@ -17,7 +17,7 @@ const AicoNewsListItem = class {
|
|
|
17
17
|
return (index.h("div", { class: "card h-100 pe-auto", style: { cursor: 'pointer' }, onClick: () => {
|
|
18
18
|
var _a;
|
|
19
19
|
(_a = this.articleClick) === null || _a === void 0 ? void 0 : _a.emit(this.article);
|
|
20
|
-
} }, index.h("div", { class: "ratio ratio-
|
|
20
|
+
} }, index.h("div", { class: "ratio ratio-16x9 overflow-hidden" }, index.h("img", { class: "object-fit-cover", style: { 'min-height': '15rem' }, alt: "Article image", src: (_b = (_a = this.article.attributes.optimizedListImage) !== null && _a !== void 0 ? _a : this.article.attributes.optimizedImage) !== null && _b !== void 0 ? _b : this.article.attributes.image }), index.h("div", { class: "card-img-overlay d-flex justify-content-end" })), index.h("div", { class: "card-body" }, index.h("h5", { class: "card-title" }, this.article.attributes.name), index.h("p", { class: "card-text" }, this.article.attributes.excerpt))));
|
|
21
21
|
}
|
|
22
22
|
};
|
|
23
23
|
AicoNewsListItem.style = aicoNewsListItemCss;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"aico-news-list-item.entry.cjs.js","mappings":";;;;;;AAAA,MAAM,mBAAmB,GAAG,EAAE;;MCQjB,gBAAgB;;;;;;IAK3B,MAAM;;QACJ,QACEA,
|
|
1
|
+
{"file":"aico-news-list-item.entry.cjs.js","mappings":";;;;;;AAAA,MAAM,mBAAmB,GAAG,EAAE;;MCQjB,gBAAgB;;;;;;IAK3B,MAAM;;QACJ,QACEA,iBAAK,KAAK,EAAC,oBAAoB,EAC3B,KAAK,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,EAC5B,OAAO,EAAE;;gBACP,MAAA,IAAI,CAAC,YAAY,0CAAE,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;aACvC,IACHA,iBAAK,KAAK,EAAC,kCAAkC,IAC3CA,iBACE,KAAK,EAAC,kBAAkB,EACxB,KAAK,EAAE,EAAE,YAAY,EAAE,OAAO,EAAE,EAChC,GAAG,EAAC,eAAe,EACnB,GAAG,EAAE,MAAA,MAAA,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,kBAAkB,mCAAI,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,cAAc,mCAAI,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,KAAK,GAC1H,EACFA,iBAAK,KAAK,EAAC,6CAA6C,GAA0C,CAC9F,EACNA,iBAAK,KAAK,EAAC,WAAW,IACpBA,gBAAI,KAAK,EAAC,YAAY,IAAE,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,CAAM,EAC1DA,eAAG,KAAK,EAAC,WAAW,IAAE,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,OAAO,CAAK,CACtD,CACF,EACN;KACH;;;;;;","names":["h"],"sources":["src/components/aico-news-list-item/aico-news-list-item.css?tag=aico-news-list-item&encapsulation=scoped","src/components/aico-news-list-item/aico-news-list-item.tsx"],"sourcesContent":["","import { Component, Prop, Event, EventEmitter, h } from '@stencil/core';\nimport { Article } from '../../model/Article';\n\n@Component({\n tag: 'aico-news-list-item',\n styleUrl: 'aico-news-list-item.css',\n scoped: true,\n})\nexport class AicoNewsListItem {\n @Prop() article!: Article;\n\n @Event() articleClick?: EventEmitter<Article>;\n\n render() {\n return (\n <div class=\"card h-100 pe-auto\"\n style={{ cursor: 'pointer' }}\n onClick={() => {\n this.articleClick?.emit(this.article);\n }}>\n <div class=\"ratio ratio-16x9 overflow-hidden\">\n <img\n class=\"object-fit-cover\"\n style={{ 'min-height': '15rem' }}\n alt=\"Article image\"\n src={this.article.attributes.optimizedListImage ?? this.article.attributes.optimizedImage ?? this.article.attributes.image}\n />\n <div class=\"card-img-overlay d-flex justify-content-end\">{/*TODO: set the date top-right?*/}</div>\n </div>\n <div class=\"card-body\">\n <h5 class=\"card-title\">{this.article.attributes.name}</h5>\n <p class=\"card-text\">{this.article.attributes.excerpt}</p>\n </div>\n </div>\n );\n }\n}\n"],"version":3}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-e52034b7.js');
|
|
6
|
-
const utils = require('./utils-
|
|
6
|
+
const utils = require('./utils-c1b7a052.js');
|
|
7
7
|
|
|
8
8
|
const aicoNewsListCss = "";
|
|
9
9
|
|
|
@@ -16,6 +16,7 @@ const AicoNewsList = class {
|
|
|
16
16
|
this.pageNumber = 1;
|
|
17
17
|
this.aicoUrl = undefined;
|
|
18
18
|
this.aicoBearerToken = undefined;
|
|
19
|
+
this.newsChannels = [];
|
|
19
20
|
this.nextButtonText = 'Next';
|
|
20
21
|
this.previousButtonText = 'Previous';
|
|
21
22
|
}
|
|
@@ -28,11 +29,11 @@ const AicoNewsList = class {
|
|
|
28
29
|
this.newsListFetchController.abort('disconnected');
|
|
29
30
|
}
|
|
30
31
|
async componentWillLoad() {
|
|
31
|
-
this.newsResponse = await utils.fetchNewsArticles(this.api, this.pageNumber, this.pageSize, this.newsListFetchController.signal);
|
|
32
|
+
this.newsResponse = await utils.fetchNewsArticles(this.api, this.pageNumber, this.pageSize, this.newsListFetchController.signal, this.newsChannels);
|
|
32
33
|
}
|
|
33
34
|
async componentWillUpdate() {
|
|
34
35
|
this.newsListFetchController = new AbortController();
|
|
35
|
-
this.newsResponse = await utils.fetchNewsArticles(this.api, this.pageNumber, this.pageSize, this.newsListFetchController.signal);
|
|
36
|
+
this.newsResponse = await utils.fetchNewsArticles(this.api, this.pageNumber, this.pageSize, this.newsListFetchController.signal, this.newsChannels);
|
|
36
37
|
}
|
|
37
38
|
render() {
|
|
38
39
|
var _a, _b, _c;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"aico-news-list.entry.cjs.js","mappings":";;;;;;;AAAA,MAAM,eAAe,GAAG,EAAE;;MCWb,YAAY;;;;QACN,aAAQ,GAAG,EAAE,CAAC;;0BAIT,CAAC;;;
|
|
1
|
+
{"file":"aico-news-list.entry.cjs.js","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,IAAI,CAAC,GAAG,IAAI,CAAC,UAAU,EAAE,CAAC,CAAC;QACjC,KAAK,IAAI,CAAC,GAAG,IAAI,CAAC,UAAU,GAAG,CAAC,EAAE,CAAC,IAAI,IAAI,CAAC,UAAU,GAAG,SAAS,EAAE,CAAC,IAAI,CAAC,EAAE;YAC1E,IAAI,CAAC,KAAK,MAAA,MAAA,IAAI,CAAC,YAAY,0CAAE,IAAI,CAAC,IAAI,CAAC,QAAQ,mCAAI,CAAC,CAAC,EAAE;gBACrD,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;aACpB;SACF;QAED,IAAI,IAAI,CAAC,UAAU,GAAG,SAAS,GAAG,CAAC,MAAA,MAAA,IAAI,CAAC,YAAY,0CAAE,IAAI,CAAC,IAAI,CAAC,QAAQ,mCAAI,CAAC,IAAI,CAAC,EAAE;YAClF,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;SACnB;QAED,IAAI,IAAI,CAAC,UAAU,GAAG,SAAS,IAAI,CAAC,MAAA,MAAA,IAAI,CAAC,YAAY,0CAAE,IAAI,CAAC,IAAI,CAAC,QAAQ,mCAAI,CAAC,IAAI,CAAC,EAAE;YACnF,KAAK,CAAC,IAAI,CAAC,GAAG,MAAA,IAAI,CAAC,YAAY,0CAAE,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;SACxD;QAED,OAAO,KAAK,CAAC;KACd;;;;;;","names":["fetchNewsArticles","h","Host"],"sources":["src/components/aico-news-list/aico-news-list.css?tag=aico-news-list&encapsulation=scoped","src/components/aico-news-list/aico-news-list.tsx"],"sourcesContent":["","import { Component, Event, EventEmitter, Host, Prop, State, h } from '@stencil/core';\nimport { fetchNewsArticles } from '../../utils/utils';\nimport { NewsResponse } from '../../model/NewsResponse';\nimport { AicoApiRequestInfo } from '../../model/AicoApiRequestInfo';\nimport { Article } from '../../model/Article';\n\n@Component({\n tag: 'aico-news-list',\n styleUrl: 'aico-news-list.css',\n scoped: true,\n})\nexport class AicoNewsList {\n private readonly pageSize = 16;\n\n @State() newsResponse?: NewsResponse;\n\n @State() pageNumber = 1;\n\n @Prop() aicoUrl!: string;\n\n @Prop() aicoBearerToken!: string;\n\n @Prop() newsChannels: string[] = [];\n\n @Prop() nextButtonText: string = 'Next';\n\n @Prop() previousButtonText: string = 'Previous';\n\n @Event() articleClick?: EventEmitter<Article>;\n\n private api?: AicoApiRequestInfo;\n private newsListFetchController?: AbortController;\n\n connectedCallback() {\n this.newsListFetchController = new AbortController();\n this.pageNumber = 1;\n\n this.api = { baseApi: this.aicoUrl, bearerToken: this.aicoBearerToken };\n }\n\n disconnectedCallback() {\n this.newsListFetchController!.abort('disconnected');\n }\n\n async componentWillLoad(): Promise<void> {\n this.newsResponse = await fetchNewsArticles(this.api!, this.pageNumber, this.pageSize, this.newsListFetchController!.signal, this.newsChannels);\n }\n\n async componentWillUpdate(): Promise<void> {\n this.newsListFetchController = new AbortController();\n this.newsResponse = await fetchNewsArticles(this.api!, this.pageNumber, this.pageSize, this.newsListFetchController.signal, this.newsChannels);\n }\n\n render() {\n return (\n <Host>\n <div class=\"row row-cols-1 row-cols-sm-2 row-cols-lg-4 g-4 mb-4\">\n {this.newsResponse?.data.map(article => (\n <div class=\"col\">\n <aico-news-list-item\n article={article}\n onArticleClick={e => {\n this.articleClick?.emit(e.detail);\n }}\n />\n </div>\n ))}\n </div>\n <nav class=\"w-100\" aria-label=\"News navigation\">\n <ul class=\"pagination justify-content-center\">\n <li\n class={`page-item page-link user-select-none d-flex align-items-center ${!this.newsResponse?.links.prev ? 'disabled' : ''}`}\n style={{ cursor: 'pointer' }}\n onClick={() => {\n if (this.pageNumber > 1) {\n this.pageNumber -= 1;\n }\n\n return false;\n }}\n >\n <svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"currentColor\" class=\"bi bi-chevron-left me-1 fs-4\" style={{ width: '1em', height: '1em' }} viewBox=\"0 0 16 16\">\n <path fill-rule=\"evenodd\" d=\"M11.354 1.646a.5.5 0 0 1 0 .708L5.707 8l5.647 5.646a.5.5 0 0 1-.708.708l-6-6a.5.5 0 0 1 0-.708l6-6a.5.5 0 0 1 .708 0\" />\n </svg>\n {this.previousButtonText}\n </li>\n {this.getViewablePages().map(page => (\n <li\n class={`page-item page-link user-select-none ${page === '...' ? 'disabled' : Number(page) === this.pageNumber ? 'active' : ''}`}\n style={{ cursor: 'pointer' }}\n onClick={() => {\n if (page !== '...') {\n this.pageNumber = Number(page);\n }\n return false;\n }}\n >\n {page}\n </li>\n ))}\n <li\n class={`page-item page-link user-select-none d-flex align-items-center ${!this.newsResponse?.links.next ? 'disabled' : ''}`}\n style={{ cursor: 'pointer' }}\n onClick={() => {\n if (this.newsResponse?.meta.page.lastPage && this.pageNumber < this.newsResponse?.meta.page.lastPage) {\n this.pageNumber += 1;\n }\n }}\n >\n {this.nextButtonText}\n <svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"currentColor\" class=\"bi bi-chevron-right ms-1 fs-4\" style={{ width: '1em', height: '1em' }} viewBox=\"0 0 16 16\">\n <path fill-rule=\"evenodd\" d=\"M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708\" />\n </svg>\n </li>\n </ul>\n </nav>\n </Host>\n );\n }\n\n private getViewablePages(lookAhead: number = 2) {\n const pages: string[] = [];\n if (this.pageNumber - lookAhead >= 2) {\n pages.push('1');\n }\n\n if (this.pageNumber - lookAhead > 2) {\n pages.push('...');\n }\n\n for (let i = this.pageNumber - lookAhead; i < this.pageNumber; i += 1) {\n if (i >= 1) {\n pages.push(`${i}`);\n }\n }\n\n pages.push(`${this.pageNumber}`);\n for (let i = this.pageNumber + 1; i <= this.pageNumber + lookAhead; i += 1) {\n if (i <= (this.newsResponse?.meta.page.lastPage ?? 0)) {\n pages.push(`${i}`);\n }\n }\n\n if (this.pageNumber + lookAhead < (this.newsResponse?.meta.page.lastPage ?? 0) - 1) {\n pages.push('...');\n }\n\n if (this.pageNumber + lookAhead <= (this.newsResponse?.meta.page.lastPage ?? 0) - 1) {\n pages.push(`${this.newsResponse?.meta.page.lastPage}`);\n }\n\n return pages;\n }\n}\n"],"version":3}
|
|
@@ -22,12 +22,14 @@ const AicoTitleContent = class {
|
|
|
22
22
|
constructor(hostRef) {
|
|
23
23
|
index.registerInstance(this, hostRef);
|
|
24
24
|
this.content = undefined;
|
|
25
|
+
this.locale = 'de';
|
|
25
26
|
}
|
|
26
27
|
render() {
|
|
27
|
-
var _a;
|
|
28
|
+
var _a, _b;
|
|
28
29
|
if (!this.content.size || this.content.translations.length === 0) {
|
|
29
30
|
return index.h("aico-no-content", null);
|
|
30
31
|
}
|
|
32
|
+
const translation = (_a = this.content.translations.find(translation => translation.locale === this.locale)) !== null && _a !== void 0 ? _a : null;
|
|
31
33
|
const CustomTag = this.content.size;
|
|
32
34
|
const defaultColor = 'black';
|
|
33
35
|
const styles = {
|
|
@@ -35,10 +37,10 @@ const AicoTitleContent = class {
|
|
|
35
37
|
};
|
|
36
38
|
if (this.content.hasUnderscore) {
|
|
37
39
|
styles['text-decoration-line'] = 'underline';
|
|
38
|
-
styles['text-decoration-color'] = (
|
|
40
|
+
styles['text-decoration-color'] = (_b = this.content.underscoreColor) !== null && _b !== void 0 ? _b : defaultColor;
|
|
39
41
|
styles['text-decoration-thickness'] = '3px';
|
|
40
42
|
}
|
|
41
|
-
return (index.h(CustomTag, null, index.h("span", { style: styles },
|
|
43
|
+
return (index.h(CustomTag, null, index.h("span", { style: styles }, translation === null || translation === void 0 ? void 0 : translation.title)));
|
|
42
44
|
}
|
|
43
45
|
};
|
|
44
46
|
AicoTitleContent.style = aicoTitleContentCss;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"aico-no-content.aico-title-content.entry.cjs.js","mappings":";;;;;;AAAA,MAAM,gBAAgB,GAAG,sCAAsC;;MCOlD,aAAa;;;;IACxB,MAAM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WAAW,CAAE,KAAK,CAAQ,CACtC,EACZ;KACH;;;;;;;","names":["h"],"sources":["src/components/content/aico-no-content/aico-no-content.css?tag=aico-no-content&encapsulation=scoped","src/components/content/aico-no-content/aico-no-content.tsx","src/components/content/aico-title-content/aico-title-content.css?tag=aico-title-content&encapsulation=scoped","src/components/content/aico-title-content/aico-title-content.tsx"],"sourcesContent":[":host {\n display: block;\n}\n","import { Component, h } from '@stencil/core';\n\n@Component({\n tag: 'aico-no-content',\n styleUrl: 'aico-no-content.css',\n scoped: true,\n})\nexport class AicoNoContent {\n render() {\n return (\n <div>\n <span>The content cannot be rendered because it is either malformed or not supported.</span>\n </div>\n );\n }\n}\n",":host {\n display: block;\n}\n","import { Component, Prop, h } from '@stencil/core';\nimport { TitleContent } from '../../../model/article/content/TitleContent';\n\n@Component({\n tag: 'aico-title-content',\n styleUrl: 'aico-title-content.css',\n scoped: true,\n})\nexport class AicoTitleContent {\n @Prop() content!: TitleContent;\n\n @Prop() locale: string = 'de';\n\n render() {\n if (!this.content.size || this.content.translations.length === 0) {\n return <aico-no-content />;\n }\n\n const translation = this.content.translations.find(translation => translation.locale === this.locale) ?? null;\n const CustomTag = this.content.size;\n\n const defaultColor = 'black';\n const styles: { [key: string]: string } = {\n color: this.content.titleColor ? this.content.titleColor : defaultColor,\n };\n\n if (this.content.hasUnderscore) {\n styles['text-decoration-line'] = 'underline';\n styles['text-decoration-color'] = this.content.underscoreColor ?? defaultColor;\n styles['text-decoration-thickness'] = '3px';\n }\n\n return (\n <CustomTag>\n <span style={styles}>{translation?.title}</span>\n </CustomTag>\n );\n }\n}\n"],"version":3}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-e52034b7.js');
|
|
6
|
-
const utils = require('./utils-
|
|
6
|
+
const utils = require('./utils-c1b7a052.js');
|
|
7
7
|
const slick = require('./slick-d0dfbd94.js');
|
|
8
8
|
|
|
9
9
|
const aicoSpecialNewsCarouselCss = ".slick-slide.sc-aico-special-news-carousel>div.sc-aico-special-news-carousel{height:100% !important}";
|
|
@@ -15,6 +15,7 @@ const AicoSpecialNewsCarousel = class {
|
|
|
15
15
|
this.newsResponse = undefined;
|
|
16
16
|
this.aicoUrl = undefined;
|
|
17
17
|
this.aicoBearerToken = undefined;
|
|
18
|
+
this.newsChannels = [];
|
|
18
19
|
this.numberOfArticles = 6;
|
|
19
20
|
}
|
|
20
21
|
connectedCallback() {
|
|
@@ -25,11 +26,11 @@ const AicoSpecialNewsCarousel = class {
|
|
|
25
26
|
this.newsListFetchController.abort('disconnected');
|
|
26
27
|
}
|
|
27
28
|
async componentWillLoad() {
|
|
28
|
-
this.newsResponse = await utils.fetchSpecialNewsArticles(this.api, 1, this.numberOfArticles, this.newsListFetchController.signal);
|
|
29
|
+
this.newsResponse = await utils.fetchSpecialNewsArticles(this.api, 1, this.numberOfArticles, this.newsListFetchController.signal, this.newsChannels);
|
|
29
30
|
}
|
|
30
31
|
async componentWillUpdate() {
|
|
31
32
|
this.newsListFetchController = new AbortController();
|
|
32
|
-
this.newsResponse = await utils.fetchSpecialNewsArticles(this.api, 1, this.numberOfArticles, this.newsListFetchController.signal);
|
|
33
|
+
this.newsResponse = await utils.fetchSpecialNewsArticles(this.api, 1, this.numberOfArticles, this.newsListFetchController.signal, this.newsChannels);
|
|
33
34
|
}
|
|
34
35
|
componentDidLoad() {
|
|
35
36
|
slick.jquery('.carousel').slick({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"aico-special-news-carousel.entry.cjs.js","mappings":";;;;;;;;AAAA,MAAM,0BAA0B,GAAG,sGAAsG;;MCc5H,uBAAuB;;;;;;;
|
|
1
|
+
{"file":"aico-special-news-carousel.entry.cjs.js","mappings":";;;;;;;;AAAA,MAAM,0BAA0B,GAAG,sGAAsG;;MCc5H,uBAAuB;;;;;;;4BAOD,EAAE;gCAEA,CAAC;;IAOpC,iBAAiB;QACf,IAAI,C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OAAO,CAAC,UAAU,CAAC,gBAAgB,GAAG,GAAG,QAAQ,CAAC;YAC1G,QACEA,iBAAK,KAAK,EAAC,6BAA6B,IACtCA,iBAAK,KAAK,EAAC,WAAW,IACpBA,gBAAI,KAAK,EAAC,uCAAuC,IAC/CA,eACE,KAAK,EAAC,iCAAiC,EACvC,IAAI,EAAC,GAAG,EACR,OAAO,EAAE,CAAC;;oBACR,CAAC,CAAC,cAAc,EAAE,CAAC;oBACnB,MAAA,IAAI,CAAC,cAAc,0CAAE,IAAI,CAAC,OAAO,CAAC,CAAC;iBACpC,IAEA,OAAO,CAAC,UAAU,CAAC,IAAI,CACtB,CACD,CACD,EACNA,iBAAK,KAAK,EAAC,0BAA0B,EAAC,KAAK,EAAE,EAAE,WAAW,EAAE,KAAK,EAAE,IACjEA,iBACE,KAAK,EAAC,kCAAkC,EACxC,KAAK,EAAE,EAAE,iBAAiB,EAAE,GAAG,MAAM,IAAI,MAAM,EAAE,EAAE,YAAY,EAAE,OAAO,EAAE,EAC1E,GAAG,EAAC,cAAc,eACP,MAAA,OAAO,CAAC,UAAU,CAAC,cAAc,mCAAI,OAAO,CAAC,UAAU,CAAC,KAAK,GACxE,CACE,CACF,EACN;SACH,CAAC,CACE,EACN;KACH;;;;;;","names":["fetchSpecialNewsArticles","$","h"],"sources":["src/components/aico-special-news-carousel/aico-special-news-carousel.css?tag=aico-special-news-carousel&encapsulation=scoped","src/components/aico-special-news-carousel/aico-special-news-carousel.tsx"],"sourcesContent":[".slick-slide > div {\n height: 100% !important;\n}\n","import { Component, Event, EventEmitter, Prop, State, h } from '@stencil/core';\nimport type { NewsResponse } from '../../model/NewsResponse';\nimport type { AicoApiRequestInfo } from '../../model/AicoApiRequestInfo';\nimport type { Article } from '../../model/Article';\nimport { fetchSpecialNewsArticles } from '../../utils/utils';\n\nimport $ from 'jquery';\nimport 'slick-carousel';\n\n@Component({\n tag: 'aico-special-news-carousel',\n styleUrl: 'aico-special-news-carousel.css',\n scoped: true,\n})\nexport class AicoSpecialNewsCarousel {\n @State() newsResponse!: NewsResponse;\n\n @Prop() aicoUrl!: string;\n\n @Prop() aicoBearerToken!: string;\n\n @Prop() newsChannels: string[] = [];\n\n @Prop() numberOfArticles: number = 6;\n\n @Event() articleClicked?: EventEmitter<Article>;\n\n private api?: AicoApiRequestInfo;\n private newsListFetchController?: AbortController;\n\n connectedCallback() {\n this.newsListFetchController = new AbortController();\n this.api = { baseApi: this.aicoUrl, bearerToken: this.aicoBearerToken };\n }\n\n disconnectedCallback() {\n this.newsListFetchController!.abort('disconnected');\n }\n\n async componentWillLoad(): Promise<void> {\n this.newsResponse = await fetchSpecialNewsArticles(this.api!, 1, this.numberOfArticles, this.newsListFetchController!.signal, this.newsChannels);\n }\n\n async componentWillUpdate(): Promise<void> {\n this.newsListFetchController = new AbortController();\n this.newsResponse = await fetchSpecialNewsArticles(this.api!, 1, this.numberOfArticles, this.newsListFetchController.signal, this.newsChannels);\n }\n\n componentDidLoad() {\n $('.carousel').slick({\n autoplay: true,\n autoplaySpeed: 6000,\n dots: true,\n arrows: false,\n pauseOnDotsHover: true,\n });\n }\n\n render() {\n return (\n <div class=\"carousel\">\n {this.newsResponse.data.map(article => {\n const focusX = article.attributes.focusXPercentage ? `${article.attributes.focusXPercentage}%` : 'center';\n const focusY = article.attributes.focusYPercentage ? `${article.attributes.focusYPercentage}%` : 'center';\n return (\n <div class=\"carousel-item card border-0\">\n <div class=\"card-body\">\n <h5 class=\"card-title text-center text-uppercase\">\n <a\n class=\"text-reset text-decoration-none\"\n href=\"#\"\n onClick={e => {\n e.preventDefault();\n this.articleClicked?.emit(article);\n }}\n >\n {article.attributes.name}\n </a>\n </h5>\n </div>\n <div class=\"ratio ratio-16x9 mx-auto\" style={{ 'max-width': '50%' }}>\n <img\n class=\"card-img-bottom object-fit-cover\"\n style={{ 'object-position': `${focusX} ${focusY}`, 'min-height': '15rem' }}\n alt=\"News Picture\"\n data-lazy={article.attributes.optimizedImage ?? article.attributes.image}\n />\n </div>\n </div>\n );\n })}\n </div>\n );\n }\n}\n"],"version":3}
|
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -6,7 +6,7 @@ const index = require('./index-e52034b7.js');
|
|
|
6
6
|
|
|
7
7
|
const defineCustomElements = (win, options) => {
|
|
8
8
|
if (typeof window === 'undefined') return undefined;
|
|
9
|
-
return index.bootstrapLazy([["aico-fetch-article-detail.cjs",[[2,"aico-fetch-article-detail",{"aicoUrl":[1,"aico-url"],"aicoBearerToken":[1,"aico-bearer-token"],"articleId":[1,"article-id"],"articleUrlHandle":[1,"article-url-handle"],"article":[32]}]]],["aico-news-list.cjs",[[2,"aico-news-list",{"aicoUrl":[1,"aico-url"],"aicoBearerToken":[1,"aico-bearer-token"],"nextButtonText":[1,"next-button-text"],"previousButtonText":[1,"previous-button-text"],"newsResponse":[32],"pageNumber":[32]}]]],["aico-asking-list-content.cjs",[[6,"aico-asking-list-content"]]],["aico-collection-content.cjs",[[6,"aico-collection-content"]]],["aico-special-news-carousel.cjs",[[2,"aico-special-news-carousel",{"aicoUrl":[1,"aico-url"],"aicoBearerToken":[1,"aico-bearer-token"],"numberOfArticles":[2,"number-of-articles"],"newsResponse":[32]}]]],["aico-no-content_2.cjs",[[2,"aico-title-content",{"content":[16]}],[2,"aico-no-content"]]],["aico-album-content_19.cjs",[[2,"aico-bullet-content",{"content":[16]}],[2,"aico-carousel-content",{"content":[16],"hasArrows":[4,"has-arrows"]}],[2,"aico-content-card-content",{"content":[16]}],[2,"aico-heading-content",{"content":[16]}],[2,"aico-table-content",{"content":[16]}],[2,"aico-text-content",{"content":[16]}],[2,"aico-upload-content",{"content":[16]}],[2,"aico-video-content",{"content":[16]}],[2,"aico-
|
|
9
|
+
return index.bootstrapLazy([["aico-fetch-article-detail.cjs",[[2,"aico-fetch-article-detail",{"aicoUrl":[1,"aico-url"],"aicoBearerToken":[1,"aico-bearer-token"],"locale":[1],"articleId":[1,"article-id"],"articleUrlHandle":[1,"article-url-handle"],"article":[32]}]]],["aico-news-list.cjs",[[2,"aico-news-list",{"aicoUrl":[1,"aico-url"],"aicoBearerToken":[1,"aico-bearer-token"],"newsChannels":[16],"nextButtonText":[1,"next-button-text"],"previousButtonText":[1,"previous-button-text"],"newsResponse":[32],"pageNumber":[32]}]]],["aico-asking-list-content.cjs",[[6,"aico-asking-list-content"]]],["aico-collection-content.cjs",[[6,"aico-collection-content"]]],["aico-special-news-carousel.cjs",[[2,"aico-special-news-carousel",{"aicoUrl":[1,"aico-url"],"aicoBearerToken":[1,"aico-bearer-token"],"newsChannels":[16],"numberOfArticles":[2,"number-of-articles"],"newsResponse":[32]}]]],["aico-no-content_2.cjs",[[2,"aico-title-content",{"content":[16],"locale":[1]}],[2,"aico-no-content"]]],["aico-album-content_19.cjs",[[2,"aico-bullet-content",{"content":[16],"locale":[1]}],[2,"aico-carousel-content",{"content":[16],"hasArrows":[4,"has-arrows"],"locale":[1]}],[2,"aico-content-card-content",{"content":[16],"locale":[1]}],[2,"aico-heading-content",{"content":[16],"locale":[1]}],[2,"aico-table-content",{"content":[16],"locale":[1]}],[2,"aico-text-content",{"content":[16],"locale":[1]}],[2,"aico-upload-content",{"content":[16],"locale":[1]}],[2,"aico-video-content",{"content":[16],"locale":[1]}],[2,"aico-album-content",{"content":[16]}],[2,"aico-asking-content",{"content":[16],"locale":[1]}],[2,"aico-block-quote-content",{"content":[16],"locale":[1]}],[2,"aico-divider-content",{"content":[16],"locale":[1]}],[2,"aico-document-content",{"content":[16],"locale":[1]}],[2,"aico-faq-content",{"content":[16],"locale":[1]}],[2,"aico-html-content",{"content":[16],"locale":[1]}],[2,"aico-link-content",{"content":[16],"locale":[1]}],[2,"aico-news-content",{"content":[16]}],[2,"aico-page-content",{"content":[16],"locale":[1]}],[2,"aico-testimonial-content",{"content":[16]}]]],["aico-article-detail.cjs",[[2,"aico-article-detail",{"article":[16],"locale":[1]}]]],["aico-news-list-item.cjs",[[2,"aico-news-list-item",{"article":[16]}]]]], options);
|
|
10
10
|
};
|
|
11
11
|
|
|
12
12
|
exports.setNonce = index.setNonce;
|
|
@@ -13,26 +13,32 @@ const getAuthenticatedRequest = (api, route, query, signal) => {
|
|
|
13
13
|
});
|
|
14
14
|
};
|
|
15
15
|
|
|
16
|
-
async function fetchNewsArticles(api, page, size, signal) {
|
|
16
|
+
async function fetchNewsArticles(api, page, size, signal, newsChannels = []) {
|
|
17
17
|
const queryParams = new URLSearchParams();
|
|
18
18
|
queryParams.set('page[number]', String(page));
|
|
19
19
|
queryParams.set('page[size]', String(size));
|
|
20
|
+
queryParams.set('sort', '-publishDate');
|
|
20
21
|
queryParams.set('filter[isActive]', '1');
|
|
21
22
|
queryParams.set('filter[excludeTag][]', 'Eisnull');
|
|
22
|
-
|
|
23
|
+
for (const newsChannel of newsChannels) {
|
|
24
|
+
queryParams.set('filter[channel][]', newsChannel);
|
|
25
|
+
}
|
|
23
26
|
const request = getAuthenticatedRequest(api, 'news', queryParams, signal);
|
|
24
27
|
const response = await fetch(request);
|
|
25
28
|
return await response.json();
|
|
26
29
|
}
|
|
27
|
-
async function fetchSpecialNewsArticles(api, page, size, signal) {
|
|
30
|
+
async function fetchSpecialNewsArticles(api, page, size, signal, newsChannels = []) {
|
|
28
31
|
const queryParams = new URLSearchParams();
|
|
29
32
|
queryParams.set('page[number]', String(page));
|
|
30
33
|
queryParams.set('page[size]', String(size));
|
|
34
|
+
queryParams.set('sort', '-publishDate');
|
|
31
35
|
queryParams.set('filter[isActive]', '1');
|
|
32
36
|
queryParams.set('filter[isSpecialArticle]', '1');
|
|
33
37
|
queryParams.set('filter[isLightVersion]', 'true');
|
|
34
38
|
queryParams.set('filter[excludeTag][]', 'Eisnull');
|
|
35
|
-
|
|
39
|
+
for (const newsChannel of newsChannels) {
|
|
40
|
+
queryParams.set('filter[channel][]', newsChannel);
|
|
41
|
+
}
|
|
36
42
|
const request = getAuthenticatedRequest(api, 'news', queryParams, signal);
|
|
37
43
|
const response = await fetch(request);
|
|
38
44
|
return await response.json();
|
|
@@ -98,4 +104,4 @@ exports.getImageWidthPrc = getImageWidthPrc;
|
|
|
98
104
|
exports.getYoutubeURL = getYoutubeURL;
|
|
99
105
|
exports.strIsNullOrEmptyOrWhitespace = strIsNullOrEmptyOrWhitespace;
|
|
100
106
|
|
|
101
|
-
//# sourceMappingURL=utils-
|
|
107
|
+
//# sourceMappingURL=utils-c1b7a052.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"utils-c1b7a052.js","mappings":";;AAKO,MAAM,uBAAuB,GAAG,CAAC,WAAmB;IACzD,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE,CAAC;IAC9B,OAAO,CAAC,MAAM,CAAC,QAAQ,EAAE,0BAA0B,CAAC,CAAC;IACrD,OAAO,CAAC,MAAM,CAAC,eAAe,EAAE,UAAU,WAAW,EAAE,CAAC,CAAC;IACzD,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC;AAEK,MAAM,uBAAuB,GAAG,CAAC,GAAuB,EAAE,KAAa,EAAE,KAAsB,EAAE,MAAoB;IAC1H,OAAO,IAAI,OAAO,CAAC,IAAI,GAAG,CAAC,GAAG,KAAK,IAAI,KAAK,CAAC,QAAQ,EAAE,EAAE,EAAE,GAAG,CAAC,OAAO,CAAC,EAAE;QACvE,OAAO,EAAE,uBAAuB,CAAC,GAAG,CAAC,WAAW,CAAC;QACjD,MAAM;KACP,CAAC,CAAC;AACL,CAAC;;ACbM,eAAe,iBAAiB,CAAC,GAAuB,EAAE,IAAY,EAAE,IAAY,EAAE,MAAmB,EAAE,eAAyB,EAAE;IAC3I,MAAM,WAAW,GAAG,IAAI,eAAe,EAAE,CAAC;IAC1C,WAAW,CAAC,GAAG,CAAC,cAAc,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;IAC9C,WAAW,CAAC,GAAG,CAAC,YAAY,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;IAC5C,WAAW,CAAC,GAAG,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC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Aa,CAAC,GAAW;IACvC,MAAM,MAAM,GAAG,2DAA2D,CAAC;IAC3E,MAAM,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IAChC,IAAI,KAAK,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,IAAI,EAAE,EAAE;QAClC,OAAO,iCAAiC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;KACpD;IAED,OAAO,IAAI,CAAC;AACd,CAAC;SAEe,4BAA4B,CAAC,GAAmB;IAC9D,IAAI,CAAC,GAAG,IAAI,GAAG,KAAK,GAAG,EAAE;QACvB,OAAO,IAAI,CAAC;KACb;IAED,OAAO,KAAK,CAAC;AACf,CAAC;SAEe,QAAQ,CAAC,UAAsC;IAC7D,MAAM,OAAO,GAAa,EAAE,CAAC;IAC7B,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE;QAC5C,IAAI,GAAG,CAAC,CAAC,CAAC,EAAE;YACV,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;SACtB;KACF;IAED,OAAO,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC3B;;;;;;;;;;;","names":[],"sources":["src/model/AicoApiRequestInfo.ts","src/utils/utils.ts"],"sourcesContent":["export type AicoApiRequestInfo = {\n baseApi: string;\n bearerToken: string;\n};\n\nexport const getAuthenticatedHeaders = (bearerToken: string): Headers => {\n const headers = new Headers();\n headers.append('Accept', 'application/vnd.api+json');\n headers.append('Authorization', `Bearer ${bearerToken}`);\n return headers;\n};\n\nexport const getAuthenticatedRequest = (api: AicoApiRequestInfo, route: string, query: URLSearchParams, signal?: AbortSignal): Request => {\n return new Request(new URL(`${route}?${query.toString()}`, api.baseApi), {\n headers: getAuthenticatedHeaders(api.bearerToken),\n signal,\n });\n};\n","import { Article } from '../components';\nimport { AicoApiRequestInfo, getAuthenticatedHeaders, getAuthenticatedRequest } from '../model/AicoApiRequestInfo';\nimport { NewsResponse } from '../model/NewsResponse';\n\nexport async function fetchNewsArticles(api: AicoApiRequestInfo, page: number, size: number, signal: AbortSignal, newsChannels: string[] = []): Promise<NewsResponse> {\n const queryParams = new URLSearchParams();\n queryParams.set('page[number]', String(page));\n queryParams.set('page[size]', String(size));\n queryParams.set('sort', '-publishDate');\n queryParams.set('filter[isActive]', '1');\n queryParams.set('filter[excludeTag][]', 'Eisnull');\n for (const newsChannel of newsChannels) {\n queryParams.set('filter[channel][]', newsChannel);\n }\n\n const request = getAuthenticatedRequest(api, 'news', queryParams, signal);\n const response = await fetch(request);\n return await response.json();\n}\n\nexport async function fetchSpecialNewsArticles(api: AicoApiRequestInfo, page: number, size: number, signal: AbortSignal, newsChannels: string[] = []): Promise<NewsResponse> {\n const queryParams = new URLSearchParams();\n queryParams.set('page[number]', String(page));\n queryParams.set('page[size]', String(size));\n queryParams.set('sort', '-publishDate');\n queryParams.set('filter[isActive]', '1');\n queryParams.set('filter[isSpecialArticle]', '1');\n queryParams.set('filter[isLightVersion]', 'true');\n queryParams.set('filter[excludeTag][]', 'Eisnull');\n for (const newsChannel of newsChannels) {\n queryParams.set('filter[channel][]', newsChannel);\n }\n\n const request = getAuthenticatedRequest(api, 'news', queryParams, signal);\n const response = await fetch(request);\n return await response.json();\n}\n\nexport async function fetchNewsArticle(api: AicoApiRequestInfo, articleId: string, signal: AbortSignal): Promise<Article> {\n const request = getAuthenticatedRequest(api, `news/${articleId}`, new URLSearchParams(), signal);\n const response = await fetch(request);\n const article = await response.json();\n return article.data;\n}\n\nexport async function fetchNewsArticleByHandle(api: AicoApiRequestInfo, urlHandle: string, signal: AbortSignal): Promise<Article> {\n const queryParams = new URLSearchParams();\n queryParams.set('filter[urlHandle]', urlHandle);\n\n const request = getAuthenticatedRequest(api, 'news', queryParams, signal);\n const response = await fetch(request);\n const articles = await response.json();\n return articles.data[0];\n}\n\nexport async function fetchArticle(url: string, bearerToken: string, signal: AbortSignal): Promise<Article> {\n const request = new Request(new URL(url), {\n headers: getAuthenticatedHeaders(bearerToken),\n signal,\n });\n const response = await fetch(request);\n return await response.json();\n}\n\nexport function getImageWidthPrc(pictureSize?: string): string {\n switch (pictureSize) {\n case 'extra-small':\n return '28%';\n case 'small':\n return '40%';\n case 'large':\n return '80%';\n case 'extra large': // TODO: has - or not?\n return '100%';\n default:\n return '60%';\n }\n}\n\nexport function getYoutubeURL(url: string): string | null {\n const regExp = /.*(?:youtu.be\\/|v\\/|u\\/\\w\\/|embed\\/|watch\\?v=)([^#&?]*).*/;\n const match = url.match(regExp);\n if (match && match[1].length == 11) {\n return `https://www.youtube.com/embed/${match[1]}`;\n }\n\n return null;\n}\n\nexport function strIsNullOrEmptyOrWhitespace(str?: string | null): boolean {\n if (!str || str === ' ') {\n return true;\n }\n\n return false;\n}\n\nexport function getClass(conditions: { [key: string]: boolean }): string {\n const classes: string[] = [];\n for (const kvp of Object.entries(conditions)) {\n if (kvp[1]) {\n classes.push(kvp[0]);\n }\n }\n\n return classes.join(' ');\n}\n"],"version":3}
|