@aiconomy/aico-components 0.0.149 → 0.0.158

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 (57) hide show
  1. package/README.md +46 -19
  2. package/dist/aico-components/aico-components.esm.js +1 -1
  3. package/dist/aico-components/aico-components.esm.js.map +1 -1
  4. package/dist/aico-components/{p-01932a11.entry.js → p-076c2ca2.entry.js} +4 -4
  5. package/dist/aico-components/p-076c2ca2.entry.js.map +1 -0
  6. package/dist/cjs/{aico-album-content_26.cjs.entry.js → aico-album-content_27.cjs.entry.js} +88 -9
  7. package/dist/cjs/aico-album-content_27.cjs.entry.js.map +1 -0
  8. package/dist/cjs/aico-components.cjs.js +1 -1
  9. package/dist/cjs/loader.cjs.js +1 -1
  10. package/dist/collection/collection-manifest.json +1 -0
  11. package/dist/collection/components/aico-news-list/aico-news-list.css +2 -4
  12. package/dist/collection/components/aico-news-list/aico-news-list.js +2 -21
  13. package/dist/collection/components/aico-news-list/aico-news-list.js.map +1 -1
  14. package/dist/collection/components/aico-news-list-item/aico-news-list-item.js +2 -21
  15. package/dist/collection/components/aico-news-list-item/aico-news-list-item.js.map +1 -1
  16. package/dist/collection/components/aico-news-list-item/aico-news-list-item.stories.js +1 -0
  17. package/dist/collection/components/aico-news-list-item/aico-news-list-item.stories.js.map +1 -1
  18. package/dist/collection/components/aico-special-news-carousel/aico-special-news-carousel.js +2 -2
  19. package/dist/collection/components/aico-special-news-carousel/aico-special-news-carousel.js.map +1 -1
  20. package/dist/collection/components/aico-top-news-carousel/aico-top-news-carousel.css +12088 -0
  21. package/dist/collection/components/aico-top-news-carousel/aico-top-news-carousel.js +253 -0
  22. package/dist/collection/components/aico-top-news-carousel/aico-top-news-carousel.js.map +1 -0
  23. package/dist/collection/components/aico-top-news-carousel/aico-top-news-carousel.stories.js +30 -0
  24. package/dist/collection/components/aico-top-news-carousel/aico-top-news-carousel.stories.js.map +1 -0
  25. package/dist/collection/components/aico-top-news-carousel/test/aico-top-news-carousel.e2e.js +6 -0
  26. package/dist/collection/components/aico-top-news-carousel/test/aico-top-news-carousel.e2e.js.map +1 -0
  27. package/dist/collection/components/aico-top-news-carousel/test/aico-top-news-carousel.spec.js +6 -0
  28. package/dist/collection/components/aico-top-news-carousel/test/aico-top-news-carousel.spec.js.map +1 -0
  29. package/dist/collection/model/Article.js.map +1 -1
  30. package/dist/collection/utils/utils.js +17 -0
  31. package/dist/collection/utils/utils.js.map +1 -1
  32. package/dist/components/aico-news-list-item2.js +2 -4
  33. package/dist/components/aico-news-list-item2.js.map +1 -1
  34. package/dist/components/aico-news-list.js +2 -4
  35. package/dist/components/aico-news-list.js.map +1 -1
  36. package/dist/components/aico-special-news-carousel.js +2 -2
  37. package/dist/components/aico-special-news-carousel.js.map +1 -1
  38. package/dist/components/aico-top-news-carousel.d.ts +11 -0
  39. package/dist/components/aico-top-news-carousel.js +101 -0
  40. package/dist/components/aico-top-news-carousel.js.map +1 -0
  41. package/dist/components/utils.js +18 -1
  42. package/dist/components/utils.js.map +1 -1
  43. package/dist/esm/{aico-album-content_26.entry.js → aico-album-content_27.entry.js} +88 -10
  44. package/dist/esm/aico-album-content_27.entry.js.map +1 -0
  45. package/dist/esm/aico-components.js +1 -1
  46. package/dist/esm/loader.js +1 -1
  47. package/dist/types/components/aico-news-list/aico-news-list.d.ts +0 -4
  48. package/dist/types/components/aico-news-list-item/aico-news-list-item.d.ts +0 -1
  49. package/dist/types/components/aico-top-news-carousel/aico-top-news-carousel.d.ts +59 -0
  50. package/dist/types/components/aico-top-news-carousel/aico-top-news-carousel.stories.d.ts +7 -0
  51. package/dist/types/components.d.ts +96 -10
  52. package/dist/types/model/Article.d.ts +1 -0
  53. package/dist/types/utils/utils.d.ts +1 -0
  54. package/package.json +1 -1
  55. package/dist/aico-components/p-01932a11.entry.js.map +0 -1
  56. package/dist/cjs/aico-album-content_26.cjs.entry.js.map +0 -1
  57. package/dist/esm/aico-album-content_26.entry.js.map +0 -1
@@ -17,7 +17,7 @@ const patchBrowser = () => {
17
17
  };
18
18
 
