@aiconomy/aico-components 0.0.158 → 0.0.168

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 +14 -12
  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-d4f3c776.entry.js → p-020898a6.entry.js} +2 -2
  5. package/dist/aico-components/p-253097be.js +3 -0
  6. package/dist/aico-components/p-253097be.js.map +1 -0
  7. package/dist/aico-components/{p-0d563d4f.entry.js → p-25cf4b75.entry.js} +2 -2
  8. package/dist/aico-components/{p-076c2ca2.entry.js → p-aa633f51.entry.js} +4 -4
  9. package/dist/aico-components/p-aa633f51.entry.js.map +1 -0
  10. package/dist/cjs/aico-album-content_27.cjs.entry.js +39 -10
  11. package/dist/cjs/aico-album-content_27.cjs.entry.js.map +1 -1
  12. package/dist/cjs/aico-asking-list-content.cjs.entry.js +1 -1
  13. package/dist/cjs/aico-collection-content.cjs.entry.js +1 -1
  14. package/dist/cjs/aico-components.cjs.js +2 -2
  15. package/dist/cjs/{index-e52034b7.js → index-0ce53322.js} +60 -2
  16. package/dist/cjs/index-0ce53322.js.map +1 -0
  17. package/dist/cjs/loader.cjs.js +2 -2
  18. package/dist/collection/components/aico-news-list/aico-news-list.js +41 -3
  19. package/dist/collection/components/aico-news-list/aico-news-list.js.map +1 -1
  20. package/dist/collection/components/aico-news-list-item/aico-news-list-item.js +22 -1
  21. package/dist/collection/components/aico-news-list-item/aico-news-list-item.js.map +1 -1
  22. package/dist/collection/components/aico-special-news-carousel/aico-special-news-carousel.js +2 -2
  23. package/dist/collection/components/aico-special-news-carousel/aico-special-news-carousel.js.map +1 -1
  24. package/dist/collection/components/aico-top-news-carousel/aico-top-news-carousel.js +2 -2
  25. package/dist/collection/components/aico-top-news-carousel/aico-top-news-carousel.js.map +1 -1
  26. package/dist/collection/utils/utils.js +7 -1
  27. package/dist/collection/utils/utils.js.map +1 -1
  28. package/dist/components/aico-news-list-item2.js +22 -1
  29. package/dist/components/aico-news-list-item2.js.map +1 -1
  30. package/dist/components/aico-news-list.js +7 -3
  31. package/dist/components/aico-news-list.js.map +1 -1
  32. package/dist/components/aico-special-news-carousel.js +2 -2
  33. package/dist/components/aico-special-news-carousel.js.map +1 -1
  34. package/dist/components/aico-top-news-carousel.js +2 -2
  35. package/dist/components/aico-top-news-carousel.js.map +1 -1
  36. package/dist/components/utils.js +7 -1
  37. package/dist/components/utils.js.map +1 -1
  38. package/dist/esm/aico-album-content_27.entry.js +39 -10
  39. package/dist/esm/aico-album-content_27.entry.js.map +1 -1
  40. package/dist/esm/aico-asking-list-content.entry.js +1 -1
  41. package/dist/esm/aico-collection-content.entry.js +1 -1
  42. package/dist/esm/aico-components.js +3 -3
  43. package/dist/esm/{index-4621a8ba.js → index-1498b9e7.js} +60 -3
  44. package/dist/esm/index-1498b9e7.js.map +1 -0
  45. package/dist/esm/loader.js +3 -3
  46. package/dist/types/components/aico-news-list/aico-news-list.d.ts +8 -0
  47. package/dist/types/components/aico-news-list-item/aico-news-list-item.d.ts +4 -0
  48. package/dist/types/components.d.ts +16 -0
  49. package/dist/types/utils/utils.d.ts +1 -1
  50. package/package.json +1 -1
  51. package/dist/aico-components/p-076c2ca2.entry.js.map +0 -1
  52. package/dist/aico-components/p-ae20e789.js +0 -3
  53. package/dist/aico-components/p-ae20e789.js.map +0 -1
  54. package/dist/cjs/index-e52034b7.js.map +0 -1
  55. package/dist/esm/index-4621a8ba.js.map +0 -1
  56. /package/dist/aico-components/{p-d4f3c776.entry.js.map → p-020898a6.entry.js.map} +0 -0
  57. /package/dist/aico-components/{p-0d563d4f.entry.js.map → p-25cf4b75.entry.js.map} +0 -0
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-e52034b7.js');
5
+ const index = require('./index-0ce53322.js');
6
6
 
