@aiconomy/aico-components 0.0.181 → 0.0.187
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 +0 -513
- 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-a0c58a5e.entry.js → p-f2c14c63.entry.js} +3 -3
- package/dist/aico-components/p-f2c14c63.entry.js.map +1 -0
- package/dist/cjs/aico-album-content_27.cjs.entry.js +92 -64
- 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 +63 -23
- 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 +25 -5
- 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 +25 -5
- package/dist/collection/components/aico-top-news-carousel/aico-top-news-carousel.js.map +1 -1
- package/dist/collection/model/AicoApiRequestInfo.js +7 -3
- package/dist/collection/model/AicoApiRequestInfo.js.map +1 -1
- package/dist/collection/utils/utils.js +53 -34
- package/dist/collection/utils/utils.js.map +1 -1
- package/dist/components/aico-news-list.js +26 -21
- package/dist/components/aico-news-list.js.map +1 -1
- package/dist/components/aico-special-news-carousel.js +5 -3
- package/dist/components/aico-special-news-carousel.js.map +1 -1
- package/dist/components/aico-top-news-carousel.js +5 -3
- package/dist/components/aico-top-news-carousel.js.map +1 -1
- package/dist/components/utils.js +60 -37
- package/dist/components/utils.js.map +1 -1
- package/dist/esm/aico-album-content_27.entry.js +92 -64
- 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/ssr/index.js +97 -65
- package/dist/ssr/index.mjs +97 -65
- package/dist/types/components/aico-news-list/aico-news-list.d.ts +8 -0
- package/dist/types/components/aico-special-news-carousel/aico-special-news-carousel.d.ts +4 -0
- package/dist/types/components/aico-top-news-carousel/aico-top-news-carousel.d.ts +4 -0
- package/dist/types/components.d.ts +35 -3
- package/dist/types/model/AicoApiRequestInfo.d.ts +3 -2
- package/dist/types/utils/utils.d.ts +1 -1
- package/package.json +1 -1
- package/dist/aico-components/p-a0c58a5e.entry.js.map +0 -1
package/dist/ssr/index.mjs
CHANGED
|
@@ -15974,15 +15974,19 @@ const ConditionalRender = ({ condition }, children) => {
|
|
|
15974
15974
|
return condition ? children : [];
|
|
15975
15975
|
};
|
|
15976
15976
|
|
|
15977
|
-
const getAuthenticatedHeaders = (
|
|
15977
|
+
const getAuthenticatedHeaders = (token) => {
|
|
15978
15978
|
const headers = new Headers();
|
|
15979
15979
|
headers.append('Accept', 'application/vnd.api+json');
|
|
15980
|
-
headers.append('Authorization', `Bearer ${
|
|
15980
|
+
headers.append('Authorization', `Bearer ${token}`);
|
|
15981
15981
|
return headers;
|
|
15982
15982
|
};
|
|
15983
15983
|
const getAuthenticatedRequest = (api, route, query, signal) => {
|
|
15984
|
+
const token = api.bearerToken || api.accessToken;
|
|
15985
|
+
if (!token) {
|
|
15986
|
+
throw new Error('No valid token found');
|
|
15987
|
+
}
|
|
15984
15988
|
return new Request(new URL(`${route}?${query.toString()}`, api.baseApi), {
|
|
15985
|
-
headers: getAuthenticatedHeaders(
|
|
15989
|
+
headers: getAuthenticatedHeaders(token),
|
|
15986
15990
|
signal,
|
|
15987
15991
|
});
|
|
15988
15992
|
};
|
|
@@ -15992,58 +15996,77 @@ function setArrayFilter(queryParams, key, values) {
|
|
|
15992
15996
|
queryParams.append(key, value);
|
|
15993
15997
|
}
|
|
15994
15998
|
}
|
|
15995
|
-
async function fetchNewsArticles(api, page, size, signal, newsChannels = [], newsSellerIds = [], newsBrandIds = [], newsLanguageLocales = [], hideTopArticles = false, hideSpecialArticles = false) {
|
|
15999
|
+
async function fetchNewsArticles(api, page, size, signal, newsChannels = [], newsSellerIds = [], newsBrandIds = [], newsLanguageLocales = [], hideTopArticles = false, hideSpecialArticles = false, latestNews = false) {
|
|
16000
|
+
const url = api.bearerToken
|
|
16001
|
+
? 'news'
|
|
16002
|
+
: api.accessToken
|
|
16003
|
+
? latestNews
|
|
16004
|
+
? 'aico-shops/1/latest-news-resource'
|
|
16005
|
+
: 'aico-shops/1/news-resource'
|
|
16006
|
+
: '';
|
|
15996
16007
|
const queryParams = new URLSearchParams();
|
|
15997
16008
|
queryParams.set('page[number]', String(page));
|
|
15998
16009
|
queryParams.set('page[size]', String(size));
|
|
15999
|
-
|
|
16000
|
-
|
|
16001
|
-
|
|
16002
|
-
|
|
16003
|
-
|
|
16004
|
-
|
|
16005
|
-
|
|
16006
|
-
|
|
16007
|
-
|
|
16008
|
-
|
|
16009
|
-
|
|
16010
|
-
|
|
16011
|
-
|
|
16012
|
-
|
|
16010
|
+
if (api.bearerToken) {
|
|
16011
|
+
queryParams.set('sort', '-publishDate');
|
|
16012
|
+
queryParams.set('filter[isActive]', '1');
|
|
16013
|
+
queryParams.set('filter[excludeTag][]', 'Eisnull');
|
|
16014
|
+
setArrayFilter(queryParams, 'filter[channel][]', newsChannels);
|
|
16015
|
+
setArrayFilter(queryParams, 'filter[sellerIds][]', newsSellerIds);
|
|
16016
|
+
setArrayFilter(queryParams, 'filter[brandId][]', newsBrandIds);
|
|
16017
|
+
setArrayFilter(queryParams, 'filter[newsLanguage][]', newsLanguageLocales);
|
|
16018
|
+
if (hideTopArticles) {
|
|
16019
|
+
queryParams.set('filter[isTopNews]', '0');
|
|
16020
|
+
}
|
|
16021
|
+
if (hideSpecialArticles) {
|
|
16022
|
+
queryParams.set('filter[isSpecialArticle]', '0');
|
|
16023
|
+
}
|
|
16024
|
+
}
|
|
16025
|
+
const request = getAuthenticatedRequest(api, url, queryParams, signal);
|
|
16013
16026
|
const response = await fetch(request);
|
|
16014
16027
|
return await response.json();
|
|
16015
16028
|
}
|
|
16016
16029
|
async function fetchSpecialNewsArticles(api, page, size, signal, newsChannels = [], newsSellerIds = [], newsBrandIds = [], newsLanguageLocales = []) {
|
|
16030
|
+
const url = api.bearerToken
|
|
16031
|
+
? 'news'
|
|
16032
|
+
: 'aico-shops/1/news-resource';
|
|
16017
16033
|
const queryParams = new URLSearchParams();
|
|
16018
16034
|
queryParams.set('page[number]', String(page));
|
|
16019
16035
|
queryParams.set('page[size]', String(size));
|
|
16020
|
-
|
|
16021
|
-
|
|
16022
|
-
|
|
16023
|
-
|
|
16024
|
-
|
|
16025
|
-
|
|
16026
|
-
|
|
16027
|
-
|
|
16028
|
-
|
|
16029
|
-
|
|
16036
|
+
if (api.bearerToken) {
|
|
16037
|
+
queryParams.set('sort', '-publishDate');
|
|
16038
|
+
queryParams.set('filter[isActive]', '1');
|
|
16039
|
+
queryParams.set('filter[isSpecialArticle]', '1');
|
|
16040
|
+
queryParams.set('filter[isLightVersion]', 'true');
|
|
16041
|
+
queryParams.set('filter[excludeTag][]', 'Eisnull');
|
|
16042
|
+
setArrayFilter(queryParams, 'filter[channel][]', newsChannels);
|
|
16043
|
+
setArrayFilter(queryParams, 'filter[sellerIds][]', newsSellerIds);
|
|
16044
|
+
setArrayFilter(queryParams, 'filter[brandId][]', newsBrandIds);
|
|
16045
|
+
setArrayFilter(queryParams, 'filter[newsLanguage][]', newsLanguageLocales);
|
|
16046
|
+
}
|
|
16047
|
+
const request = getAuthenticatedRequest(api, url, queryParams, signal);
|
|
16030
16048
|
const response = await fetch(request);
|
|
16031
16049
|
return await response.json();
|
|
16032
16050
|
}
|
|
16033
16051
|
async function fetchTopNewsArticles(api, page, size, signal, newsChannels = [], newsSellerIds = [], newsBrandIds = [], newsLanguageLocales = []) {
|
|
16052
|
+
const url = api.bearerToken
|
|
16053
|
+
? 'news'
|
|
16054
|
+
: 'aico-shops/1/news-resource';
|
|
16034
16055
|
const queryParams = new URLSearchParams();
|
|
16035
16056
|
queryParams.set('page[number]', String(page));
|
|
16036
16057
|
queryParams.set('page[size]', String(size));
|
|
16037
|
-
|
|
16038
|
-
|
|
16039
|
-
|
|
16040
|
-
|
|
16041
|
-
|
|
16042
|
-
|
|
16043
|
-
|
|
16044
|
-
|
|
16045
|
-
|
|
16046
|
-
|
|
16058
|
+
if (api.bearerToken) {
|
|
16059
|
+
queryParams.set('sort', '-publishDate');
|
|
16060
|
+
queryParams.set('filter[isActive]', '1');
|
|
16061
|
+
queryParams.set('filter[isTopNews]', '1');
|
|
16062
|
+
queryParams.set('filter[isLightVersion]', 'true');
|
|
16063
|
+
queryParams.set('filter[excludeTag][]', 'Eisnull');
|
|
16064
|
+
setArrayFilter(queryParams, 'filter[channel][]', newsChannels);
|
|
16065
|
+
setArrayFilter(queryParams, 'filter[sellerIds][]', newsSellerIds);
|
|
16066
|
+
setArrayFilter(queryParams, 'filter[brandId][]', newsBrandIds);
|
|
16067
|
+
setArrayFilter(queryParams, 'filter[newsLanguage][]', newsLanguageLocales);
|
|
16068
|
+
}
|
|
16069
|
+
const request = getAuthenticatedRequest(api, url, queryParams, signal);
|
|
16047
16070
|
const response = await fetch(request);
|
|
16048
16071
|
return await response.json();
|
|
16049
16072
|
}
|
|
@@ -23078,13 +23101,15 @@ class AicoNewsList {
|
|
|
23078
23101
|
this.newsBrandIdsArr = [];
|
|
23079
23102
|
this.newsLanguageLocalesArr = [];
|
|
23080
23103
|
this.aicoUrl = undefined;
|
|
23081
|
-
this.aicoBearerToken =
|
|
23104
|
+
this.aicoBearerToken = '';
|
|
23105
|
+
this.userAccessToken = '';
|
|
23082
23106
|
this.newsChannels = '';
|
|
23083
23107
|
this.newsSellerIds = '';
|
|
23084
23108
|
this.newsBrandIds = '';
|
|
23085
23109
|
this.newsLanguageLocales = '';
|
|
23086
23110
|
this.hideTopArticles = true;
|
|
23087
23111
|
this.hideSpecialArticles = false;
|
|
23112
|
+
this.latestNews = false;
|
|
23088
23113
|
this.pageSize = 16;
|
|
23089
23114
|
this.nextButtonText = 'Next';
|
|
23090
23115
|
this.previousButtonText = 'Previous';
|
|
@@ -23093,7 +23118,7 @@ class AicoNewsList {
|
|
|
23093
23118
|
connectedCallback() {
|
|
23094
23119
|
this.newsListFetchController = new AbortController();
|
|
23095
23120
|
this.pageNumber = 1;
|
|
23096
|
-
this.api = { baseApi: this.aicoUrl, bearerToken: this.aicoBearerToken };
|
|
23121
|
+
this.api = { baseApi: this.aicoUrl, bearerToken: this.aicoBearerToken, accessToken: this.userAccessToken };
|
|
23097
23122
|
this.newsChannelsArr = splitByComma(this.newsChannels);
|
|
23098
23123
|
this.newsSellerIdsArr = splitByComma(this.newsSellerIds);
|
|
23099
23124
|
this.newsBrandIdsArr = splitByComma(this.newsBrandIds);
|
|
@@ -23103,36 +23128,37 @@ class AicoNewsList {
|
|
|
23103
23128
|
this.newsListFetchController.abort('disconnected');
|
|
23104
23129
|
}
|
|
23105
23130
|
async componentWillLoad() {
|
|
23106
|
-
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);
|
|
23131
|
+
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, this.latestNews);
|
|
23107
23132
|
}
|
|
23108
23133
|
async componentWillUpdate() {
|
|
23109
23134
|
this.newsListFetchController = new AbortController();
|
|
23110
|
-
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);
|
|
23135
|
+
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, this.latestNews);
|
|
23111
23136
|
}
|
|
23112
23137
|
render() {
|
|
23113
23138
|
var _a, _b, _c;
|
|
23114
|
-
return (hAsync(Host, { key: '
|
|
23139
|
+
return (hAsync(Host, { key: 'e1667c954dd75052b26f824431174b7e734b484c' }, hAsync("div", { key: '93ebe550604322a061fc082390592445491877a6', class: "newslist-grid-container mb-4" }, (_a = this.newsResponse) === null || _a === void 0 ? void 0 : _a.data.filter(article => this.latestNews || !article.attributes.isTopNews).map((article, articleIndex) => {
|
|
23115
23140
|
return (hAsync("div", { key: article.id, class: "col" }, hAsync("aico-news-list-item", { article: article, articleIndex: articleIndex, onArticleClick: e => {
|
|
23116
23141
|
var _a;
|
|
23117
23142
|
(_a = this.articleClick) === null || _a === void 0 ? void 0 : _a.emit(e.detail);
|
|
23118
23143
|
e.stopPropagation();
|
|
23119
23144
|
}, locale: this.locale })));
|
|
23120
|
-
})),
|
|
23121
|
-
|
|
23122
|
-
this.pageNumber
|
|
23123
|
-
|
|
23124
|
-
|
|
23125
|
-
|
|
23126
|
-
|
|
23127
|
-
|
|
23128
|
-
|
|
23129
|
-
|
|
23130
|
-
|
|
23131
|
-
|
|
23132
|
-
|
|
23133
|
-
this.pageNumber
|
|
23134
|
-
|
|
23135
|
-
|
|
23145
|
+
})), !this.latestNews &&
|
|
23146
|
+
hAsync("nav", { key: 'b4e081968bf0de39ca6deb53f46e51149ba90c96', class: "w-100", "aria-label": "News navigation" }, hAsync("ul", { key: '306919fae60915ef97b0f8b499105252cffa7355', class: "pagination justify-content-center" }, hAsync("li", { key: '2004858d91a1d36f344947003e16276c06d012e4', class: `page-item page-link user-select-none d-flex align-items-center ${!((_b = this.newsResponse) === null || _b === void 0 ? void 0 : _b.links.prev) ? 'disabled' : ''}`, style: { cursor: 'pointer' }, onClick: () => {
|
|
23147
|
+
if (this.pageNumber > 1) {
|
|
23148
|
+
this.pageNumber -= 1;
|
|
23149
|
+
}
|
|
23150
|
+
return false;
|
|
23151
|
+
} }, hAsync("svg", { key: '794bc0a90223b0bfb469732e64c8ecdc33cbf95f', 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" }, hAsync("path", { key: 'c114c34774e564ee68e70a72f02a53acc7d7403f', "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" })), this.previousButtonText), this.getViewablePages().map(page => (hAsync("li", { class: `page-item page-link user-select-none ${page === '...' ? 'disabled' : Number(page) === this.pageNumber ? 'active' : ''}`, style: { cursor: 'pointer' }, onClick: () => {
|
|
23152
|
+
if (page !== '...') {
|
|
23153
|
+
this.pageNumber = Number(page);
|
|
23154
|
+
}
|
|
23155
|
+
return false;
|
|
23156
|
+
} }, page))), hAsync("li", { key: 'a3b8aa8f9d69ad837e90b17f683fbcb97e70dd56', class: `page-item page-link user-select-none d-flex align-items-center ${!((_c = this.newsResponse) === null || _c === void 0 ? void 0 : _c.links.next) ? 'disabled' : ''}`, style: { cursor: 'pointer' }, onClick: () => {
|
|
23157
|
+
var _a, _b;
|
|
23158
|
+
if (((_a = this.newsResponse) === null || _a === void 0 ? void 0 : _a.meta.page.lastPage) && this.pageNumber < ((_b = this.newsResponse) === null || _b === void 0 ? void 0 : _b.meta.page.lastPage)) {
|
|
23159
|
+
this.pageNumber += 1;
|
|
23160
|
+
}
|
|
23161
|
+
} }, this.nextButtonText, hAsync("svg", { key: '46589c53b68ba1f8a87a893a63469e460d01b25e', 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" }, hAsync("path", { key: '5ea164fd74b2138274adcba33e0e54a42e52be4e', "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" })))))));
|
|
23136
23162
|
}
|
|
23137
23163
|
getViewablePages(lookAhead = 2) {
|
|
23138
23164
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
@@ -23169,12 +23195,14 @@ class AicoNewsList {
|
|
|
23169
23195
|
"$members$": {
|
|
23170
23196
|
"aicoUrl": [1, "aico-url"],
|
|
23171
23197
|
"aicoBearerToken": [1, "aico-bearer-token"],
|
|
23198
|
+
"userAccessToken": [1, "user-access-token"],
|
|
23172
23199
|
"newsChannels": [1, "news-channels"],
|
|
23173
23200
|
"newsSellerIds": [1, "news-seller-ids"],
|
|
23174
23201
|
"newsBrandIds": [1, "news-brand-ids"],
|
|
23175
23202
|
"newsLanguageLocales": [1, "news-language-locales"],
|
|
23176
23203
|
"hideTopArticles": [4, "hide-top-articles"],
|
|
23177
23204
|
"hideSpecialArticles": [4, "hide-special-articles"],
|
|
23205
|
+
"latestNews": [4, "latest-news"],
|
|
23178
23206
|
"pageSize": [2, "page-size"],
|
|
23179
23207
|
"nextButtonText": [1, "next-button-text"],
|
|
23180
23208
|
"previousButtonText": [1, "previous-button-text"],
|
|
@@ -23314,7 +23342,8 @@ class AicoSpecialNewsCarousel {
|
|
|
23314
23342
|
this.newsBrandIdsArr = [];
|
|
23315
23343
|
this.newsLanguageLocalesArr = [];
|
|
23316
23344
|
this.aicoUrl = undefined;
|
|
23317
|
-
this.aicoBearerToken =
|
|
23345
|
+
this.aicoBearerToken = '';
|
|
23346
|
+
this.userAccessToken = '';
|
|
23318
23347
|
this.newsChannels = '';
|
|
23319
23348
|
this.newsSellerIds = '';
|
|
23320
23349
|
this.newsBrandIds = '';
|
|
@@ -23324,7 +23353,7 @@ class AicoSpecialNewsCarousel {
|
|
|
23324
23353
|
}
|
|
23325
23354
|
connectedCallback() {
|
|
23326
23355
|
this.newsListFetchController = new AbortController();
|
|
23327
|
-
this.api = { baseApi: this.aicoUrl, bearerToken: this.aicoBearerToken };
|
|
23356
|
+
this.api = { baseApi: this.aicoUrl, bearerToken: this.aicoBearerToken, accessToken: this.userAccessToken };
|
|
23328
23357
|
this.newsChannelsArr = splitByComma(this.newsChannels);
|
|
23329
23358
|
this.newsSellerIdsArr = splitByComma(this.newsSellerIds);
|
|
23330
23359
|
this.newsBrandIdsArr = splitByComma(this.newsBrandIds);
|
|
@@ -23350,7 +23379,7 @@ class AicoSpecialNewsCarousel {
|
|
|
23350
23379
|
});
|
|
23351
23380
|
}
|
|
23352
23381
|
render() {
|
|
23353
|
-
return (hAsync("div", { key: '
|
|
23382
|
+
return (hAsync("div", { key: 'cdbe261371e46876ac8b4677067c0c1d60d2e9e9', class: "carousel" }, this.newsResponse.data.map(article => {
|
|
23354
23383
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
23355
23384
|
const focusX = article.attributes.focusXPercentage ? `${article.attributes.focusXPercentage}%` : 'center';
|
|
23356
23385
|
const focusY = article.attributes.focusYPercentage ? `${article.attributes.focusYPercentage}%` : 'center';
|
|
@@ -23369,6 +23398,7 @@ class AicoSpecialNewsCarousel {
|
|
|
23369
23398
|
"$members$": {
|
|
23370
23399
|
"aicoUrl": [1, "aico-url"],
|
|
23371
23400
|
"aicoBearerToken": [1, "aico-bearer-token"],
|
|
23401
|
+
"userAccessToken": [1, "user-access-token"],
|
|
23372
23402
|
"newsChannels": [1, "news-channels"],
|
|
23373
23403
|
"newsSellerIds": [1, "news-seller-ids"],
|
|
23374
23404
|
"newsBrandIds": [1, "news-brand-ids"],
|
|
@@ -23618,7 +23648,8 @@ class AicoTopNewsCarousel {
|
|
|
23618
23648
|
this.newsBrandIdsArr = [];
|
|
23619
23649
|
this.newsLanguageLocalesArr = [];
|
|
23620
23650
|
this.aicoUrl = undefined;
|
|
23621
|
-
this.aicoBearerToken =
|
|
23651
|
+
this.aicoBearerToken = '';
|
|
23652
|
+
this.userAccessToken = '';
|
|
23622
23653
|
this.newsChannels = '';
|
|
23623
23654
|
this.newsSellerIds = '';
|
|
23624
23655
|
this.newsBrandIds = '';
|
|
@@ -23628,7 +23659,7 @@ class AicoTopNewsCarousel {
|
|
|
23628
23659
|
}
|
|
23629
23660
|
connectedCallback() {
|
|
23630
23661
|
this.newsListFetchController = new AbortController();
|
|
23631
|
-
this.api = { baseApi: this.aicoUrl, bearerToken: this.aicoBearerToken };
|
|
23662
|
+
this.api = { baseApi: this.aicoUrl, bearerToken: this.aicoBearerToken, accessToken: this.userAccessToken };
|
|
23632
23663
|
this.newsChannelsArr = splitByComma(this.newsChannels);
|
|
23633
23664
|
this.newsSellerIdsArr = splitByComma(this.newsSellerIds);
|
|
23634
23665
|
this.newsBrandIdsArr = splitByComma(this.newsBrandIds);
|
|
@@ -23654,7 +23685,7 @@ class AicoTopNewsCarousel {
|
|
|
23654
23685
|
});
|
|
23655
23686
|
}
|
|
23656
23687
|
render() {
|
|
23657
|
-
return (hAsync("div", { key: '
|
|
23688
|
+
return (hAsync("div", { key: '403ffcf2505ada818121277bedf4099015221c9a', class: "carousel" }, this.newsResponse.data.map(article => {
|
|
23658
23689
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
23659
23690
|
const focusX = article.attributes.focusXPercentage ? `${article.attributes.focusXPercentage}%` : 'center';
|
|
23660
23691
|
const focusY = article.attributes.focusYPercentage ? `${article.attributes.focusYPercentage}%` : 'center';
|
|
@@ -23673,6 +23704,7 @@ class AicoTopNewsCarousel {
|
|
|
23673
23704
|
"$members$": {
|
|
23674
23705
|
"aicoUrl": [1, "aico-url"],
|
|
23675
23706
|
"aicoBearerToken": [1, "aico-bearer-token"],
|
|
23707
|
+
"userAccessToken": [1, "user-access-token"],
|
|
23676
23708
|
"newsChannels": [1, "news-channels"],
|
|
23677
23709
|
"newsSellerIds": [1, "news-seller-ids"],
|
|
23678
23710
|
"newsBrandIds": [1, "news-brand-ids"],
|
|
@@ -16,6 +16,10 @@ export declare class AicoNewsList {
|
|
|
16
16
|
* The token used to authenticate against he Aico Api.
|
|
17
17
|
*/
|
|
18
18
|
aicoBearerToken: string;
|
|
19
|
+
/**
|
|
20
|
+
* The user access token
|
|
21
|
+
*/
|
|
22
|
+
userAccessToken: string;
|
|
19
23
|
/**
|
|
20
24
|
* Channel names as a comma separated list used to filter the results.
|
|
21
25
|
*/
|
|
@@ -40,6 +44,10 @@ export declare class AicoNewsList {
|
|
|
40
44
|
* Determines wheter special articles will be included in the list or not.
|
|
41
45
|
*/
|
|
42
46
|
hideSpecialArticles: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Determines wheter special articles will be included in the list or not.
|
|
49
|
+
*/
|
|
50
|
+
latestNews: boolean;
|
|
43
51
|
/**
|
|
44
52
|
* The page size. Prefer this number to be even.
|
|
45
53
|
*/
|
|
@@ -16,6 +16,10 @@ export declare class AicoSpecialNewsCarousel {
|
|
|
16
16
|
* The token used to authenticate against he Aico Api.
|
|
17
17
|
*/
|
|
18
18
|
aicoBearerToken: string;
|
|
19
|
+
/**
|
|
20
|
+
* The user access token
|
|
21
|
+
*/
|
|
22
|
+
userAccessToken: string;
|
|
19
23
|
/**
|
|
20
24
|
* Channel names as a comma separated list used to filter the results.
|
|
21
25
|
*/
|
|
@@ -16,6 +16,10 @@ export declare class AicoTopNewsCarousel {
|
|
|
16
16
|
* The token used to authenticate against he Aico Api.
|
|
17
17
|
*/
|
|
18
18
|
aicoBearerToken: string;
|
|
19
|
+
/**
|
|
20
|
+
* The user access token
|
|
21
|
+
*/
|
|
22
|
+
userAccessToken: string;
|
|
19
23
|
/**
|
|
20
24
|
* Channel names as a comma separated list used to filter the results.
|
|
21
25
|
*/
|
|
@@ -167,6 +167,10 @@ export namespace Components {
|
|
|
167
167
|
* Determines wheter top articles will be included in the list or not.
|
|
168
168
|
*/
|
|
169
169
|
"hideTopArticles": boolean;
|
|
170
|
+
/**
|
|
171
|
+
* Determines wheter special articles will be included in the list or not.
|
|
172
|
+
*/
|
|
173
|
+
"latestNews": boolean;
|
|
170
174
|
/**
|
|
171
175
|
* The article translation that will be used to render the content. If the locale specified is not present in the article's translations, most content will not be shown.
|
|
172
176
|
*/
|
|
@@ -199,6 +203,10 @@ export namespace Components {
|
|
|
199
203
|
* The text used by the previous button in the pagination component.
|
|
200
204
|
*/
|
|
201
205
|
"previousButtonText": string;
|
|
206
|
+
/**
|
|
207
|
+
* The user access token
|
|
208
|
+
*/
|
|
209
|
+
"userAccessToken": string;
|
|
202
210
|
}
|
|
203
211
|
interface AicoNewsListItem {
|
|
204
212
|
"article": Article;
|
|
@@ -247,6 +255,10 @@ export namespace Components {
|
|
|
247
255
|
* The number of articles shown in the carousel. Prefer this number to be small.
|
|
248
256
|
*/
|
|
249
257
|
"numberOfArticles": number;
|
|
258
|
+
/**
|
|
259
|
+
* The user access token
|
|
260
|
+
*/
|
|
261
|
+
"userAccessToken": string;
|
|
250
262
|
}
|
|
251
263
|
interface AicoTableContent {
|
|
252
264
|
"content": TableContent;
|
|
@@ -296,6 +308,10 @@ export namespace Components {
|
|
|
296
308
|
* The number of articles shown in the carousel. Prefer this number to be small.
|
|
297
309
|
*/
|
|
298
310
|
"numberOfArticles": number;
|
|
311
|
+
/**
|
|
312
|
+
* The user access token
|
|
313
|
+
*/
|
|
314
|
+
"userAccessToken": string;
|
|
299
315
|
}
|
|
300
316
|
interface AicoUploadContent {
|
|
301
317
|
"content": UploadContent;
|
|
@@ -709,7 +725,7 @@ declare namespace LocalJSX {
|
|
|
709
725
|
/**
|
|
710
726
|
* The token used to authenticate against he Aico Api.
|
|
711
727
|
*/
|
|
712
|
-
"aicoBearerToken"
|
|
728
|
+
"aicoBearerToken"?: string;
|
|
713
729
|
/**
|
|
714
730
|
* The url of the Aico Api that will be used to retrieve the article.
|
|
715
731
|
*/
|
|
@@ -722,6 +738,10 @@ declare namespace LocalJSX {
|
|
|
722
738
|
* Determines wheter top articles will be included in the list or not.
|
|
723
739
|
*/
|
|
724
740
|
"hideTopArticles"?: boolean;
|
|
741
|
+
/**
|
|
742
|
+
* Determines wheter special articles will be included in the list or not.
|
|
743
|
+
*/
|
|
744
|
+
"latestNews"?: boolean;
|
|
725
745
|
/**
|
|
726
746
|
* The article translation that will be used to render the content. If the locale specified is not present in the article's translations, most content will not be shown.
|
|
727
747
|
*/
|
|
@@ -758,6 +778,10 @@ declare namespace LocalJSX {
|
|
|
758
778
|
* The text used by the previous button in the pagination component.
|
|
759
779
|
*/
|
|
760
780
|
"previousButtonText"?: string;
|
|
781
|
+
/**
|
|
782
|
+
* The user access token
|
|
783
|
+
*/
|
|
784
|
+
"userAccessToken"?: string;
|
|
761
785
|
}
|
|
762
786
|
interface AicoNewsListItem {
|
|
763
787
|
"article": Article;
|
|
@@ -779,7 +803,7 @@ declare namespace LocalJSX {
|
|
|
779
803
|
/**
|
|
780
804
|
* The token used to authenticate against he Aico Api.
|
|
781
805
|
*/
|
|
782
|
-
"aicoBearerToken"
|
|
806
|
+
"aicoBearerToken"?: string;
|
|
783
807
|
/**
|
|
784
808
|
* The url of the Aico Api that will be used to retrieve the article.
|
|
785
809
|
*/
|
|
@@ -812,6 +836,10 @@ declare namespace LocalJSX {
|
|
|
812
836
|
* Event emitted when a user clicks an article title. The handler receives the entire Article entity.
|
|
813
837
|
*/
|
|
814
838
|
"onArticleClicked"?: (event: AicoSpecialNewsCarouselCustomEvent<Article>) => void;
|
|
839
|
+
/**
|
|
840
|
+
* The user access token
|
|
841
|
+
*/
|
|
842
|
+
"userAccessToken"?: string;
|
|
815
843
|
}
|
|
816
844
|
interface AicoTableContent {
|
|
817
845
|
"content": TableContent;
|
|
@@ -832,7 +860,7 @@ declare namespace LocalJSX {
|
|
|
832
860
|
/**
|
|
833
861
|
* The token used to authenticate against he Aico Api.
|
|
834
862
|
*/
|
|
835
|
-
"aicoBearerToken"
|
|
863
|
+
"aicoBearerToken"?: string;
|
|
836
864
|
/**
|
|
837
865
|
* The url of the Aico Api that will be used to retrieve the article.
|
|
838
866
|
*/
|
|
@@ -865,6 +893,10 @@ declare namespace LocalJSX {
|
|
|
865
893
|
* Event emitted when a user clicks an article title. The handler receives the entire Article entity.
|
|
866
894
|
*/
|
|
867
895
|
"onArticleClicked"?: (event: AicoTopNewsCarouselCustomEvent<Article>) => void;
|
|
896
|
+
/**
|
|
897
|
+
* The user access token
|
|
898
|
+
*/
|
|
899
|
+
"userAccessToken"?: string;
|
|
868
900
|
}
|
|
869
901
|
interface AicoUploadContent {
|
|
870
902
|
"content": UploadContent;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export type AicoApiRequestInfo = {
|
|
2
2
|
baseApi: string;
|
|
3
|
-
bearerToken
|
|
3
|
+
bearerToken?: string;
|
|
4
|
+
accessToken?: string;
|
|
4
5
|
};
|
|
5
|
-
export declare const getAuthenticatedHeaders: (
|
|
6
|
+
export declare const getAuthenticatedHeaders: (token: string) => Headers;
|
|
6
7
|
export declare const getAuthenticatedRequest: (api: AicoApiRequestInfo, route: string, query: URLSearchParams, signal?: AbortSignal) => Request;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Article } from '../components';
|
|
2
2
|
import { AicoApiRequestInfo } from '../model/AicoApiRequestInfo';
|
|
3
3
|
import { NewsResponse } from '../model/NewsResponse';
|
|
4
|
-
export declare function fetchNewsArticles(api: AicoApiRequestInfo, page: number, size: number, signal: AbortSignal, newsChannels?: string[], newsSellerIds?: string[], newsBrandIds?: string[], newsLanguageLocales?: string[], hideTopArticles?: boolean, hideSpecialArticles?: boolean): Promise<NewsResponse>;
|
|
4
|
+
export declare function fetchNewsArticles(api: AicoApiRequestInfo, page: number, size: number, signal: AbortSignal, newsChannels?: string[], newsSellerIds?: string[], newsBrandIds?: string[], newsLanguageLocales?: string[], hideTopArticles?: boolean, hideSpecialArticles?: boolean, latestNews?: boolean): Promise<NewsResponse>;
|
|
5
5
|
export declare function fetchSpecialNewsArticles(api: AicoApiRequestInfo, page: number, size: number, signal: AbortSignal, newsChannels?: string[], newsSellerIds?: string[], newsBrandIds?: string[], newsLanguageLocales?: string[]): Promise<NewsResponse>;
|
|
6
6
|
export declare function fetchTopNewsArticles(api: AicoApiRequestInfo, page: number, size: number, signal: AbortSignal, newsChannels?: string[], newsSellerIds?: string[], newsBrandIds?: string[], newsLanguageLocales?: string[]): Promise<NewsResponse>;
|
|
7
7
|
export declare function fetchNewsArticle(api: AicoApiRequestInfo, articleId: string, signal: AbortSignal): Promise<Article>;
|