19
19
  patchBrowser().then(options => {
20
- return index.bootstrapLazy([["aico-asking-list-content.cjs",[[6,"aico-asking-list-content"]]],["aico-collection-content.cjs",[[6,"aico-collection-content"]]],["aico-album-content_26.cjs",[[2,"aico-fetch-article-detail",{"aicoUrl":[1,"aico-url"],"aicoBearerToken":[1,"aico-bearer-token"],"locale":[1],"hideDateAndAuthor":[4,"hide-date-and-author"],"hideCategoryAndTags":[4,"hide-category-and-tags"],"articleId":[1,"article-id"],"articleUrlHandle":[1,"article-url-handle"],"article":[32]}],[2,"aico-news-list",{"aicoUrl":[1,"aico-url"],"aicoBearerToken":[1,"aico-bearer-token"],"newsChannels":[1,"news-channels"],"newsSellerIds":[1,"news-seller-ids"],"newsBrandIds":[1,"news-brand-ids"],"newsLanguageLocales":[1,"news-language-locales"],"pageSize":[2,"page-size"],"nextButtonText":[1,"next-button-text"],"previousButtonText":[1,"previous-button-text"],"locale":[1],"highlightSpecialArticles":[4,"highlight-special-articles"],"newsResponse":[32],"pageNumber":[32],"newsChannelsArr":[32],"newsSellerIdsArr":[32],"newsBrandIdsArr":[32],"newsLanguageLocalesArr":[32]}],[2,"aico-special-news-carousel",{"aicoUrl":[1,"aico-url"],"aicoBearerToken":[1,"aico-bearer-token"],"newsChannels":[1,"news-channels"],"newsSellerIds":[1,"news-seller-ids"],"newsBrandIds":[1,"news-brand-ids"],"newsLanguageLocales":[1,"news-language-locales"],"numberOfArticles":[2,"number-of-articles"],"locale":[1],"newsResponse":[32],"newsChannelsArr":[32],"newsSellerIdsArr":[32],"newsBrandIdsArr":[32],"newsLanguageLocalesArr":[32]}],[2,"aico-article-detail",{"article":[16],"locale":[1],"hideDateAndAuthor":[4,"hide-date-and-author"],"hideCategoryAndTags":[4,"hide-category-and-tags"]}],[2,"aico-news-list-item",{"article":[16],"articleIndex":[2,"article-index"],"highlightSpecialArticle":[4,"highlight-special-article"],"locale":[1]}],[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]}],[2,"aico-title-content",{"content":[16],"locale":[1]}],[2,"aico-no-content"]]]], options);
20
+ return index.bootstrapLazy([["aico-asking-list-content.cjs",[[6,"aico-asking-list-content"]]],["aico-collection-content.cjs",[[6,"aico-collection-content"]]],["aico-album-content_27.cjs",[[2,"aico-fetch-article-detail",{"aicoUrl":[1,"aico-url"],"aicoBearerToken":[1,"aico-bearer-token"],"locale":[1],"hideDateAndAuthor":[4,"hide-date-and-author"],"hideCategoryAndTags":[4,"hide-category-and-tags"],"articleId":[1,"article-id"],"articleUrlHandle":[1,"article-url-handle"],"article":[32]}],[2,"aico-news-list",{"aicoUrl":[1,"aico-url"],"aicoBearerToken":[1,"aico-bearer-token"],"newsChannels":[1,"news-channels"],"newsSellerIds":[1,"news-seller-ids"],"newsBrandIds":[1,"news-brand-ids"],"newsLanguageLocales":[1,"news-language-locales"],"pageSize":[2,"page-size"],"nextButtonText":[1,"next-button-text"],"previousButtonText":[1,"previous-button-text"],"locale":[1],"newsResponse":[32],"pageNumber":[32],"newsChannelsArr":[32],"newsSellerIdsArr":[32],"newsBrandIdsArr":[32],"newsLanguageLocalesArr":[32]}],[2,"aico-special-news-carousel",{"aicoUrl":[1,"aico-url"],"aicoBearerToken":[1,"aico-bearer-token"],"newsChannels":[1,"news-channels"],"newsSellerIds":[1,"news-seller-ids"],"newsBrandIds":[1,"news-brand-ids"],"newsLanguageLocales":[1,"news-language-locales"],"numberOfArticles":[2,"number-of-articles"],"locale":[1],"newsResponse":[32],"newsChannelsArr":[32],"newsSellerIdsArr":[32],"newsBrandIdsArr":[32],"newsLanguageLocalesArr":[32]}],[2,"aico-top-news-carousel",{"aicoUrl":[1,"aico-url"],"aicoBearerToken":[1,"aico-bearer-token"],"newsChannels":[1,"news-channels"],"newsSellerIds":[1,"news-seller-ids"],"newsBrandIds":[1,"news-brand-ids"],"newsLanguageLocales":[1,"news-language-locales"],"numberOfArticles":[2,"number-of-articles"],"locale":[1],"newsResponse":[32],"newsChannelsArr":[32],"newsSellerIdsArr":[32],"newsBrandIdsArr":[32],"newsLanguageLocalesArr":[32]}],[2,"aico-article-detail",{"article":[16],"locale":[1],"hideDateAndAuthor":[4,"hide-date-and-author"],"hideCategoryAndTags":[4,"hide-category-and-tags"]}],[2,"aico-news-list-item",{"article":[16],"articleIndex":[2,"article-index"],"locale":[1]}],[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]}],[2,"aico-title-content",{"content":[16],"locale":[1]}],[2,"aico-no-content"]]]], options);
21
21
  });
22
22
 
23
23
  exports.setNonce = index.setNonce;
@@ -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-asking-list-content.cjs",[[6,"aico-asking-list-content"]]],["aico-collection-content.cjs",[[6,"aico-collection-content"]]],["aico-album-content_26.cjs",[[2,"aico-fetch-article-detail",{"aicoUrl":[1,"aico-url"],"aicoBearerToken":[1,"aico-bearer-token"],"locale":[1],"hideDateAndAuthor":[4,"hide-date-and-author"],"hideCategoryAndTags":[4,"hide-category-and-tags"],"articleId":[1,"article-id"],"articleUrlHandle":[1,"article-url-handle"],"article":[32]}],[2,"aico-news-list",{"aicoUrl":[1,"aico-url"],"aicoBearerToken":[1,"aico-bearer-token"],"newsChannels":[1,"news-channels"],"newsSellerIds":[1,"news-seller-ids"],"newsBrandIds":[1,"news-brand-ids"],"newsLanguageLocales":[1,"news-language-locales"],"pageSize":[2,"page-size"],"nextButtonText":[1,"next-button-text"],"previousButtonText":[1,"previous-button-text"],"locale":[1],"highlightSpecialArticles":[4,"highlight-special-articles"],"newsResponse":[32],"pageNumber":[32],"newsChannelsArr":[32],"newsSellerIdsArr":[32],"newsBrandIdsArr":[32],"newsLanguageLocalesArr":[32]}],[2,"aico-special-news-carousel",{"aicoUrl":[1,"aico-url"],"aicoBearerToken":[1,"aico-bearer-token"],"newsChannels":[1,"news-channels"],"newsSellerIds":[1,"news-seller-ids"],"newsBrandIds":[1,"news-brand-ids"],"newsLanguageLocales":[1,"news-language-locales"],"numberOfArticles":[2,"number-of-articles"],"locale":[1],"newsResponse":[32],"newsChannelsArr":[32],"newsSellerIdsArr":[32],"newsBrandIdsArr":[32],"newsLanguageLocalesArr":[32]}],[2,"aico-article-detail",{"article":[16],"locale":[1],"hideDateAndAuthor":[4,"hide-date-and-author"],"hideCategoryAndTags":[4,"hide-category-and-tags"]}],[2,"aico-news-list-item",{"article":[16],"articleIndex":[2,"article-index"],"highlightSpecialArticle":[4,"highlight-special-article"],"locale":[1]}],[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]}],[2,"aico-title-content",{"content":[16],"locale":[1]}],[2,"aico-no-content"]]]], options);
9
+ return index.bootstrapLazy([["aico-asking-list-content.cjs",[[6,"aico-asking-list-content"]]],["aico-collection-content.cjs",[[6,"aico-collection-content"]]],["aico-album-content_27.cjs",[[2,"aico-fetch-article-detail",{"aicoUrl":[1,"aico-url"],"aicoBearerToken":[1,"aico-bearer-token"],"locale":[1],"hideDateAndAuthor":[4,"hide-date-and-author"],"hideCategoryAndTags":[4,"hide-category-and-tags"],"articleId":[1,"article-id"],"articleUrlHandle":[1,"article-url-handle"],"article":[32]}],[2,"aico-news-list",{"aicoUrl":[1,"aico-url"],"aicoBearerToken":[1,"aico-bearer-token"],"newsChannels":[1,"news-channels"],"newsSellerIds":[1,"news-seller-ids"],"newsBrandIds":[1,"news-brand-ids"],"newsLanguageLocales":[1,"news-language-locales"],"pageSize":[2,"page-size"],"nextButtonText":[1,"next-button-text"],"previousButtonText":[1,"previous-button-text"],"locale":[1],"newsResponse":[32],"pageNumber":[32],"newsChannelsArr":[32],"newsSellerIdsArr":[32],"newsBrandIdsArr":[32],"newsLanguageLocalesArr":[32]}],[2,"aico-special-news-carousel",{"aicoUrl":[1,"aico-url"],"aicoBearerToken":[1,"aico-bearer-token"],"newsChannels":[1,"news-channels"],"newsSellerIds":[1,"news-seller-ids"],"newsBrandIds":[1,"news-brand-ids"],"newsLanguageLocales":[1,"news-language-locales"],"numberOfArticles":[2,"number-of-articles"],"locale":[1],"newsResponse":[32],"newsChannelsArr":[32],"newsSellerIdsArr":[32],"newsBrandIdsArr":[32],"newsLanguageLocalesArr":[32]}],[2,"aico-top-news-carousel",{"aicoUrl":[1,"aico-url"],"aicoBearerToken":[1,"aico-bearer-token"],"newsChannels":[1,"news-channels"],"newsSellerIds":[1,"news-seller-ids"],"newsBrandIds":[1,"news-brand-ids"],"newsLanguageLocales":[1,"news-language-locales"],"numberOfArticles":[2,"number-of-articles"],"locale":[1],"newsResponse":[32],"newsChannelsArr":[32],"newsSellerIdsArr":[32],"newsBrandIdsArr":[32],"newsLanguageLocalesArr":[32]}],[2,"aico-article-detail",{"article":[16],"locale":[1],"hideDateAndAuthor":[4,"hide-date-and-author"],"hideCategoryAndTags":[4,"hide-category-and-tags"]}],[2,"aico-news-list-item",{"article":[16],"articleIndex":[2,"article-index"],"locale":[1]}],[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]}],[2,"aico-title-content",{"content":[16],"locale":[1]}],[2,"aico-no-content"]]]], options);
10
10
  };
