@aiconomy/aico-components 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/aico-components/aico-components.esm.js +1 -1
- package/dist/aico-components/aico-components.esm.js.map +1 -1
- package/dist/aico-components/{p-17b7115a.entry.js → p-cf9b69ea.entry.js} +3 -3
- package/dist/aico-components/p-cf9b69ea.entry.js.map +1 -0
- package/dist/cjs/aico-album-content_28.cjs.entry.js +131 -10
- package/dist/cjs/aico-album-content_28.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-article-detail/aico-article-detail.js +11 -7
- package/dist/collection/components/aico-article-detail/aico-article-detail.js.map +1 -1
- package/dist/collection/components/aico-neo-content/aico-neo-content.js +53 -2
- package/dist/collection/components/aico-neo-content/aico-neo-content.js.map +1 -1
- package/dist/collection/utils/neo/neo-lead-trim.js +106 -0
- package/dist/collection/utils/neo/neo-lead-trim.js.map +1 -0
- package/dist/components/aico-article-detail2.js +11 -7
- package/dist/components/aico-article-detail2.js.map +1 -1
- package/dist/components/aico-neo-content2.js +126 -5
- package/dist/components/aico-neo-content2.js.map +1 -1
- package/dist/esm/aico-album-content_28.entry.js +131 -10
- package/dist/esm/aico-album-content_28.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 +134 -11
- package/dist/ssr/index.mjs +134 -11
- package/dist/types/components/aico-article-detail/aico-article-detail.d.ts +3 -1
- package/dist/types/components/aico-neo-content/aico-neo-content.d.ts +10 -0
- package/dist/types/components.d.ts +16 -0
- package/dist/types/utils/neo/neo-lead-trim.d.ts +33 -0
- package/package.json +1 -1
- package/dist/aico-components/p-17b7115a.entry.js.map +0 -1
|
@@ -16,7 +16,7 @@ var patchBrowser = () => {
|
|
|
16
16
|
|
|
17
17
|
patchBrowser().then(async (options) => {
|
|
18
18
|
await globalScripts();
|
|
19
|
-
return bootstrapLazy([["aico-asking-list-content",[[6,"aico-asking-list-content"]]],["aico-collection-content",[[6,"aico-collection-content"]]],["aico-album-content_28",[[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"],"userAccessToken":[1,"user-access-token"],"newsChannels":[1,"news-channels"],"newsSellerIds":[1,"news-seller-ids"],"newsBrandIds":[1,"news-brand-ids"],"newsLanguageLocales":[1,"news-language-locales"],"hideTopArticles":[4,"hide-top-articles"],"hideSpecialArticles":[4,"hide-special-articles"],"latestNews":[4,"latest-news"],"allBrands":[4,"all-brands"],"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"],"userAccessToken":[1,"user-access-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"],"userAccessToken":[1,"user-access-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]}],[0,"aico-neo-content",{"neoDocument":[16],"locale":[1],"defaultLocale":[1,"default-locale"]},null,{"neoDocument":["prepareHtml"],"locale":["prepareHtml"],"defaultLocale":["prepareHtml"]}],[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);
|
|
19
|
+
return bootstrapLazy([["aico-asking-list-content",[[6,"aico-asking-list-content"]]],["aico-collection-content",[[6,"aico-collection-content"]]],["aico-album-content_28",[[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"],"userAccessToken":[1,"user-access-token"],"newsChannels":[1,"news-channels"],"newsSellerIds":[1,"news-seller-ids"],"newsBrandIds":[1,"news-brand-ids"],"newsLanguageLocales":[1,"news-language-locales"],"hideTopArticles":[4,"hide-top-articles"],"hideSpecialArticles":[4,"hide-special-articles"],"latestNews":[4,"latest-news"],"allBrands":[4,"all-brands"],"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"],"userAccessToken":[1,"user-access-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"],"userAccessToken":[1,"user-access-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]}],[0,"aico-neo-content",{"neoDocument":[16],"locale":[1],"defaultLocale":[1,"default-locale"],"trimLeadImage":[4,"trim-lead-image"],"dedupeTitle":[1,"dedupe-title"]},null,{"neoDocument":["prepareHtml"],"locale":["prepareHtml"],"defaultLocale":["prepareHtml"],"trimLeadImage":["prepareHtml"],"dedupeTitle":["prepareHtml"]}],[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
20
|
});
|
|
21
21
|
|
|
22
22
|
//# sourceMappingURL=aico-components.js.map
|
package/dist/esm/loader.js
CHANGED
|
@@ -5,7 +5,7 @@ import { g as globalScripts } from './app-globals-0f993ce5.js';
|
|
|
5
5
|
const defineCustomElements = async (win, options) => {
|
|
6
6
|
if (typeof window === 'undefined') return undefined;
|
|
7
7
|
await globalScripts();
|
|
8
|
-
return bootstrapLazy([["aico-asking-list-content",[[6,"aico-asking-list-content"]]],["aico-collection-content",[[6,"aico-collection-content"]]],["aico-album-content_28",[[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"],"userAccessToken":[1,"user-access-token"],"newsChannels":[1,"news-channels"],"newsSellerIds":[1,"news-seller-ids"],"newsBrandIds":[1,"news-brand-ids"],"newsLanguageLocales":[1,"news-language-locales"],"hideTopArticles":[4,"hide-top-articles"],"hideSpecialArticles":[4,"hide-special-articles"],"latestNews":[4,"latest-news"],"allBrands":[4,"all-brands"],"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"],"userAccessToken":[1,"user-access-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"],"userAccessToken":[1,"user-access-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]}],[0,"aico-neo-content",{"neoDocument":[16],"locale":[1],"defaultLocale":[1,"default-locale"]},null,{"neoDocument":["prepareHtml"],"locale":["prepareHtml"],"defaultLocale":["prepareHtml"]}],[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);
|
|
8
|
+
return bootstrapLazy([["aico-asking-list-content",[[6,"aico-asking-list-content"]]],["aico-collection-content",[[6,"aico-collection-content"]]],["aico-album-content_28",[[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"],"userAccessToken":[1,"user-access-token"],"newsChannels":[1,"news-channels"],"newsSellerIds":[1,"news-seller-ids"],"newsBrandIds":[1,"news-brand-ids"],"newsLanguageLocales":[1,"news-language-locales"],"hideTopArticles":[4,"hide-top-articles"],"hideSpecialArticles":[4,"hide-special-articles"],"latestNews":[4,"latest-news"],"allBrands":[4,"all-brands"],"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"],"userAccessToken":[1,"user-access-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"],"userAccessToken":[1,"user-access-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]}],[0,"aico-neo-content",{"neoDocument":[16],"locale":[1],"defaultLocale":[1,"default-locale"],"trimLeadImage":[4,"trim-lead-image"],"dedupeTitle":[1,"dedupe-title"]},null,{"neoDocument":["prepareHtml"],"locale":["prepareHtml"],"defaultLocale":["prepareHtml"],"trimLeadImage":["prepareHtml"],"dedupeTitle":["prepareHtml"]}],[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
9
|
};
|
|
10
10
|
|
|
11
11
|
export { defineCustomElements };
|
package/dist/ssr/index.js
CHANGED
|
@@ -16187,11 +16187,11 @@ class AicoArticleDetail {
|
|
|
16187
16187
|
const translation = (_a = this.article.attributes.translations.find(translation => translation.locale === this.locale)) !== null && _a !== void 0 ? _a : null;
|
|
16188
16188
|
const category = (_c = (_b = this.article.attributes.newsCategory) === null || _b === void 0 ? void 0 : _b.translations.find(translation => translation.locale === this.locale)) !== null && _c !== void 0 ? _c : null;
|
|
16189
16189
|
const articleDate = new Date(this.article.attributes.publishDate);
|
|
16190
|
-
const content = this.mapBodyContent();
|
|
16190
|
+
const content = this.mapBodyContent(translation);
|
|
16191
16191
|
const headlineFocusX = this.article.attributes.headlineImageFocusXPercentage ? `${this.article.attributes.headlineImageFocusXPercentage}%` : 'center';
|
|
16192
16192
|
const headlineFocusY = this.article.attributes.headlineImageFocusYPercentage ? `${this.article.attributes.headlineImageFocusYPercentage}%` : 'center';
|
|
16193
16193
|
const headlineImage = (_d = translation === null || translation === void 0 ? void 0 : translation.headlineImage) !== null && _d !== void 0 ? _d : this.article.attributes.headlineImage;
|
|
16194
|
-
return (hAsync(Host, { key: '
|
|
16194
|
+
return (hAsync(Host, { key: '4973f50c2a561ff5f68ff16b29285dde0ef75f87' }, hAsync("figure", { key: '363fdcf4f12d61022d5153216ad574f590dc3e82', class: "figure" }, hAsync("blockquote", { key: '357d1a947423d3bb99748ebfe65c0ce6f95647cb', class: "blockquote" }, hAsync("h2", { key: 'd1037e2b0b71bab77fc37b36f7533d6d141ac406', class: "text-uppercase" }, (_e = translation === null || translation === void 0 ? void 0 : translation.name) !== null && _e !== void 0 ? _e : this.article.attributes.name)), headlineImage && hAsync("img", { key: '265565ff90b7b243555fb1c2aa5441e20826b43a', class: "figure-img img-fluid rounded object-fit-cover", style: { 'object-position': `${headlineFocusX} ${headlineFocusY}` }, alt: "Headline image", src: headlineImage }), hAsync(ConditionalRender, { key: '3f94832f01549a5511a4927c53286c114953228d', condition: !this.hideDateAndAuthor }, hAsync("figcaption", { key: '7afe217a895b0f9546a2beda40c9f143acdcc358', class: "figure-caption mb-1" }, articleDate.toLocaleDateString('en-US', this.dateOptions), " by ", hAsync("cite", { key: '7a0c93292b1ed0bc39e8e94f68de9ba18ac99a36', title: "Author" }, this.article.attributes.author))), hAsync(ConditionalRender, { key: 'a89fb90d8e7f6ba6048b43a119d127c7a6c6879b', condition: !this.hideCategoryAndTags && !strIsNullOrEmptyOrWhitespace(category === null || category === void 0 ? void 0 : category.webName) }, hAsync("span", { key: '87aa1fe763f281238ed12d2b1dddbe043f58c8e6', class: "badge bg-info text-dark" }, category === null || category === void 0 ? void 0 : category.webName))), hAsync("div", { key: 'e0bb9d8ebbedc684e4cb848042998874e3c7520b', class: "content-wrapper" }, content), hAsync(ConditionalRender, { key: '81c6c20f4f8274a01ff8b65f1bf2c319e1811998', condition: !this.hideCategoryAndTags }, this.article.attributes.newsTags.map(tag => {
|
|
16195
16195
|
var _a;
|
|
16196
16196
|
const translation = (_a = tag.translations.find(translation => translation.locale === this.locale)) !== null && _a !== void 0 ? _a : null;
|
|
16197
16197
|
return (hAsync(ConditionalRender, { condition: !strIsNullOrEmptyOrWhitespace(translation === null || translation === void 0 ? void 0 : translation.webName) }, hAsync("span", { class: "badge bg-light text-dark" }, translation.webName)));
|
|
@@ -16203,15 +16203,19 @@ class AicoArticleDetail {
|
|
|
16203
16203
|
* then empty, null, or a stale copy) — when the Neo document has sections it
|
|
16204
16204
|
* wins, mirroring the b2b storefront's precedence. Otherwise the legacy
|
|
16205
16205
|
* rows render; a null/absent legacy builder renders an empty body instead
|
|
16206
|
-
* of throwing.
|
|
16206
|
+
* of throwing. When this page already shows its own headline image/title
|
|
16207
|
+
* above the body, the Neo renderer is asked to trim a duplicate leading
|
|
16208
|
+
* hero image/heading from the document (see neo-lead-trim.ts).
|
|
16207
16209
|
*/
|
|
16208
|
-
mapBodyContent() {
|
|
16209
|
-
var _a, _b;
|
|
16210
|
+
mapBodyContent(translation) {
|
|
16211
|
+
var _a, _b, _c, _d;
|
|
16210
16212
|
const neoDocument = this.article.attributes.contentBuilderNeoJson;
|
|
16211
16213
|
if (neoDocumentHasContent(neoDocument)) {
|
|
16212
|
-
|
|
16214
|
+
const headlineImage = (_a = translation === null || translation === void 0 ? void 0 : translation.headlineImage) !== null && _a !== void 0 ? _a : this.article.attributes.headlineImage;
|
|
16215
|
+
const title = (_b = translation === null || translation === void 0 ? void 0 : translation.name) !== null && _b !== void 0 ? _b : this.article.attributes.name;
|
|
16216
|
+
return hAsync("aico-neo-content", { neoDocument: neoDocument, locale: this.locale, trimLeadImage: !!headlineImage, dedupeTitle: title });
|
|
16213
16217
|
}
|
|
16214
|
-
const rows = (
|
|
16218
|
+
const rows = (_d = (_c = this.article.attributes.contentBuilder) === null || _c === void 0 ? void 0 : _c.rows) !== null && _d !== void 0 ? _d : [];
|
|
16215
16219
|
return [...rows].sort((a, b) => a.order - b.order).map((row, index) => this.mapRowContent(row, index));
|
|
16216
16220
|
}
|
|
16217
16221
|
mapRowContent(row, index) {
|
|
@@ -23265,6 +23269,112 @@ function resolveLocale(document, locale, defaultLocale = null) {
|
|
|
23265
23269
|
return resolved;
|
|
23266
23270
|
}
|
|
23267
23271
|
|
|
23272
|
+
const ENTITIES = {
|
|
23273
|
+
'&': '&',
|
|
23274
|
+
'<': '<',
|
|
23275
|
+
'>': '>',
|
|
23276
|
+
'"': '"',
|
|
23277
|
+
''': "'",
|
|
23278
|
+
' ': ' ',
|
|
23279
|
+
};
|
|
23280
|
+
/** Plain text of an HTML fragment, whitespace-collapsed and lowercased (mirrors NeoNewsContentRenderer::normalizeText). */
|
|
23281
|
+
function normalizeText(html) {
|
|
23282
|
+
const stripped = html.replace(/<[^>]*>/g, '');
|
|
23283
|
+
const decoded = stripped.replace(/&|<|>|"|'| /g, entity => ENTITIES[entity]);
|
|
23284
|
+
return decoded.replace(/\s+/g, ' ').trim().toLowerCase();
|
|
23285
|
+
}
|
|
23286
|
+
function headingText(element) {
|
|
23287
|
+
var _a;
|
|
23288
|
+
const text = (_a = element.content) === null || _a === void 0 ? void 0 : _a.text;
|
|
23289
|
+
return typeof text === 'string' ? text : '';
|
|
23290
|
+
}
|
|
23291
|
+
/** Filters one elements array, recursing into `columns` children. Returns the input array by reference when nothing changed. */
|
|
23292
|
+
function trimElements(elements, state) {
|
|
23293
|
+
const result = [];
|
|
23294
|
+
let changed = false;
|
|
23295
|
+
for (const element of elements) {
|
|
23296
|
+
if (element.type === 'columns') {
|
|
23297
|
+
const children = Array.isArray(element.children) ? element.children : [];
|
|
23298
|
+
const newChildren = trimElements(children, state);
|
|
23299
|
+
if (newChildren.length === 0) {
|
|
23300
|
+
changed = true;
|
|
23301
|
+
continue;
|
|
23302
|
+
}
|
|
23303
|
+
if (newChildren !== children) {
|
|
23304
|
+
changed = true;
|
|
23305
|
+
result.push(Object.assign(Object.assign({}, element), { children: newChildren }));
|
|
23306
|
+
}
|
|
23307
|
+
else {
|
|
23308
|
+
result.push(element);
|
|
23309
|
+
}
|
|
23310
|
+
continue;
|
|
23311
|
+
}
|
|
23312
|
+
if (element.type === 'image') {
|
|
23313
|
+
// Images never end the lead: kept or dropped, either way the next
|
|
23314
|
+
// element is still evaluated as leading.
|
|
23315
|
+
if (state.atLeadingEdge && state.dropLeadingImage) {
|
|
23316
|
+
changed = true;
|
|
23317
|
+
continue;
|
|
23318
|
+
}
|
|
23319
|
+
result.push(element);
|
|
23320
|
+
continue;
|
|
23321
|
+
}
|
|
23322
|
+
if (element.type === 'divider') {
|
|
23323
|
+
// Dividers don't end the lead either.
|
|
23324
|
+
result.push(element);
|
|
23325
|
+
continue;
|
|
23326
|
+
}
|
|
23327
|
+
if (element.type === 'heading') {
|
|
23328
|
+
if (state.atLeadingEdge && state.normalizedTitle !== null && normalizeText(headingText(element)) === state.normalizedTitle) {
|
|
23329
|
+
changed = true;
|
|
23330
|
+
continue;
|
|
23331
|
+
}
|
|
23332
|
+
result.push(element);
|
|
23333
|
+
state.atLeadingEdge = false;
|
|
23334
|
+
continue;
|
|
23335
|
+
}
|
|
23336
|
+
// Any other element type (text, html, button, video, gallery, slideshow, …) is kept and ends the lead.
|
|
23337
|
+
result.push(element);
|
|
23338
|
+
state.atLeadingEdge = false;
|
|
23339
|
+
}
|
|
23340
|
+
return changed ? result : elements;
|
|
23341
|
+
}
|
|
23342
|
+
/**
|
|
23343
|
+
* Preprocesses a locale-resolved Neo document, dropping lead content that
|
|
23344
|
+
* duplicates the host page's own header. Non-mutating: returns the input
|
|
23345
|
+
* unchanged (same reference) when there is nothing to do, otherwise a new
|
|
23346
|
+
* document with a new `sections` array (untouched sections/elements may be
|
|
23347
|
+
* reused by reference).
|
|
23348
|
+
*/
|
|
23349
|
+
function trimNeoLead(document, options) {
|
|
23350
|
+
const sections = Array.isArray(document.sections) ? document.sections : [];
|
|
23351
|
+
if (sections.length === 0) {
|
|
23352
|
+
return document;
|
|
23353
|
+
}
|
|
23354
|
+
const dedupeTitle = options.dedupeTitle;
|
|
23355
|
+
const hasDedupeTitle = typeof dedupeTitle === 'string' && dedupeTitle.trim() !== '';
|
|
23356
|
+
if (!options.trimLeadImage && !hasDedupeTitle) {
|
|
23357
|
+
return document;
|
|
23358
|
+
}
|
|
23359
|
+
const state = {
|
|
23360
|
+
atLeadingEdge: true,
|
|
23361
|
+
dropLeadingImage: options.trimLeadImage,
|
|
23362
|
+
normalizedTitle: hasDedupeTitle ? normalizeText(dedupeTitle) : null,
|
|
23363
|
+
};
|
|
23364
|
+
const newSections = [];
|
|
23365
|
+
for (const section of sections) {
|
|
23366
|
+
const elements = Array.isArray(section.elements) ? section.elements : [];
|
|
23367
|
+
const newElements = trimElements(elements, state);
|
|
23368
|
+
if (newElements.length === 0) {
|
|
23369
|
+
// An empty section must not survive — this is what removes a
|
|
23370
|
+
// background-only hero section once its sole image is trimmed.
|
|
23371
|
+
continue;
|
|
23372
|
+
}
|
|
23373
|
+
newSections.push(newElements === elements ? section : Object.assign(Object.assign({}, section), { elements: newElements }));
|
|
23374
|
+
}
|
|
23375
|
+
return Object.assign(Object.assign({}, document), { sections: newSections });
|
|
23376
|
+
}
|
|
23377
|
+
|
|
23268
23378
|
/**
|
|
23269
23379
|
* news-neo-renderer.ts
|
|
23270
23380
|
*
|
|
@@ -24414,12 +24524,14 @@ class AicoNeoContent {
|
|
|
24414
24524
|
this.neoDocument = undefined;
|
|
24415
24525
|
this.locale = 'de';
|
|
24416
24526
|
this.defaultLocale = undefined;
|
|
24527
|
+
this.trimLeadImage = false;
|
|
24528
|
+
this.dedupeTitle = undefined;
|
|
24417
24529
|
}
|
|
24418
24530
|
componentWillLoad() {
|
|
24419
24531
|
this.prepareHtml();
|
|
24420
24532
|
}
|
|
24421
24533
|
prepareHtml() {
|
|
24422
|
-
var _a;
|
|
24534
|
+
var _a, _b;
|
|
24423
24535
|
if (!neoDocumentHasContent(this.neoDocument)) {
|
|
24424
24536
|
this.renderedHtml = '';
|
|
24425
24537
|
return;
|
|
@@ -24428,6 +24540,13 @@ class AicoNeoContent {
|
|
|
24428
24540
|
if (hasLocaleStructure(resolvedDocument)) {
|
|
24429
24541
|
resolvedDocument = resolveLocale(resolvedDocument, this.locale, (_a = this.defaultLocale) !== null && _a !== void 0 ? _a : null);
|
|
24430
24542
|
}
|
|
24543
|
+
if (this.trimLeadImage || this.dedupeTitle) {
|
|
24544
|
+
resolvedDocument = trimNeoLead(resolvedDocument, { trimLeadImage: this.trimLeadImage, dedupeTitle: (_b = this.dedupeTitle) !== null && _b !== void 0 ? _b : null });
|
|
24545
|
+
if (resolvedDocument.sections.length === 0) {
|
|
24546
|
+
this.renderedHtml = '';
|
|
24547
|
+
return;
|
|
24548
|
+
}
|
|
24549
|
+
}
|
|
24431
24550
|
setActiveLocale(this.locale);
|
|
24432
24551
|
this.renderedHtml = NewsNeo.render({ contentBuilderNeoJson: resolvedDocument });
|
|
24433
24552
|
}
|
|
@@ -24439,13 +24558,15 @@ class AicoNeoContent {
|
|
|
24439
24558
|
}
|
|
24440
24559
|
}
|
|
24441
24560
|
render() {
|
|
24442
|
-
return (hAsync(Host, { key: '
|
|
24561
|
+
return (hAsync(Host, { key: '663be625008bd9444656dfedd24cfe9fa97e7d43' }, hAsync("div", { key: 'f0827191bf2ccc6d8cb35644103aa558d338382f', class: "aico-neo-content-mount", innerHTML: this.renderedHtml })));
|
|
24443
24562
|
}
|
|
24444
24563
|
get host() { return getElement$1(this); }
|
|
24445
24564
|
static get watchers() { return {
|
|
24446
24565
|
"neoDocument": ["prepareHtml"],
|
|
24447
24566
|
"locale": ["prepareHtml"],
|
|
24448
|
-
"defaultLocale": ["prepareHtml"]
|
|
24567
|
+
"defaultLocale": ["prepareHtml"],
|
|
24568
|
+
"trimLeadImage": ["prepareHtml"],
|
|
24569
|
+
"dedupeTitle": ["prepareHtml"]
|
|
24449
24570
|
}; }
|
|
24450
24571
|
static get style() { return AicoNeoContentStyle0; }
|
|
24451
24572
|
static get cmpMeta() { return {
|
|
@@ -24454,7 +24575,9 @@ class AicoNeoContent {
|
|
|
24454
24575
|
"$members$": {
|
|
24455
24576
|
"neoDocument": [16],
|
|
24456
24577
|
"locale": [1],
|
|
24457
|
-
"defaultLocale": [1, "default-locale"]
|
|
24578
|
+
"defaultLocale": [1, "default-locale"],
|
|
24579
|
+
"trimLeadImage": [4, "trim-lead-image"],
|
|
24580
|
+
"dedupeTitle": [1, "dedupe-title"]
|
|
24458
24581
|
},
|
|
24459
24582
|
"$listeners$": undefined,
|
|
24460
24583
|
"$lazyBundleId$": "-",
|
package/dist/ssr/index.mjs
CHANGED
|
@@ -16183,11 +16183,11 @@ class AicoArticleDetail {
|
|
|
16183
16183
|
const translation = (_a = this.article.attributes.translations.find(translation => translation.locale === this.locale)) !== null && _a !== void 0 ? _a : null;
|
|
16184
16184
|
const category = (_c = (_b = this.article.attributes.newsCategory) === null || _b === void 0 ? void 0 : _b.translations.find(translation => translation.locale === this.locale)) !== null && _c !== void 0 ? _c : null;
|
|
16185
16185
|
const articleDate = new Date(this.article.attributes.publishDate);
|
|
16186
|
-
const content = this.mapBodyContent();
|
|
16186
|
+
const content = this.mapBodyContent(translation);
|
|
16187
16187
|
const headlineFocusX = this.article.attributes.headlineImageFocusXPercentage ? `${this.article.attributes.headlineImageFocusXPercentage}%` : 'center';
|
|
16188
16188
|
const headlineFocusY = this.article.attributes.headlineImageFocusYPercentage ? `${this.article.attributes.headlineImageFocusYPercentage}%` : 'center';
|
|
16189
16189
|
const headlineImage = (_d = translation === null || translation === void 0 ? void 0 : translation.headlineImage) !== null && _d !== void 0 ? _d : this.article.attributes.headlineImage;
|
|
16190
|
-
return (hAsync(Host, { key: '
|
|
16190
|
+
return (hAsync(Host, { key: '4973f50c2a561ff5f68ff16b29285dde0ef75f87' }, hAsync("figure", { key: '363fdcf4f12d61022d5153216ad574f590dc3e82', class: "figure" }, hAsync("blockquote", { key: '357d1a947423d3bb99748ebfe65c0ce6f95647cb', class: "blockquote" }, hAsync("h2", { key: 'd1037e2b0b71bab77fc37b36f7533d6d141ac406', class: "text-uppercase" }, (_e = translation === null || translation === void 0 ? void 0 : translation.name) !== null && _e !== void 0 ? _e : this.article.attributes.name)), headlineImage && hAsync("img", { key: '265565ff90b7b243555fb1c2aa5441e20826b43a', class: "figure-img img-fluid rounded object-fit-cover", style: { 'object-position': `${headlineFocusX} ${headlineFocusY}` }, alt: "Headline image", src: headlineImage }), hAsync(ConditionalRender, { key: '3f94832f01549a5511a4927c53286c114953228d', condition: !this.hideDateAndAuthor }, hAsync("figcaption", { key: '7afe217a895b0f9546a2beda40c9f143acdcc358', class: "figure-caption mb-1" }, articleDate.toLocaleDateString('en-US', this.dateOptions), " by ", hAsync("cite", { key: '7a0c93292b1ed0bc39e8e94f68de9ba18ac99a36', title: "Author" }, this.article.attributes.author))), hAsync(ConditionalRender, { key: 'a89fb90d8e7f6ba6048b43a119d127c7a6c6879b', condition: !this.hideCategoryAndTags && !strIsNullOrEmptyOrWhitespace(category === null || category === void 0 ? void 0 : category.webName) }, hAsync("span", { key: '87aa1fe763f281238ed12d2b1dddbe043f58c8e6', class: "badge bg-info text-dark" }, category === null || category === void 0 ? void 0 : category.webName))), hAsync("div", { key: 'e0bb9d8ebbedc684e4cb848042998874e3c7520b', class: "content-wrapper" }, content), hAsync(ConditionalRender, { key: '81c6c20f4f8274a01ff8b65f1bf2c319e1811998', condition: !this.hideCategoryAndTags }, this.article.attributes.newsTags.map(tag => {
|
|
16191
16191
|
var _a;
|
|
16192
16192
|
const translation = (_a = tag.translations.find(translation => translation.locale === this.locale)) !== null && _a !== void 0 ? _a : null;
|
|
16193
16193
|
return (hAsync(ConditionalRender, { condition: !strIsNullOrEmptyOrWhitespace(translation === null || translation === void 0 ? void 0 : translation.webName) }, hAsync("span", { class: "badge bg-light text-dark" }, translation.webName)));
|
|
@@ -16199,15 +16199,19 @@ class AicoArticleDetail {
|
|
|
16199
16199
|
* then empty, null, or a stale copy) — when the Neo document has sections it
|
|
16200
16200
|
* wins, mirroring the b2b storefront's precedence. Otherwise the legacy
|
|
16201
16201
|
* rows render; a null/absent legacy builder renders an empty body instead
|
|
16202
|
-
* of throwing.
|
|
16202
|
+
* of throwing. When this page already shows its own headline image/title
|
|
16203
|
+
* above the body, the Neo renderer is asked to trim a duplicate leading
|
|
16204
|
+
* hero image/heading from the document (see neo-lead-trim.ts).
|
|
16203
16205
|
*/
|
|
16204
|
-
mapBodyContent() {
|
|
16205
|
-
var _a, _b;
|
|
16206
|
+
mapBodyContent(translation) {
|
|
16207
|
+
var _a, _b, _c, _d;
|
|
16206
16208
|
const neoDocument = this.article.attributes.contentBuilderNeoJson;
|
|
16207
16209
|
if (neoDocumentHasContent(neoDocument)) {
|
|
16208
|
-
|
|
16210
|
+
const headlineImage = (_a = translation === null || translation === void 0 ? void 0 : translation.headlineImage) !== null && _a !== void 0 ? _a : this.article.attributes.headlineImage;
|
|
16211
|
+
const title = (_b = translation === null || translation === void 0 ? void 0 : translation.name) !== null && _b !== void 0 ? _b : this.article.attributes.name;
|
|
16212
|
+
return hAsync("aico-neo-content", { neoDocument: neoDocument, locale: this.locale, trimLeadImage: !!headlineImage, dedupeTitle: title });
|
|
16209
16213
|
}
|
|
16210
|
-
const rows = (
|
|
16214
|
+
const rows = (_d = (_c = this.article.attributes.contentBuilder) === null || _c === void 0 ? void 0 : _c.rows) !== null && _d !== void 0 ? _d : [];
|
|
16211
16215
|
return [...rows].sort((a, b) => a.order - b.order).map((row, index) => this.mapRowContent(row, index));
|
|
16212
16216
|
}
|
|
16213
16217
|
mapRowContent(row, index) {
|
|
@@ -23261,6 +23265,112 @@ function resolveLocale(document, locale, defaultLocale = null) {
|
|
|
23261
23265
|
return resolved;
|
|
23262
23266
|
}
|
|
23263
23267
|
|
|
23268
|
+
const ENTITIES = {
|
|
23269
|
+
'&': '&',
|
|
23270
|
+
'<': '<',
|
|
23271
|
+
'>': '>',
|
|
23272
|
+
'"': '"',
|
|
23273
|
+
''': "'",
|
|
23274
|
+
' ': ' ',
|
|
23275
|
+
};
|
|
23276
|
+
/** Plain text of an HTML fragment, whitespace-collapsed and lowercased (mirrors NeoNewsContentRenderer::normalizeText). */
|
|
23277
|
+
function normalizeText(html) {
|
|
23278
|
+
const stripped = html.replace(/<[^>]*>/g, '');
|
|
23279
|
+
const decoded = stripped.replace(/&|<|>|"|'| /g, entity => ENTITIES[entity]);
|
|
23280
|
+
return decoded.replace(/\s+/g, ' ').trim().toLowerCase();
|
|
23281
|
+
}
|
|
23282
|
+
function headingText(element) {
|
|
23283
|
+
var _a;
|
|
23284
|
+
const text = (_a = element.content) === null || _a === void 0 ? void 0 : _a.text;
|
|
23285
|
+
return typeof text === 'string' ? text : '';
|
|
23286
|
+
}
|
|
23287
|
+
/** Filters one elements array, recursing into `columns` children. Returns the input array by reference when nothing changed. */
|
|
23288
|
+
function trimElements(elements, state) {
|
|
23289
|
+
const result = [];
|
|
23290
|
+
let changed = false;
|
|
23291
|
+
for (const element of elements) {
|
|
23292
|
+
if (element.type === 'columns') {
|
|
23293
|
+
const children = Array.isArray(element.children) ? element.children : [];
|
|
23294
|
+
const newChildren = trimElements(children, state);
|
|
23295
|
+
if (newChildren.length === 0) {
|
|
23296
|
+
changed = true;
|
|
23297
|
+
continue;
|
|
23298
|
+
}
|
|
23299
|
+
if (newChildren !== children) {
|
|
23300
|
+
changed = true;
|
|
23301
|
+
result.push(Object.assign(Object.assign({}, element), { children: newChildren }));
|
|
23302
|
+
}
|
|
23303
|
+
else {
|
|
23304
|
+
result.push(element);
|
|
23305
|
+
}
|
|
23306
|
+
continue;
|
|
23307
|
+
}
|
|
23308
|
+
if (element.type === 'image') {
|
|
23309
|
+
// Images never end the lead: kept or dropped, either way the next
|
|
23310
|
+
// element is still evaluated as leading.
|
|
23311
|
+
if (state.atLeadingEdge && state.dropLeadingImage) {
|
|
23312
|
+
changed = true;
|
|
23313
|
+
continue;
|
|
23314
|
+
}
|
|
23315
|
+
result.push(element);
|
|
23316
|
+
continue;
|
|
23317
|
+
}
|
|
23318
|
+
if (element.type === 'divider') {
|
|
23319
|
+
// Dividers don't end the lead either.
|
|
23320
|
+
result.push(element);
|
|
23321
|
+
continue;
|
|
23322
|
+
}
|
|
23323
|
+
if (element.type === 'heading') {
|
|
23324
|
+
if (state.atLeadingEdge && state.normalizedTitle !== null && normalizeText(headingText(element)) === state.normalizedTitle) {
|
|
23325
|
+
changed = true;
|
|
23326
|
+
continue;
|
|
23327
|
+
}
|
|
23328
|
+
result.push(element);
|
|
23329
|
+
state.atLeadingEdge = false;
|
|
23330
|
+
continue;
|
|
23331
|
+
}
|
|
23332
|
+
// Any other element type (text, html, button, video, gallery, slideshow, …) is kept and ends the lead.
|
|
23333
|
+
result.push(element);
|
|
23334
|
+
state.atLeadingEdge = false;
|
|
23335
|
+
}
|
|
23336
|
+
return changed ? result : elements;
|
|
23337
|
+
}
|
|
23338
|
+
/**
|
|
23339
|
+
* Preprocesses a locale-resolved Neo document, dropping lead content that
|
|
23340
|
+
* duplicates the host page's own header. Non-mutating: returns the input
|
|
23341
|
+
* unchanged (same reference) when there is nothing to do, otherwise a new
|
|
23342
|
+
* document with a new `sections` array (untouched sections/elements may be
|
|
23343
|
+
* reused by reference).
|
|
23344
|
+
*/
|
|
23345
|
+
function trimNeoLead(document, options) {
|
|
23346
|
+
const sections = Array.isArray(document.sections) ? document.sections : [];
|
|
23347
|
+
if (sections.length === 0) {
|
|
23348
|
+
return document;
|
|
23349
|
+
}
|
|
23350
|
+
const dedupeTitle = options.dedupeTitle;
|
|
23351
|
+
const hasDedupeTitle = typeof dedupeTitle === 'string' && dedupeTitle.trim() !== '';
|
|
23352
|
+
if (!options.trimLeadImage && !hasDedupeTitle) {
|
|
23353
|
+
return document;
|
|
23354
|
+
}
|
|
23355
|
+
const state = {
|
|
23356
|
+
atLeadingEdge: true,
|
|
23357
|
+
dropLeadingImage: options.trimLeadImage,
|
|
23358
|
+
normalizedTitle: hasDedupeTitle ? normalizeText(dedupeTitle) : null,
|
|
23359
|
+
};
|
|
23360
|
+
const newSections = [];
|
|
23361
|
+
for (const section of sections) {
|
|
23362
|
+
const elements = Array.isArray(section.elements) ? section.elements : [];
|
|
23363
|
+
const newElements = trimElements(elements, state);
|
|
23364
|
+
if (newElements.length === 0) {
|
|
23365
|
+
// An empty section must not survive — this is what removes a
|
|
23366
|
+
// background-only hero section once its sole image is trimmed.
|
|
23367
|
+
continue;
|
|
23368
|
+
}
|
|
23369
|
+
newSections.push(newElements === elements ? section : Object.assign(Object.assign({}, section), { elements: newElements }));
|
|
23370
|
+
}
|
|
23371
|
+
return Object.assign(Object.assign({}, document), { sections: newSections });
|
|
23372
|
+
}
|
|
23373
|
+
|
|
23264
23374
|
/**
|
|
23265
23375
|
* news-neo-renderer.ts
|
|
23266
23376
|
*
|
|
@@ -24410,12 +24520,14 @@ class AicoNeoContent {
|
|
|
24410
24520
|
this.neoDocument = undefined;
|
|
24411
24521
|
this.locale = 'de';
|
|
24412
24522
|
this.defaultLocale = undefined;
|
|
24523
|
+
this.trimLeadImage = false;
|
|
24524
|
+
this.dedupeTitle = undefined;
|
|
24413
24525
|
}
|
|
24414
24526
|
componentWillLoad() {
|
|
24415
24527
|
this.prepareHtml();
|
|
24416
24528
|
}
|
|
24417
24529
|
prepareHtml() {
|
|
24418
|
-
var _a;
|
|
24530
|
+
var _a, _b;
|
|
24419
24531
|
if (!neoDocumentHasContent(this.neoDocument)) {
|
|
24420
24532
|
this.renderedHtml = '';
|
|
24421
24533
|
return;
|
|
@@ -24424,6 +24536,13 @@ class AicoNeoContent {
|
|
|
24424
24536
|
if (hasLocaleStructure(resolvedDocument)) {
|
|
24425
24537
|
resolvedDocument = resolveLocale(resolvedDocument, this.locale, (_a = this.defaultLocale) !== null && _a !== void 0 ? _a : null);
|
|
24426
24538
|
}
|
|
24539
|
+
if (this.trimLeadImage || this.dedupeTitle) {
|
|
24540
|
+
resolvedDocument = trimNeoLead(resolvedDocument, { trimLeadImage: this.trimLeadImage, dedupeTitle: (_b = this.dedupeTitle) !== null && _b !== void 0 ? _b : null });
|
|
24541
|
+
if (resolvedDocument.sections.length === 0) {
|
|
24542
|
+
this.renderedHtml = '';
|
|
24543
|
+
return;
|
|
24544
|
+
}
|
|
24545
|
+
}
|
|
24427
24546
|
setActiveLocale(this.locale);
|
|
24428
24547
|
this.renderedHtml = NewsNeo.render({ contentBuilderNeoJson: resolvedDocument });
|
|
24429
24548
|
}
|
|
@@ -24435,13 +24554,15 @@ class AicoNeoContent {
|
|
|
24435
24554
|
}
|
|
24436
24555
|
}
|
|
24437
24556
|
render() {
|
|
24438
|
-
return (hAsync(Host, { key: '
|
|
24557
|
+
return (hAsync(Host, { key: '663be625008bd9444656dfedd24cfe9fa97e7d43' }, hAsync("div", { key: 'f0827191bf2ccc6d8cb35644103aa558d338382f', class: "aico-neo-content-mount", innerHTML: this.renderedHtml })));
|
|
24439
24558
|
}
|
|
24440
24559
|
get host() { return getElement$1(this); }
|
|
24441
24560
|
static get watchers() { return {
|
|
24442
24561
|
"neoDocument": ["prepareHtml"],
|
|
24443
24562
|
"locale": ["prepareHtml"],
|
|
24444
|
-
"defaultLocale": ["prepareHtml"]
|
|
24563
|
+
"defaultLocale": ["prepareHtml"],
|
|
24564
|
+
"trimLeadImage": ["prepareHtml"],
|
|
24565
|
+
"dedupeTitle": ["prepareHtml"]
|
|
24445
24566
|
}; }
|
|
24446
24567
|
static get style() { return AicoNeoContentStyle0; }
|
|
24447
24568
|
static get cmpMeta() { return {
|
|
@@ -24450,7 +24571,9 @@ class AicoNeoContent {
|
|
|
24450
24571
|
"$members$": {
|
|
24451
24572
|
"neoDocument": [16],
|
|
24452
24573
|
"locale": [1],
|
|
24453
|
-
"defaultLocale": [1, "default-locale"]
|
|
24574
|
+
"defaultLocale": [1, "default-locale"],
|
|
24575
|
+
"trimLeadImage": [4, "trim-lead-image"],
|
|
24576
|
+
"dedupeTitle": [1, "dedupe-title"]
|
|
24454
24577
|
},
|
|
24455
24578
|
"$listeners$": undefined,
|
|
24456
24579
|
"$lazyBundleId$": "-",
|
|
@@ -23,7 +23,9 @@ export declare class AicoArticleDetail {
|
|
|
23
23
|
* then empty, null, or a stale copy) — when the Neo document has sections it
|
|
24
24
|
* wins, mirroring the b2b storefront's precedence. Otherwise the legacy
|
|
25
25
|
* rows render; a null/absent legacy builder renders an empty body instead
|
|
26
|
-
* of throwing.
|
|
26
|
+
* of throwing. When this page already shows its own headline image/title
|
|
27
|
+
* above the body, the Neo renderer is asked to trim a duplicate leading
|
|
28
|
+
* hero image/heading from the document (see neo-lead-trim.ts).
|
|
27
29
|
*/
|
|
28
30
|
private mapBodyContent;
|
|
29
31
|
private mapRowContent;
|
|
@@ -25,6 +25,16 @@ export declare class AicoNeoContent {
|
|
|
25
25
|
* language has no entries (mirrors the storefront's fallback rule).
|
|
26
26
|
*/
|
|
27
27
|
defaultLocale?: string;
|
|
28
|
+
/**
|
|
29
|
+
* Drop lead body images — the host page already shows its own hero image
|
|
30
|
+
* above this content (see aico-article-detail).
|
|
31
|
+
*/
|
|
32
|
+
trimLeadImage: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Drop a leading heading whose text equals this — the host page's own
|
|
35
|
+
* title, restated as the article's first heading.
|
|
36
|
+
*/
|
|
37
|
+
dedupeTitle?: string;
|
|
28
38
|
private renderedHtml;
|
|
29
39
|
componentWillLoad(): void;
|
|
30
40
|
prepareHtml(): void;
|
|
@@ -159,6 +159,10 @@ export namespace Components {
|
|
|
159
159
|
* would never reach that markup.
|
|
160
160
|
*/
|
|
161
161
|
interface AicoNeoContent {
|
|
162
|
+
/**
|
|
163
|
+
* Drop a leading heading whose text equals this — the host page's own title, restated as the article's first heading.
|
|
164
|
+
*/
|
|
165
|
+
"dedupeTitle"?: string;
|
|
162
166
|
/**
|
|
163
167
|
* The shop's default locale — the override fallback when the requested language has no entries (mirrors the storefront's fallback rule).
|
|
164
168
|
*/
|
|
@@ -171,6 +175,10 @@ export namespace Components {
|
|
|
171
175
|
* The Neo content-builder document (`attributes.contentBuilderNeoJson`).
|
|
172
176
|
*/
|
|
173
177
|
"neoDocument": NeoDocument;
|
|
178
|
+
/**
|
|
179
|
+
* Drop lead body images — the host page already shows its own hero image above this content (see aico-article-detail).
|
|
180
|
+
*/
|
|
181
|
+
"trimLeadImage": boolean;
|
|
174
182
|
}
|
|
175
183
|
interface AicoNewsContent {
|
|
176
184
|
"content": NewsContent;
|
|
@@ -772,6 +780,10 @@ declare namespace LocalJSX {
|
|
|
772
780
|
* would never reach that markup.
|
|
773
781
|
*/
|
|
774
782
|
interface AicoNeoContent {
|
|
783
|
+
/**
|
|
784
|
+
* Drop a leading heading whose text equals this — the host page's own title, restated as the article's first heading.
|
|
785
|
+
*/
|
|
786
|
+
"dedupeTitle"?: string;
|
|
775
787
|
/**
|
|
776
788
|
* The shop's default locale — the override fallback when the requested language has no entries (mirrors the storefront's fallback rule).
|
|
777
789
|
*/
|
|
@@ -784,6 +796,10 @@ declare namespace LocalJSX {
|
|
|
784
796
|
* The Neo content-builder document (`attributes.contentBuilderNeoJson`).
|
|
785
797
|
*/
|
|
786
798
|
"neoDocument": NeoDocument;
|
|
799
|
+
/**
|
|
800
|
+
* Drop lead body images — the host page already shows its own hero image above this content (see aico-article-detail).
|
|
801
|
+
*/
|
|
802
|
+
"trimLeadImage"?: boolean;
|
|
787
803
|
}
|
|
788
804
|
interface AicoNewsContent {
|
|
789
805
|
"content": NewsContent;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* b2c lead-trimming for AICO Neo content-builder documents.
|
|
3
|
+
*
|
|
4
|
+
* `<aico-article-detail>` already renders its own header (title + headline
|
|
5
|
+
* image, see aico-article-detail.tsx), but Neo articles routinely restate
|
|
6
|
+
* both as their first section/elements (a hero image + a heading). Rendering
|
|
7
|
+
* them again would duplicate the host page's header. The dedup mirrors the
|
|
8
|
+
* b2b backend's `NeoNewsContentRenderer`: it is POSITIONAL — while nothing
|
|
9
|
+
* "real" has been emitted yet, drop body images (only when the host shows a
|
|
10
|
+
* hero) and drop a leading heading whose text equals the host's title;
|
|
11
|
+
* images/dividers never end the lead, anything else does.
|
|
12
|
+
*
|
|
13
|
+
* Kept as a SEPARATE preprocessor rather than folded into
|
|
14
|
+
* `news-neo-renderer.ts`, which is vendored verbatim from the kj theme and
|
|
15
|
+
* must stay diffable against it.
|
|
16
|
+
*/
|
|
17
|
+
import type { NeoDocument } from '../../model/article/NeoDocument';
|
|
18
|
+
export interface TrimNeoLeadOptions {
|
|
19
|
+
/** Drop lead body images — the host page already shows a hero image. */
|
|
20
|
+
trimLeadImage: boolean;
|
|
21
|
+
/** Drop a leading heading whose text equals this — the host page's own title. */
|
|
22
|
+
dedupeTitle?: string | null;
|
|
23
|
+
}
|
|
24
|
+
/** Plain text of an HTML fragment, whitespace-collapsed and lowercased (mirrors NeoNewsContentRenderer::normalizeText). */
|
|
25
|
+
export declare function normalizeText(html: string): string;
|
|
26
|
+
/**
|
|
27
|
+
* Preprocesses a locale-resolved Neo document, dropping lead content that
|
|
28
|
+
* duplicates the host page's own header. Non-mutating: returns the input
|
|
29
|
+
* unchanged (same reference) when there is nothing to do, otherwise a new
|
|
30
|
+
* document with a new `sections` array (untouched sections/elements may be
|
|
31
|
+
* reused by reference).
|
|
32
|
+
*/
|
|
33
|
+
export declare function trimNeoLead(document: NeoDocument, options: TrimNeoLeadOptions): NeoDocument;
|