7
7
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
8
8
 
@@ -13784,7 +13784,7 @@ function setArrayFilter(queryParams, key, values) {
13784
13784
  queryParams.append(key, value);
13785
13785
  }
13786
13786
  }
13787
- async function fetchNewsArticles(api, page, size, signal, newsChannels = [], newsSellerIds = [], newsBrandIds = [], newsLanguageLocales = []) {
13787
+ async function fetchNewsArticles(api, page, size, signal, newsChannels = [], newsSellerIds = [], newsBrandIds = [], newsLanguageLocales = [], hideTopArticles = false, hideSpecialArticles = false) {
13788
13788
  const queryParams = new URLSearchParams();
13789
13789
  queryParams.set('page[number]', String(page));
13790
13790
  queryParams.set('page[size]', String(size));
@@ -13795,6 +13795,12 @@ async function fetchNewsArticles(api, page, size, signal, newsChannels = [], new
13795
13795
  setArrayFilter(queryParams, 'filter[sellerIds][]', newsSellerIds);
13796
13796
  setArrayFilter(queryParams, 'filter[brandId][]', newsBrandIds);
13797
13797
  setArrayFilter(queryParams, 'filter[newsLanguage][]', newsLanguageLocales);
13798
+ if (hideTopArticles) {
13799
+ queryParams.set('filter[isTopNews]', '0');
13800
+ }
13801
+ if (hideSpecialArticles) {
13802
+ queryParams.set('filter[isSpecialArticle]', '0');
13803
+ }
13798
13804
  const request = getAuthenticatedRequest(api, 'news', queryParams, signal);
13799
13805
  const response = await fetch(request);
13800
13806
  return await response.json();
@@ -20647,6 +20653,8 @@ const AicoNewsList = class {
20647
20653
  this.newsSellerIds = '';
20648
20654
  this.newsBrandIds = '';
20649
20655
  this.newsLanguageLocales = '';
20656
+ this.hideTopArticles = true;
20657
+ this.hideSpecialArticles = false;
20650
20658
  this.pageSize = 16;
20651
20659
  this.nextButtonText = 'Next';
20652
20660
  this.previousButtonText = 'Previous';
@@ -20665,16 +20673,16 @@ const AicoNewsList = class {
20665
20673
  this.newsListFetchController.abort('disconnected');
20666
20674
  }
20667
20675
  async componentWillLoad() {
20668
- this.newsResponse = await fetchNewsArticles(this.api, this.pageNumber, this.pageSize, this.newsListFetchController.signal, this.newsChannelsArr, this.newsSellerIdsArr, this.newsBrandIdsArr, this.newsLanguageLocalesArr);
20676
+ this.newsResponse = await fetchNewsArticles(this.api, this.pageNumber, this.pageSize, this.newsListFetchController.signal, this.newsChannelsArr, this.newsSellerIdsArr, this.newsBrandIdsArr, this.newsLanguageLocalesArr, this.hideTopArticles, this.hideSpecialArticles);
20669
20677
  }
20670
20678
  async componentWillUpdate() {
20671
20679
  this.newsListFetchController = new AbortController();
20672
- this.newsResponse = await fetchNewsArticles(this.api, this.pageNumber, this.pageSize, this.newsListFetchController.signal, this.newsChannelsArr, this.newsSellerIdsArr, this.newsBrandIdsArr, this.newsLanguageLocalesArr);
20680
+ this.newsResponse = await fetchNewsArticles(this.api, this.pageNumber, this.pageSize, this.newsListFetchController.signal, this.newsChannelsArr, this.newsSellerIdsArr, this.newsBrandIdsArr, this.newsLanguageLocalesArr, this.hideTopArticles, this.hideSpecialArticles);
20673
20681
  }
20674
20682
  render() {
20675
20683
  var _a, _b, _c;
20676
20684
  return (index.h(index.Host, null, index.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) => {
20677
- return (index.h("div", { class: "col" }, index.h("aico-news-list-item", { article: article, articleIndex: articleIndex, onArticleClick: e => {
20685
+ return (index.h("div", { key: article.id, class: "col" }, index.h("aico-news-list-item", { article: article, articleIndex: articleIndex, onArticleClick: e => {
20678
20686
  var _a;
20679
20687
  (_a = this.articleClick) === null || _a === void 0 ? void 0 : _a.emit(e.detail);
20680
20688
  e.stopPropagation();
@@ -20737,14 +20745,35 @@ const AicoNewsListItem = class {
20737
20745
  this.articleIndex = 0;
20738
20746
  this.locale = 'de';
20739
20747
  }
20748
+ componentDidLoad() {
20749
+ const img = this.thisHtml.querySelector('img');
20750
+ if (img) {
20751
+ this.imageObserver = new IntersectionObserver(this.onIntersection);
20752
+ this.imageObserver.observe(img);
20753
+ }
20754
+ }
20755
+ async onIntersection(entries) {
20756
+ var _a;
20757
+ for (const entry of entries) {
20758
+ if (entry.isIntersecting) {
20759
+ (_a = this.imageObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
20760
+ const src = entry.target.getAttribute('data-src');
20761
+ if (src) {
20762
+ entry.target.setAttribute('src', src);
20763
+ entry.target.removeAttribute('data-src');
20764
+ }
20765
+ }
20766
+ }
20767
+ }
20740
20768
  render() {
20741
20769
  var _a, _b, _c, _d, _e, _f, _g;
20742
20770
  const translation = this.article.attributes.translations.find(t => t.locale === this.locale);
20743
20771
  return (index.h("div", { class: "card h-100 pe-auto", style: { cursor: 'pointer' }, onClick: () => {
20744
20772
  var _a;
20745
20773
  (_a = this.articleClick) === null || _a === void 0 ? void 0 : _a.emit(this.article);
20746
- } }, index.h("div", { class: "ratio ratio-16x9 overflow-hidden" }, index.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 }), index.h("div", { class: "card-img-overlay d-flex justify-content-end" })), index.h("div", { class: "card-body" }, index.h("h5", { class: "card-title" }, (_f = translation === null || translation === void 0 ? void 0 : translation.name) !== null && _f !== void 0 ? _f : this.article.attributes.name), index.h("p", { class: "card-text" }, (_g = translation === null || translation === void 0 ? void 0 : translation.excerpt) !== null && _g !== void 0 ? _g : this.article.attributes.excerpt))));
20774
+ } }, index.h("div", { class: "ratio ratio-16x9 overflow-hidden" }, index.h("img", { class: "object-fit-cover", style: { 'min-height': '15rem' }, alt: "Article image", "data-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 }), index.h("div", { class: "card-img-overlay d-flex justify-content-end" })), index.h("div", { class: "card-body" }, index.h("h5", { class: "card-title" }, (_f = translation === null || translation === void 0 ? void 0 : translation.name) !== null && _f !== void 0 ? _f : this.article.attributes.name), index.h("p", { class: "card-text" }, (_g = translation === null || translation === void 0 ? void 0 : translation.excerpt) !== null && _g !== void 0 ? _g : this.article.attributes.excerpt))));
20747
20775
  }
20776
+ get thisHtml() { return index.getElement(this); }
20748
20777
  };
20749
20778
  AicoNewsListItem.style = aicoNewsListItemCss;
20750
20779
 
@@ -20830,7 +20859,7 @@ const AicoSpecialNewsCarousel = class {
20830
20859
  }
20831
20860
  render() {
20832
20861
  return (index.h("div", { class: "carousel" }, this.newsResponse.data.map(article => {
20833
- var _a, _b, _c, _d, _e, _f;
20862
+ var _a, _b, _c, _d, _e, _f, _g;
20834
20863
  const focusX = article.attributes.focusXPercentage ? `${article.attributes.focusXPercentage}%` : 'center';
20835
20864
  const focusY = article.attributes.focusYPercentage ? `${article.attributes.focusYPercentage}%` : 'center';
20836
20865
  const translation = article.attributes.translations.find(t => t.locale === this.locale);
@@ -20838,7 +20867,7 @@ const AicoSpecialNewsCarousel = class {
20838
20867
  var _a;
20839
20868
  e.preventDefault();
20840
20869
  (_a = this.articleClicked) === null || _a === void 0 ? void 0 : _a.emit(article);
20841
- } }, (_a = translation === null || translation === void 0 ? void 0 : translation.name) !== null && _a !== void 0 ? _a : article.attributes.name))), index.h("div", { class: "ratio ratio-16x9 mx-auto", style: { 'max-width': '50%' } }, index.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 }))));
20870
+ } }, (_a = translation === null || translation === void 0 ? void 0 : translation.name) !== null && _a !== void 0 ? _a : article.attributes.name)), index.h("p", { class: "card-text text-center" }, (_b = translation === null || translation === void 0 ? void 0 : translation.excerpt) !== null && _b !== void 0 ? _b : article.attributes.excerpt)), index.h("div", { class: "ratio ratio-16x9 mx-auto", style: { 'max-width': '50%' } }, index.h("img", { class: "card-img-bottom object-fit-cover", style: { 'object-position': `${focusX} ${focusY}`, 'min-height': '15rem' }, alt: "News Picture", "data-lazy": (_g = (_f = (_e = (_d = (_c = translation === null || translation === void 0 ? void 0 : translation.image) !== null && _c !== void 0 ? _c : translation === null || translation === void 0 ? void 0 : translation.optimizedListImage) !== null && _d !== void 0 ? _d : translation === null || translation === void 0 ? void 0 : translation.optimizedImage) !== null && _e !== void 0 ? _e : article.attributes.image) !== null && _f !== void 0 ? _f : article.attributes.optimizedListImage) !== null && _g !== void 0 ? _g : article.attributes.optimizedImage }))));
20842
20871
  })));
20843
20872
  }
20844
20873
  };