11
11
 
12
12
  exports.setNonce = index.setNonce;
@@ -5,6 +5,7 @@
5
5
  "components/aico-news-list/aico-news-list.js",
6
6
  "components/aico-news-list-item/aico-news-list-item.js",
7
7
  "components/aico-special-news-carousel/aico-special-news-carousel.js",
8
+ "components/aico-top-news-carousel/aico-top-news-carousel.js",
8
9
  "components/content/aico-album-content/aico-album-content.js",
9
10
  "components/content/aico-asking-content/aico-asking-content.js",
10
11
  "components/content/aico-asking-list-content/aico-asking-list-content.js",
@@ -12083,18 +12083,16 @@ textarea.form-control-lg {
12083
12083
  -webkit-text-size-adjust: 100%;
12084
12084
  }
12085
12085
 
12086
-
12087
12086
  .newslist-grid-container {
12088
12087
  display: grid;
12089
12088
  grid-gap: 24px;
12090
12089
  grid-auto-flow: dense;
12091
-
12092
12090
  }
12091
+
12093
12092
  .row-span-2 {
12094
12093
  grid-row-end: span 2;
12095
12094
  }
12096
12095
 
12097
-
12098
12096
  @media (min-width: 768px) {
12099
12097
  .newslist-grid-container {
12100
12098
  grid-template-columns: repeat(2, 1fr);
@@ -12114,4 +12112,4 @@ textarea.form-control-lg {
12114
12112
  .newslist-grid-container {
12115
12113
  grid-auto-rows: 1fr;
12116
12114
  }
12117
- }
12115
+ }
@@ -18,7 +18,6 @@ export class AicoNewsList {
18
18
  this.nextButtonText = 'Next';
19
19
  this.previousButtonText = 'Previous';
20
20
  this.locale = 'de';
21
- this.highlightSpecialArticles = false;
22
21
  }
23
22
  connectedCallback() {
24
23
  this.newsListFetchController = new AbortController();
@@ -41,8 +40,8 @@ export class AicoNewsList {
41
40
  }
42
41
  render() {
43
42
  var _a, _b, _c;
44
- return (h(Host, null, h("div", { class: "newslist-grid-container mb-4" }, (_a = this.newsResponse) === null || _a === void 0 ? void 0 : _a.data.map((article, articleIndex) => {
45
- return (h("div", { class: `col ${this.highlightSpecialArticles && article.attributes.isSpecialArticle ? 'row-span-2 col-span-md-2' : ''}` }, h("aico-news-list-item", { article: article, articleIndex: articleIndex, onArticleClick: e => {
43
+ return (h(Host, null, h("div", { class: "newslist-grid-container mb-4" }, (_a = this.newsResponse) === null || _a === void 0 ? void 0 : _a.data.filter(article => !article.attributes.isTopNews).map((article, articleIndex) => {
44
+ return (h("div", { class: "col" }, h("aico-news-list-item", { article: article, articleIndex: articleIndex, onArticleClick: e => {
46
45
  var _a;
47
46
  (_a = this.articleClick) === null || _a === void 0 ? void 0 : _a.emit(e.detail);
48
47
  e.stopPropagation();
@@ -283,24 +282,6 @@ export class AicoNewsList {
283
282
  "attribute": "locale",
284
283
  "reflect": false,
285
284
  "defaultValue": "'de'"
286
- },
287
- "highlightSpecialArticles": {
288
- "type": "boolean",
289
- "mutable": false,
290
- "complexType": {
291
- "original": "boolean",
292
- "resolved": "boolean",
293
- "references": {}
294
- },
295
- "required": false,
296
- "optional": false,
297
- "docs": {
298
- "tags": [],
299
- "text": "Determines if the special articles are highlighted by taking more space."
300
- },
301
- "attribute": "highlight-special-articles",
302
- "reflect": false,
303
- "defaultValue": "false"
304
285
  }
305
286
  };
306
287
  }
@@ -1 +1 @@
1
- {"version":3,"file":"aico-news-list.js","sourceRoot":"","sources":["../../../src/components/aico-news-list/aico-news-list.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAgB,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AACrF,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAUpE,MAAM,OAAO,YAAY;;;0BAGD,CAAC;+BAEc,EAAE;gCAED,EAAE;+BAEH,EAAE;sCAEK,EAAE;;;4BAef,EAAE;6BAKD,EAAE;4BAKH,EAAE;mCAKK,EAAE;wBAKb,EAAE;8BAKI,MAAM;kCAKF,UAAU;sBAOtB,IAAI;wCAYe,KAAK;;IAKjD,iBAAiB;QACf,IAAI,CAAC,uBAAuB,GAAG,IAAI,eAAe,EAAE,CAAC;QACrD,IAAI,CAAC,UAAU,GAAG,CAAC,CAAC;QAEpB,IAAI,CAAC,GAAG,GAAG,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,WAAW,EAAE,IAAI,CAAC,eAAe,EAAE,CAAC;QAExE,IAAI,CAAC,eAAe,GAAG,YAAY,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QACvD,IAAI,CAAC,gBAAgB,GAAG,YAAY,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QACzD,IAAI,CAAC,eAAe,GAAG,YAAY,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QACvD,IAAI,CAAC,sBAAsB,GAAG,YAAY,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC;IACvE,CAAC;IAED,oBAAoB;QAClB,IAAI,CAAC,uBAAwB,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;IACtD,CAAC;IAED,KAAK,CAAC,iBAAiB;QACrB,IAAI,CAAC,YAAY,GAAG,MAAM,iBAAiB,CACzC,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Event, EventEmitter, Host, Prop, State, h } from '@stencil/core';\nimport { fetchNewsArticles, splitByComma } 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 @State() newsResponse?: NewsResponse;\n\n @State() pageNumber = 1;\n\n @State() newsChannelsArr: string[] = [];\n\n @State() newsSellerIdsArr: string[] = [];\n\n @State() newsBrandIdsArr: string[] = [];\n\n @State() newsLanguageLocalesArr: string[] = [];\n\n /**\n * The url of the Aico Api that will be used to retrieve the article.\n */\n @Prop() aicoUrl!: string;\n\n /**\n * The token used to authenticate against he Aico Api.\n */\n @Prop() aicoBearerToken!: string;\n\n /**\n * Channel names as a comma separated list used to filter the results.\n */\n @Prop() newsChannels: string = '';\n\n /**\n * Seller ids as a comma separated list used to filter the results.\n */\n @Prop() newsSellerIds: string = '';\n\n /**\n * Brand ids as a comma separated list used to filter the results.\n */\n @Prop() newsBrandIds: string = '';\n\n /**\n * Language locales as a comma separated list used to filter the results.\n */\n @Prop() newsLanguageLocales: string = '';\n\n /**\n * The page size. Prefer this number to be even.\n */\n @Prop() pageSize: number = 16;\n\n /**\n * The text used by the next button in the pagination component.\n */\n @Prop() nextButtonText: string = 'Next';\n\n /**\n * The text used by the previous button in the pagination component.\n */\n @Prop() previousButtonText: string = 'Previous';\n\n /**\n * The article translation that will be used to render the content.\n *\n * If the locale specified is not present in the article's translations, most content will not be shown.\n */\n @Prop() locale: string = 'de';\n\n /**\n * Event emitted when a user clicks an article.\n *\n * The handler receives the entire Article entity.\n */\n @Event() articleClick?: EventEmitter<Article>;\n\n /**\n * Determines if the special articles are highlighted by taking more space.\n */\n @Prop() highlightSpecialArticles: boolean = false;\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 this.newsChannelsArr = splitByComma(this.newsChannels);\n this.newsSellerIdsArr = splitByComma(this.newsSellerIds);\n this.newsBrandIdsArr = splitByComma(this.newsBrandIds);\n this.newsLanguageLocalesArr = splitByComma(this.newsLanguageLocales);\n }\n\n disconnectedCallback() {\n this.newsListFetchController!.abort('disconnected');\n }\n\n async componentWillLoad(): Promise<void> {\n this.newsResponse = await fetchNewsArticles(\n this.api!,\n this.pageNumber,\n this.pageSize,\n this.newsListFetchController!.signal,\n this.newsChannelsArr,\n this.newsSellerIdsArr,\n this.newsBrandIdsArr,\n this.newsLanguageLocalesArr,\n );\n }\n\n async componentWillUpdate(): Promise<void> {\n this.newsListFetchController = new AbortController();\n this.newsResponse = await fetchNewsArticles(\n this.api!,\n this.pageNumber,\n this.pageSize,\n this.newsListFetchController.signal,\n this.newsChannelsArr,\n this.newsSellerIdsArr,\n this.newsBrandIdsArr,\n this.newsLanguageLocalesArr,\n );\n }\n\n render() {\n return (\n <Host>\n <div class=\"newslist-grid-container mb-4\">\n {this.newsResponse?.data.map((article, articleIndex) => {\n return (\n <div class={`col ${this.highlightSpecialArticles && article.attributes.isSpecialArticle ? 'row-span-2 col-span-md-2' : ''}`}>\n <aico-news-list-item\n article={article}\n articleIndex={articleIndex}\n onArticleClick={e => {\n this.articleClick?.emit(e.detail);\n e.stopPropagation();\n }}\n locale={this.locale}\n />\n </div>\n );\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"]}
1
+ {"version":3,"file":"aico-news-list.js","sourceRoot":"","sources":["../../../src/components/aico-news-list/aico-news-list.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAgB,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AACrF,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAUpE,MAAM,OAAO,YAAY;;;0BAGD,CAAC;+BAEc,EAAE;gCAED,EAAE;+BAEH,EAAE;sCAEK,EAAE;;;4BAef,EAAE;6BAKD,EAAE;4BAKH,EAAE;mCAKK,EAAE;wBAKb,EAAE;8BAKI,MAAM;kCAKF,UAAU;sBAOtB,IAAI;;IAY7B,iBAAiB;QACf,IAAI,CAAC,uBAAuB,GAAG,IAAI,eAAe,EAAE,CAAC;QACrD,IAAI,CAAC,UAAU,GAAG,CAAC,CAAC;QAEpB,IAAI,CAAC,GAAG,GAAG,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,WAAW,EAAE,IAAI,CAAC,eAAe,EAAE,CAAC;QAExE,IAAI,CAAC,eAAe,GAAG,YAAY,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QACvD,IAAI,CAAC,gBAAgB,GAAG,YAAY,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QACzD,IAAI,CAAC,eAAe,GAAG,YAAY,CAAC,IAAI,CAA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ACxD;QAED,OAAO,KAAK,CAAC;IACf,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Event, EventEmitter, Host, Prop, State, h } from '@stencil/core';\nimport { fetchNewsArticles, splitByComma } 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 @State() newsResponse?: NewsResponse;\n\n @State() pageNumber = 1;\n\n @State() newsChannelsArr: string[] = [];\n\n @State() newsSellerIdsArr: string[] = [];\n\n @State() newsBrandIdsArr: string[] = [];\n\n @State() newsLanguageLocalesArr: string[] = [];\n\n /**\n * The url of the Aico Api that will be used to retrieve the article.\n */\n @Prop() aicoUrl!: string;\n\n /**\n * The token used to authenticate against he Aico Api.\n */\n @Prop() aicoBearerToken!: string;\n\n /**\n * Channel names as a comma separated list used to filter the results.\n */\n @Prop() newsChannels: string = '';\n\n /**\n * Seller ids as a comma separated list used to filter the results.\n */\n @Prop() newsSellerIds: string = '';\n\n /**\n * Brand ids as a comma separated list used to filter the results.\n */\n @Prop() newsBrandIds: string = '';\n\n /**\n * Language locales as a comma separated list used to filter the results.\n */\n @Prop() newsLanguageLocales: string = '';\n\n /**\n * The page size. Prefer this number to be even.\n */\n @Prop() pageSize: number = 16;\n\n /**\n * The text used by the next button in the pagination component.\n */\n @Prop() nextButtonText: string = 'Next';\n\n /**\n * The text used by the previous button in the pagination component.\n */\n @Prop() previousButtonText: string = 'Previous';\n\n /**\n * The article translation that will be used to render the content.\n *\n * If the locale specified is not present in the article's translations, most content will not be shown.\n */\n @Prop() locale: string = 'de';\n\n /**\n * Event emitted when a user clicks an article.\n *\n * The handler receives the entire Article entity.\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 this.newsChannelsArr = splitByComma(this.newsChannels);\n this.newsSellerIdsArr = splitByComma(this.newsSellerIds);\n this.newsBrandIdsArr = splitByComma(this.newsBrandIds);\n this.newsLanguageLocalesArr = splitByComma(this.newsLanguageLocales);\n }\n\n disconnectedCallback() {\n this.newsListFetchController!.abort('disconnected');\n }\n\n async componentWillLoad(): Promise<void> {\n this.newsResponse = await fetchNewsArticles(\n this.api!,\n this.pageNumber,\n this.pageSize,\n this.newsListFetchController!.signal,\n this.newsChannelsArr,\n this.newsSellerIdsArr,\n this.newsBrandIdsArr,\n this.newsLanguageLocalesArr,\n );\n }\n\n async componentWillUpdate(): Promise<void> {\n this.newsListFetchController = new AbortController();\n this.newsResponse = await fetchNewsArticles(\n this.api!,\n this.pageNumber,\n this.pageSize,\n this.newsListFetchController.signal,\n this.newsChannelsArr,\n this.newsSellerIdsArr,\n this.newsBrandIdsArr,\n this.newsLanguageLocalesArr,\n );\n }\n\n render() {\n return (\n <Host>\n <div class=\"newslist-grid-container mb-4\">\n {this.newsResponse?.data\n .filter(article => !article.attributes.isTopNews)\n .map((article, articleIndex) => {\n return (\n <div class=\"col\">\n <aico-news-list-item\n article={article}\n articleIndex={articleIndex}\n onArticleClick={e => {\n this.articleClick?.emit(e.detail);\n e.stopPropagation();\n }}\n locale={this.locale}\n />\n </div>\n );\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"]}
@@ -3,16 +3,15 @@ export class AicoNewsListItem {
3
3
  constructor() {
4
4
  this.article = undefined;
5
5
  this.articleIndex = 0;
6
- this.highlightSpecialArticle = false;
7
6
  this.locale = 'de';
8
7
  }
9
8
  render() {
10
9
  var _a, _b, _c, _d, _e, _f, _g;
11
10
  const translation = this.article.attributes.translations.find(t => t.locale === this.locale);
12
- return (h("div", { class: `card h-100 pe-auto ${this.highlightSpecialArticle && this.article.attributes.isSpecialArticle ? 'd-flex flex-column' : ''}`, style: { cursor: 'pointer' }, onClick: () => {
11
+ return (h("div", { class: "card h-100 pe-auto", style: { cursor: 'pointer' }, onClick: () => {
13
12
  var _a;
14
13
  (_a = this.articleClick) === null || _a === void 0 ? void 0 : _a.emit(this.article);
15
- } }, h("div", { class: `ratio ratio-16x9 overflow-hidden ${this.highlightSpecialArticle && this.article.attributes.isSpecialArticle ? 'flex-grow-1' : ''}` }, h("img", { class: "object-fit-cover", style: { 'min-height': '15rem' }, alt: "Article image", src: (_e = (_d = (_c = (_b = (_a = translation === null || translation === void 0 ? void 0 : translation.image) !== null && _a !== void 0 ? _a : translation === null || translation === void 0 ? void 0 : translation.optimizedListImage) !== null && _b !== void 0 ? _b : translation === null || translation === void 0 ? void 0 : translation.optimizedImage) !== null && _c !== void 0 ? _c : this.article.attributes.image) !== null && _d !== void 0 ? _d : this.article.attributes.optimizedListImage) !== null && _e !== void 0 ? _e : this.article.attributes.optimizedImage }), h("div", { class: "card-img-overlay d-flex justify-content-end" })), h("div", { class: `card-body ${this.highlightSpecialArticle && this.article.attributes.isSpecialArticle ? 'flex-grow-0' : ''}` }, h("h5", { class: "card-title" }, (_f = translation === null || translation === void 0 ? void 0 : translation.name) !== null && _f !== void 0 ? _f : this.article.attributes.name), h("p", { class: "card-text" }, (_g = translation === null || translation === void 0 ? void 0 : translation.excerpt) !== null && _g !== void 0 ? _g : this.article.attributes.excerpt))));
14
+ } }, h("div", { class: "ratio ratio-16x9 overflow-hidden" }, h("img", { class: "object-fit-cover", style: { 'min-height': '15rem' }, alt: "Article image", src: (_e = (_d = (_c = (_b = (_a = translation === null || translation === void 0 ? void 0 : translation.image) !== null && _a !== void 0 ? _a : translation === null || translation === void 0 ? void 0 : translation.optimizedListImage) !== null && _b !== void 0 ? _b : translation === null || translation === void 0 ? void 0 : translation.optimizedImage) !== null && _c !== void 0 ? _c : this.article.attributes.image) !== null && _d !== void 0 ? _d : this.article.attributes.optimizedListImage) !== null && _e !== void 0 ? _e : this.article.attributes.optimizedImage }), h("div", { class: "card-img-overlay d-flex justify-content-end" })), h("div", { class: "card-body" }, h("h5", { class: "card-title" }, (_f = translation === null || translation === void 0 ? void 0 : translation.name) !== null && _f !== void 0 ? _f : this.article.attributes.name), h("p", { class: "card-text" }, (_g = translation === null || translation === void 0 ? void 0 : translation.excerpt) !== null && _g !== void 0 ? _g : this.article.attributes.excerpt))));
16
15
  }
17
16
  static get is() { return "aico-news-list-item"; }
18
17
  static get encapsulation() { return "scoped"; }
@@ -67,24 +66,6 @@ export class AicoNewsListItem {
67
66
  "reflect": false,
68
67
  "defaultValue": "0"
69
68
  },
70
- "highlightSpecialArticle": {
71
- "type": "boolean",
72
- "mutable": false,
73
- "complexType": {
74
- "original": "boolean",
75
- "resolved": "boolean",
76
- "references": {}
77
- },
78
- "required": false,
79
- "optional": false,
80
- "docs": {
81
- "tags": [],
82
- "text": ""
83
- },
84
- "attribute": "highlight-special-article",
85
- "reflect": false,
86
- "defaultValue": "false"
87
- },
88
69
  "locale": {
89
70
  "type": "string",
90
71
  "mutable": false,
@@ -1 +1 @@
1
- {"version":3,"file":"aico-news-list-item.js","sourceRoot":"","sources":["../../../src/components/aico-news-list-item/aico-news-list-item.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAgB,CAAC,EAAE,MAAM,eAAe,CAAC;AAQxE,MAAM,OAAO,gBAAgB;;;4BAEI,CAAC;uCACW,KAAK;sBAQvB,IAAI;;IAE7B,MAAM;;QACJ,MAAM,WAAW,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,IAAI,CAAC,MAAM,CAAC,CAAC;QAC7F,OAAO,CACL,WACE,KAAK,EAAE,sBAAsB,IAAI,CAAC,uBAAuB,IAAI,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,gBAAgB,CAAC,CAAC,CAAC,oBAAoB,CAAC,CAAC,CAAC,EAAE,EAAE,EACnI,KAAK,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,EAC5B,OAAO,EAAE,GAAG,EAAE;;gBACZ,MAAA,IAAI,CAAC,YAAY,0CAAE,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YACxC,CAAC;YAED,WAAK,KAAK,EAAE,oCAAoC,IAAI,CAAC,uBAAuB,IAAI,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,gBAAgB,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,EAAE;gBAC7I,WACE,KAAK,EAAC,kBAAkB,EACxB,KAAK,EAAE,EAAE,YAAY,EAAE,OAAO,EAAE,EAChC,GAAG,EAAC,eAAe,EACnB,GAAG,EACD,MAAA,MAAA,MAAA,MAAA,MAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,KAAK,mCAClB,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,kBAAkB,mCAC/B,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,cAAc,mCAC3B,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,KAAK,mCAC7B,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,kBAAkB,mCAC1C,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,cAAc,GAExC;gBACF,WAAK,KAAK,EAAC,6CAA6C,GAA0C,CAC9F;YACN,WAAK,KAAK,EAAE,aAAa,IAAI,CAAC,uBAAuB,IAAI,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,gBAAgB,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,EAAE;gBACtH,UAAI,KAAK,EAAC,YAAY,IAAE,MAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,IAAI,mCAAI,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,CAAM;gBAC/E,SAAG,KAAK,EAAC,WAAW,IAAE,MAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,OAAO,mCAAI,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,OAAO,CAAK,CAC9E,CACF,CACP,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","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 @Prop() articleIndex: number = 0;\n @Prop() highlightSpecialArticle: boolean = false;\n @Event() articleClick?: EventEmitter<Article>;\n\n /**\n * The article translation that will be used to render the content.\n *\n * If the locale specified is not present in the article's translations, most content will not be shown.\n */\n @Prop() locale: string = 'de';\n\n render() {\n const translation = this.article.attributes.translations.find(t => t.locale === this.locale);\n return (\n <div\n class={`card h-100 pe-auto ${this.highlightSpecialArticle && this.article.attributes.isSpecialArticle ? 'd-flex flex-column' : ''}`}\n style={{ cursor: 'pointer' }}\n onClick={() => {\n this.articleClick?.emit(this.article);\n }}\n >\n <div class={`ratio ratio-16x9 overflow-hidden ${this.highlightSpecialArticle && this.article.attributes.isSpecialArticle ? 'flex-grow-1' : ''}`}>\n <img\n class=\"object-fit-cover\"\n style={{ 'min-height': '15rem' }}\n alt=\"Article image\"\n src={\n translation?.image ??\n translation?.optimizedListImage ??\n translation?.optimizedImage ??\n this.article.attributes.image ??\n this.article.attributes.optimizedListImage ??\n this.article.attributes.optimizedImage\n }\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 ${this.highlightSpecialArticle && this.article.attributes.isSpecialArticle ? 'flex-grow-0' : ''}`}>\n <h5 class=\"card-title\">{translation?.name ?? this.article.attributes.name}</h5>\n <p class=\"card-text\">{translation?.excerpt ?? this.article.attributes.excerpt}</p>\n </div>\n </div>\n );\n }\n}\n"]}
1
+ {"version":3,"file":"aico-news-list-item.js","sourceRoot":"","sources":["../../../src/components/aico-news-list-item/aico-news-list-item.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAgB,CAAC,EAAE,MAAM,eAAe,CAAC;AAQxE,MAAM,OAAO,gBAAgB;;;4BAEI,CAAC;sBAQP,IAAI;;IAE7B,MAAM;;QACJ,MAAM,WAAW,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,IAAI,CAAC,MAAM,CAAC,CAA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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 @Prop() articleIndex: number = 0;\n @Event() articleClick?: EventEmitter<Article>;\n\n /**\n * The article translation that will be used to render the content.\n *\n * If the locale specified is not present in the article's translations, most content will not be shown.\n */\n @Prop() locale: string = 'de';\n\n render() {\n const translation = this.article.attributes.translations.find(t => t.locale === this.locale);\n return (\n <div\n class=\"card h-100 pe-auto\"\n style={{ cursor: 'pointer' }}\n onClick={() => {\n this.articleClick?.emit(this.article);\n }}\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={\n translation?.image ??\n translation?.optimizedListImage ??\n translation?.optimizedImage ??\n this.article.attributes.image ??\n this.article.attributes.optimizedListImage ??\n this.article.attributes.optimizedImage\n }\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\">{translation?.name ?? this.article.attributes.name}</h5>\n <p class=\"card-text\">{translation?.excerpt ?? this.article.attributes.excerpt}</p>\n </div>\n </div>\n );\n }\n}\n"]}
@@ -17,6 +17,7 @@ const x = {
17
17
  newsTags: [],
18
18
  isActive: true,
19
19
  isSpecialArticle: false,
20
+ isTopNews: false,
20
21
  focusXCoordinate: 172,
21
22
  focusYCoordinate: 51,
22
23
  focusXPercentage: 50.962962962963,
@@ -1 +1 @@
1
- {"version":3,"file":"aico-news-list-item.stories.js","sourceRoot":"","sources":["../../../src/components/aico-news-list-item/aico-news-list-item.stories.ts"],"names":[],"mappings":"AAIA,MAAM,IAAI,GAA+B;IACvC,SAAS,EAAE,qBAAqB;CACjC,CAAC;AAEF,eAAe,IAAI,CAAC;AAKpB,MAAM,CAAC,GAAW,CA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EAAE,6FAA6F;QAC7G,kBAAkB,EAAE,kGAAkG;KACvH;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,OAAO,GAAU;IAC5B,IAAI,EAAE;QACJ,OAAO,EAAE,CAAC;QACV,YAAY,EAAE,CAAC;KAChB;CACF,CAAC","sourcesContent":["import type { Meta, StoryObj } from '@storybook/web-components';\nimport type { Article } from '../../model/Article';\nimport { JSX } from '../../components';\n\nconst meta: Meta<JSX.AicoNewsListItem> = {\n component: 'aico-news-list-item',\n};\n\nexport default meta;\n\ntype Story = StoryObj;\n\n\nconst y: number = 0;\n\nconst x: Article = {\n id: '1234',\n type: 'type',\n links: { self: 'foo' },\n attributes: {\n createdAt: new Date(),\n updatedAt: new Date(),\n pageTitle: 'Page title',\n urlHandle: 'die-fcz-frauen-sind-in-zypern-angekommen',\n publishDate: new Date(),\n author: 'lfr',\n newsTags: [],\n isActive: true,\n isSpecialArticle: false,\n focusXCoordinate: 172,\n focusYCoordinate: 51,\n focusXPercentage: 50.962962962963,\n focusYPercentage: 20.4,\n mobileFocusXCoordinate: 168,\n mobileFocusYCoordinate: 32,\n mobileFocusXPercentage: 49.777777777778,\n mobileFocusYPercentage: 12.8,\n contentBuilder: {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n name: 'Content builder',\n rows: [],\n },\n newsCategory: {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n translations: [],\n isActive: false,\n sortingNumber: 1,\n },\n isFullWidth: true,\n showInApp: true,\n isPermanent: false,\n soccerTeams: [],\n brands: [],\n translations: [],\n name: 'Die FCZ Frauen sind in Zypern angekommen',\n description: '',\n excerpt: 'Acht Tage langes Trainingslager auf der Mittelmeerinsel.',\n image: 'https://aicofcz.s3.eu-central-1.amazonaws.com/images/65a19b107d897_IMG_0147-2.jpg',\n optimizedImage: 'https://aicofcz.s3.eu-central-1.amazonaws.com/images/optimized_65a19b107d897_IMG_0147-2.jpg',\n optimizedListImage: 'https://aicofcz.s3.eu-central-1.amazonaws.com/images/optimized_list_65a19b107d897_IMG_0147-2.jpg',\n },\n};\n\nexport const Example: Story = {\n args: {\n article: x,\n articleIndex: y\n },\n};\n"]}
1
+ {"version":3,"file":"aico-news-list-item.stories.js","sourceRoot":"","sources":["../../../src/components/aico-news-list-item/aico-news-list-item.stories.ts"],"names":[],"mappings":"AAIA,MAAM,IAAI,GAA+B;IACvC,SAAS,EAAE,qBAAqB;CACjC,CAAC;AAEF,eAAe,IAAI,CAAC;AAKpB,MAAM,CAAC,GAAW,CAAC,CAAC;AAEpB,MAAM,CAAC,GAAY;IACjB,EAAE,EAAE,MAAM;IACV,IAAI,EAAE,MAAM;IACZ,KAAK,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE;IACtB,UAAU,EAAE;QACV,SAAS,EAAE,IAAI,IAAI,EAAE;QACrB,SAAS,EAAE,IAAI,IAAI,EAAE;QACrB,SAAS,EAAE,YAAY;QACvB,SAAS,EAAE,0CAA0C;QACrD,WAAW,EAAE,IAAI,IAAI,EAAE;QACvB,MAAM,EAAE,KAAK;QACb,QAAQ,EAAE,EAAE;QACZ,QAAQ,EAAE,IAAI;QACd,gBAAgB,EAAE,KAAK;QACvB,SAAS,EAAE,KAAK;QAChB,gBAAgB,EAAE,GAAG;QACrB,gBAAgB,EAAE,EAAE;QACpB,gBAAgB,EAAE,eAAe;QACjC,gBAAgB,EAAE,IAAI;QACtB,sBAAsB,EAAE,GAAG;QAC3B,sBAAsB,EAAE,EAAE;QAC1B,sBAAsB,EAAE,eAAe;QACvC,sBAAsB,EAAE,IAAI;QAC5B,cAAc,EAAE;YACd,EAAE,EAAE,IAAI;YACR,SAAS,EAAE,IAAI,IAAI,EAAE;YACrB,SAAS,EAAE,IAAI,IAAI,EAAE;YACrB,IAAI,EAAE,iBAAiB;YACvB,IAAI,EAAE,EAAE;SACT;QACD,YAAY,EAAE;YACZ,EAAE,EAAE,IAAI;YACR,SAAS,EAAE,IAAI,IAAI,EAAE;YACrB,SAAS,EAAE,IAAI,IAAI,EAAE;YACrB,YAAY,EAAE,EAAE;YAChB,QAAQ,EAAE,KAAK;YACf,aAAa,EAAE,CAAC;SACjB;QACD,WAAW,EAAE,IAAI;QACjB,SAAS,EAAE,IAAI;QACf,WAAW,EAAE,KAAK;QAClB,WAAW,EAAE,EAAE;QACf,MAAM,EAAE,EAAE;QACV,YAAY,EAAE,EAAE;QAChB,IAAI,EAAE,0CAA0C;QAChD,WAAW,EAAE,EAAE;QACf,OAAO,EAAE,0DAA0D;QACnE,KAAK,EAAE,mFAAmF;QAC1F,cAAc,EAAE,6FAA6F;QAC7G,kBAAkB,EAAE,kGAAkG;KACvH;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,OAAO,GAAU;IAC5B,IAAI,EAAE;QACJ,OAAO,EAAE,CAAC;QACV,YAAY,EAAE,CAAC;KAChB;CACF,CAAC","sourcesContent":["import type { Meta, StoryObj } from '@storybook/web-components';\nimport type { Article } from '../../model/Article';\nimport { JSX } from '../../components';\n\nconst meta: Meta<JSX.AicoNewsListItem> = {\n component: 'aico-news-list-item',\n};\n\nexport default meta;\n\ntype Story = StoryObj;\n\n\nconst y: number = 0;\n\nconst x: Article = {\n id: '1234',\n type: 'type',\n links: { self: 'foo' },\n attributes: {\n createdAt: new Date(),\n updatedAt: new Date(),\n pageTitle: 'Page title',\n urlHandle: 'die-fcz-frauen-sind-in-zypern-angekommen',\n publishDate: new Date(),\n author: 'lfr',\n newsTags: [],\n isActive: true,\n isSpecialArticle: false,\n isTopNews: false,\n focusXCoordinate: 172,\n focusYCoordinate: 51,\n focusXPercentage: 50.962962962963,\n focusYPercentage: 20.4,\n mobileFocusXCoordinate: 168,\n mobileFocusYCoordinate: 32,\n mobileFocusXPercentage: 49.777777777778,\n mobileFocusYPercentage: 12.8,\n contentBuilder: {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n name: 'Content builder',\n rows: [],\n },\n newsCategory: {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n translations: [],\n isActive: false,\n sortingNumber: 1,\n },\n isFullWidth: true,\n showInApp: true,\n isPermanent: false,\n soccerTeams: [],\n brands: [],\n translations: [],\n name: 'Die FCZ Frauen sind in Zypern angekommen',\n description: '',\n excerpt: 'Acht Tage langes Trainingslager auf der Mittelmeerinsel.',\n image: 'https://aicofcz.s3.eu-central-1.amazonaws.com/images/65a19b107d897_IMG_0147-2.jpg',\n optimizedImage: 'https://aicofcz.s3.eu-central-1.amazonaws.com/images/optimized_65a19b107d897_IMG_0147-2.jpg',\n optimizedListImage: 'https://aicofcz.s3.eu-central-1.amazonaws.com/images/optimized_list_65a19b107d897_IMG_0147-2.jpg',\n },\n};\n\nexport const Example: Story = {\n args: {\n article: x,\n articleIndex: y\n },\n};\n"]}
@@ -47,7 +47,7 @@ export class AicoSpecialNewsCarousel {
47
47
  }
48
48
  render() {
49
49
  return (h("div", { class: "carousel" }, this.newsResponse.data.map(article => {
50
- var _a, _b, _c, _d;
50
+ var _a, _b, _c, _d, _e, _f;
51
51
  const focusX = article.attributes.focusXPercentage ? `${article.attributes.focusXPercentage}%` : 'center';
52
52
  const focusY = article.attributes.focusYPercentage ? `${article.attributes.focusYPercentage}%` : 'center';
53
53
  const translation = article.attributes.translations.find(t => t.locale === this.locale);
@@ -55,7 +55,7 @@ export class AicoSpecialNewsCarousel {
55
55
  var _a;
56
56
  e.preventDefault();
57
57
  (_a = this.articleClicked) === null || _a === void 0 ? void 0 : _a.emit(article);
58
- } }, (_a = translation === null || translation === void 0 ? void 0 : translation.name) !== null && _a !== void 0 ? _a : article.attributes.name))), h("div", { class: "ratio ratio-16x9 mx-auto", style: { 'max-width': '50%' } }, h("img", { class: "card-img-bottom object-fit-cover", style: { 'object-position': `${focusX} ${focusY}`, 'min-height': '15rem' }, alt: "News Picture", "data-lazy": (_d = (_c = (_b = translation === null || translation === void 0 ? void 0 : translation.optimizedImage) !== null && _b !== void 0 ? _b : translation === null || translation === void 0 ? void 0 : translation.image) !== null && _c !== void 0 ? _c : article.attributes.optimizedImage) !== null && _d !== void 0 ? _d : article.attributes.image }))));
58
+ } }, (_a = translation === null || translation === void 0 ? void 0 : translation.name) !== null && _a !== void 0 ? _a : article.attributes.name))), h("div", { class: "ratio ratio-16x9 mx-auto", style: { 'max-width': '50%' } }, h("img", { class: "card-img-bottom object-fit-cover", style: { 'object-position': `${focusX} ${focusY}`, 'min-height': '15rem' }, alt: "News Picture", "data-lazy": (_f = (_e = (_d = (_c = (_b = translation === null || translation === void 0 ? void 0 : translation.image) !== null && _b !== void 0 ? _b : translation === null || translation === void 0 ? void 0 : translation.optimizedListImage) !== null && _c !== void 0 ? _c : translation === null || translation === void 0 ? void 0 : translation.optimizedImage) !== null && _d !== void 0 ? _d : article.attributes.image) !== null && _e !== void 0 ? _e : article.attributes.optimizedListImage) !== null && _f !== void 0 ? _f : article.attributes.optimizedImage }))));
59
59
  })));
60
60
  }
61
61
  static get is() { return "aico-special-news-carousel"; }
@@ -1 +1 @@
1
- {"version":3,"file":"aico-special-news-carousel.js","sourceRoot":"","sources":["../../../src/components/aico-special-news-carousel/aico-special-news-carousel.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAgB,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAI/E,OAAO,EAAE,wBAAwB,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAE3E,OAAO,CAAC,MAAM,QAAQ,CAAC;AACvB,OAAO,gBAAgB,CAAC;AAOxB,MAAM,OAAO,uBAAuB;;;+BAGG,EAAE;gCAED,EAAE;+BAEH,EAAE;sCAEK,EAAE;;;4BAef,EAAE;6BAKD,EAAE;4BAKH,EAAE;mCAKK,EAAE;gCAKL,CAAC;sBAOX,IAAI;;IAY7B,iBAAiB;QACf,IAAI,CAAC,uBAAuB,GAAG,IAAI,eAAe,EAAE,CAAC;QACrD,IAAI,CAAC,GAAG,GAAG,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EA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AAM,IAAI,MAAM,EAAE,EAAE,YAAY,EAAE,OAAO,EAAE,EAC1E,GAAG,EAAC,cAAc,eACP,MAAA,MAAA,MAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,cAAc,mCAAI,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,KAAK,mCAAI,OAAO,CAAC,UAAU,CAAC,cAAc,mCAAI,OAAO,CAAC,UAAU,CAAC,KAAK,GAC7H,CACE,CACF,CACP,CAAC;QACJ,CAAC,CAAC,CACE,CACP,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["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, splitByComma } 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 @State() newsChannelsArr: string[] = [];\n\n @State() newsSellerIdsArr: string[] = [];\n\n @State() newsBrandIdsArr: string[] = [];\n\n @State() newsLanguageLocalesArr: string[] = [];\n\n /**\n * The url of the Aico Api that will be used to retrieve the article.\n */\n @Prop() aicoUrl!: string;\n\n /**\n * The token used to authenticate against he Aico Api.\n */\n @Prop() aicoBearerToken!: string;\n\n /**\n * Channel names as a comma separated list used to filter the results.\n */\n @Prop() newsChannels: string = '';\n\n /**\n * Seller ids as a comma separated list used to filter the results.\n */\n @Prop() newsSellerIds: string = '';\n\n /**\n * Brand ids as a comma separated list used to filter the results.\n */\n @Prop() newsBrandIds: string = '';\n\n /**\n * Language locales as a comma separated list used to filter the results.\n */\n @Prop() newsLanguageLocales: string = '';\n\n /**\n * The number of articles shown in the carousel. Prefer this number to be small.\n */\n @Prop() numberOfArticles: number = 6;\n\n /**\n * The article translation that will be used to render the content.\n *\n * If the locale specified is not present in the article's translations, most content will not be shown.\n */\n @Prop() locale: string = 'de';\n\n /**\n * Event emitted when a user clicks an article title.\n *\n * The handler receives the entire Article entity.\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 this.newsChannelsArr = splitByComma(this.newsChannels);\n this.newsSellerIdsArr = splitByComma(this.newsSellerIds);\n this.newsBrandIdsArr = splitByComma(this.newsBrandIds);\n this.newsLanguageLocalesArr = splitByComma(this.newsLanguageLocales);\n }\n\n disconnectedCallback() {\n this.newsListFetchController!.abort('disconnected');\n }\n\n async componentWillLoad(): Promise<void> {\n this.newsResponse = await fetchSpecialNewsArticles(\n this.api!,\n 1,\n this.numberOfArticles,\n this.newsListFetchController!.signal,\n this.newsChannelsArr,\n this.newsSellerIdsArr,\n this.newsBrandIdsArr,\n this.newsLanguageLocalesArr,\n );\n }\n\n async componentWillUpdate(): Promise<void> {\n this.newsListFetchController = new AbortController();\n this.newsResponse = await fetchSpecialNewsArticles(\n this.api!,\n 1,\n this.numberOfArticles,\n this.newsListFetchController.signal,\n this.newsChannelsArr,\n this.newsSellerIdsArr,\n this.newsBrandIdsArr,\n this.newsLanguageLocalesArr,\n );\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 const translation = article.attributes.translations.find(t => t.locale === this.locale);\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 {translation?.name ?? 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={translation?.optimizedImage ?? translation?.image ?? article.attributes.optimizedImage ?? article.attributes.image}\n />\n </div>\n </div>\n );\n })}\n </div>\n );\n }\n}\n"]}
1
+ {"version":3,"file":"aico-special-news-carousel.js","sourceRoot":"","sources":["../../../src/components/aico-special-news-carousel/aico-special-news-carousel.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAgB,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAI/E,OAAO,EAAE,wBAAwB,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAE3E,OAAO,CAAC,MAAM,QAAQ,CAAC;AACvB,OAAO,gBAAgB,CAAC;AAOxB,MAAM,OAAO,uBAAuB;;;+BAGG,EAAE;gCAED,EAAE;+BAEH,EAAE;sCAEK,EAAE;;;4BAef,EAAE;6BAKD,EAAE;4BAKH,EAAE;mCAKK,EAAE;gCAKL,CAAC;sBAOX,IAAI;;IAY7B,iBAAiB;QACf,IAAI,CAAC,uBAAuB,GAAG,IAAI,eAAe,EAAE,CAAC;QACrD,IAAI,CAAC,GAAG,GAAG,EAAE,OAAO,EAAE,I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AAiB,EAAE,GAAG,MAAM,IAAI,MAAM,EAAE,EAAE,YAAY,EAAE,OAAO,EAAE,EAC1E,GAAG,EAAC,cAAc,eAEhB,MAAA,MAAA,MAAA,MAAA,MAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,KAAK,mCAClB,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,kBAAkB,mCAC/B,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,cAAc,mCAC3B,OAAO,CAAC,UAAU,CAAC,KAAK,mCACxB,OAAO,CAAC,UAAU,CAAC,kBAAkB,mCACrC,OAAO,CAAC,UAAU,CAAC,cAAc,GAEnC,CACE,CACF,CACP,CAAC;QACJ,CAAC,CAAC,CACE,CACP,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["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, splitByComma } 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 @State() newsChannelsArr: string[] = [];\n\n @State() newsSellerIdsArr: string[] = [];\n\n @State() newsBrandIdsArr: string[] = [];\n\n @State() newsLanguageLocalesArr: string[] = [];\n\n /**\n * The url of the Aico Api that will be used to retrieve the article.\n */\n @Prop() aicoUrl!: string;\n\n /**\n * The token used to authenticate against he Aico Api.\n */\n @Prop() aicoBearerToken!: string;\n\n /**\n * Channel names as a comma separated list used to filter the results.\n */\n @Prop() newsChannels: string = '';\n\n /**\n * Seller ids as a comma separated list used to filter the results.\n */\n @Prop() newsSellerIds: string = '';\n\n /**\n * Brand ids as a comma separated list used to filter the results.\n */\n @Prop() newsBrandIds: string = '';\n\n /**\n * Language locales as a comma separated list used to filter the results.\n */\n @Prop() newsLanguageLocales: string = '';\n\n /**\n * The number of articles shown in the carousel. Prefer this number to be small.\n */\n @Prop() numberOfArticles: number = 6;\n\n /**\n * The article translation that will be used to render the content.\n *\n * If the locale specified is not present in the article's translations, most content will not be shown.\n */\n @Prop() locale: string = 'de';\n\n /**\n * Event emitted when a user clicks an article title.\n *\n * The handler receives the entire Article entity.\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 this.newsChannelsArr = splitByComma(this.newsChannels);\n this.newsSellerIdsArr = splitByComma(this.newsSellerIds);\n this.newsBrandIdsArr = splitByComma(this.newsBrandIds);\n this.newsLanguageLocalesArr = splitByComma(this.newsLanguageLocales);\n }\n\n disconnectedCallback() {\n this.newsListFetchController!.abort('disconnected');\n }\n\n async componentWillLoad(): Promise<void> {\n this.newsResponse = await fetchSpecialNewsArticles(\n this.api!,\n 1,\n this.numberOfArticles,\n this.newsListFetchController!.signal,\n this.newsChannelsArr,\n this.newsSellerIdsArr,\n this.newsBrandIdsArr,\n this.newsLanguageLocalesArr,\n );\n }\n\n async componentWillUpdate(): Promise<void> {\n this.newsListFetchController = new AbortController();\n this.newsResponse = await fetchSpecialNewsArticles(\n this.api!,\n 1,\n this.numberOfArticles,\n this.newsListFetchController.signal,\n this.newsChannelsArr,\n this.newsSellerIdsArr,\n this.newsBrandIdsArr,\n this.newsLanguageLocalesArr,\n );\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 const translation = article.attributes.translations.find(t => t.locale === this.locale);\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 {translation?.name ?? 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={\n translation?.image ??\n translation?.optimizedListImage ??\n translation?.optimizedImage ??\n article.attributes.image ??\n article.attributes.optimizedListImage ??\n article.attributes.optimizedImage\n }\n />\n </div>\n </div>\n );\n })}\n </div>\n );\n }\n}\n"]}