@aiconomy/aico-components 0.0.158 → 0.0.164
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/README.md +14 -12
- 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-076c2ca2.entry.js → p-43d0546f.entry.js} +3 -3
- package/dist/aico-components/p-43d0546f.entry.js.map +1 -0
- package/dist/cjs/aico-album-content_27.cjs.entry.js +15 -7
- package/dist/cjs/aico-album-content_27.cjs.entry.js.map +1 -1
- package/dist/cjs/aico-components.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/aico-news-list/aico-news-list.js +40 -2
- package/dist/collection/components/aico-news-list/aico-news-list.js.map +1 -1
- package/dist/collection/components/aico-special-news-carousel/aico-special-news-carousel.js +2 -2
- package/dist/collection/components/aico-special-news-carousel/aico-special-news-carousel.js.map +1 -1
- package/dist/collection/components/aico-top-news-carousel/aico-top-news-carousel.js +2 -2
- package/dist/collection/components/aico-top-news-carousel/aico-top-news-carousel.js.map +1 -1
- package/dist/collection/utils/utils.js +7 -1
- package/dist/collection/utils/utils.js.map +1 -1
- package/dist/components/aico-news-list.js +6 -2
- package/dist/components/aico-news-list.js.map +1 -1
- package/dist/components/aico-special-news-carousel.js +2 -2
- package/dist/components/aico-special-news-carousel.js.map +1 -1
- package/dist/components/aico-top-news-carousel.js +2 -2
- package/dist/components/aico-top-news-carousel.js.map +1 -1
- package/dist/components/utils.js +7 -1
- package/dist/components/utils.js.map +1 -1
- package/dist/esm/aico-album-content_27.entry.js +15 -7
- package/dist/esm/aico-album-content_27.entry.js.map +1 -1
- package/dist/esm/aico-components.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/types/components/aico-news-list/aico-news-list.d.ts +8 -0
- package/dist/types/components.d.ts +16 -0
- package/dist/types/utils/utils.d.ts +1 -1
- package/package.json +1 -1
- package/dist/aico-components/p-076c2ca2.entry.js.map +0 -1
|
@@ -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,11 +20673,11 @@ 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;
|
|
@@ -20830,7 +20838,7 @@ const AicoSpecialNewsCarousel = class {
|
|
|
20830
20838
|
}
|
|
20831
20839
|
render() {
|
|
20832
20840
|
return (index.h("div", { class: "carousel" }, this.newsResponse.data.map(article => {
|
|
20833
|
-
var _a, _b, _c, _d, _e, _f;
|
|
20841
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
20834
20842
|
const focusX = article.attributes.focusXPercentage ? `${article.attributes.focusXPercentage}%` : 'center';
|
|
20835
20843
|
const focusY = article.attributes.focusYPercentage ? `${article.attributes.focusYPercentage}%` : 'center';
|
|
20836
20844
|
const translation = article.attributes.translations.find(t => t.locale === this.locale);
|
|
@@ -20838,7 +20846,7 @@ const AicoSpecialNewsCarousel = class {
|
|
|
20838
20846
|
var _a;
|
|
20839
20847
|
e.preventDefault();
|
|
20840
20848
|
(_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 =
|
|
20849
|
+
} }, (_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
20850
|
})));
|
|
20843
20851
|
}
|
|
20844
20852
|
};
|
|
@@ -21064,7 +21072,7 @@ const AicoTopNewsCarousel = class {
|
|
|
21064
21072
|
}
|
|
21065
21073
|
render() {
|
|
21066
21074
|
return (index.h("div", { class: "carousel" }, this.newsResponse.data.map(article => {
|
|
21067
|
-
var _a, _b, _c, _d, _e, _f;
|
|
21075
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
21068
21076
|
const focusX = article.attributes.focusXPercentage ? `${article.attributes.focusXPercentage}%` : 'center';
|
|
21069
21077
|
const focusY = article.attributes.focusYPercentage ? `${article.attributes.focusYPercentage}%` : 'center';
|
|
21070
21078
|
const translation = article.attributes.translations.find(t => t.locale === this.locale);
|
|
@@ -21072,7 +21080,7 @@ const AicoTopNewsCarousel = class {
|
|
|
21072
21080
|
var _a;
|
|
21073
21081
|
e.preventDefault();
|
|
21074
21082
|
(_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 =
|
|
21083
|
+
} }, (_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
21084
|
})));
|
|
21077
21085
|
}
|
|
21078
21086
|
};
|