@@ -21064,7 +21093,7 @@ const AicoTopNewsCarousel = class {
21064
21093
  }
21065
21094
  render() {
21066
21095
  return (index.h("div", { class: "carousel" }, this.newsResponse.data.map(article => {
21067
- var _a, _b, _c, _d, _e, _f;
21096
+ var _a, _b, _c, _d, _e, _f, _g;
21068
21097
  const focusX = article.attributes.focusXPercentage ? `${article.attributes.focusXPercentage}%` : 'center';
21069
21098
  const focusY = article.attributes.focusYPercentage ? `${article.attributes.focusYPercentage}%` : 'center';
21070
21099
  const translation = article.attributes.translations.find(t => t.locale === this.locale);
@@ -21072,7 +21101,7 @@ const AicoTopNewsCarousel = class {
21072
21101
  var _a;
21073
21102
  e.preventDefault();
21074
21103
  (_a = this.articleClicked) === null || _a === void 0 ? void 0 : _a.emit(article);
21075
- } }, (_a = translation === null || translation === void 0 ? void 0 : translation.name) !== null && _a !== void 0 ? _a : article.attributes.name))), index.h("div", { class: "ratio ratio-16x9 mx-auto", style: { 'max-width': '50%' } }, index.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 }))));
21104
+ } }, (_a = translation === null || translation === void 0 ? void 0 : translation.name) !== null && _a !== void 0 ? _a : article.attributes.name)), index.h("p", { class: "card-text text-center" }, (_b = translation === null || translation === void 0 ? void 0 : translation.excerpt) !== null && _b !== void 0 ? _b : article.attributes.excerpt)), index.h("div", { class: "ratio ratio-16x9 mx-auto", style: { 'max-width': '50%' } }, index.h("img", { class: "card-img-bottom object-fit-cover", style: { 'object-position': `${focusX} ${focusY}`, 'min-height': '15rem' }, alt: "News Picture", "data-lazy": (_g = (_f = (_e = (_d = (_c = translation === null || translation === void 0 ? void 0 : translation.image) !== null && _c !== void 0 ? _c : translation === null || translation === void 0 ? void 0 : translation.optimizedListImage) !== null && _d !== void 0 ? _d : translation === null || translation === void 0 ? void 0 : translation.optimizedImage) !== null && _e !== void 0 ? _e : article.attributes.image) !== null && _f !== void 0 ? _f : article.attributes.optimizedListImage) !== null && _g !== void 0 ? _g : article.attributes.optimizedImage }))));
21076
21105
  })));
21077
21106
  }
21078
21107
  };