@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.
Files changed (30) hide show
  1. package/dist/aico-components/aico-components.esm.js +1 -1
  2. package/dist/aico-components/aico-components.esm.js.map +1 -1
  3. package/dist/aico-components/{p-17b7115a.entry.js → p-cf9b69ea.entry.js} +3 -3
  4. package/dist/aico-components/p-cf9b69ea.entry.js.map +1 -0
  5. package/dist/cjs/aico-album-content_28.cjs.entry.js +131 -10
  6. package/dist/cjs/aico-album-content_28.cjs.entry.js.map +1 -1
  7. package/dist/cjs/aico-components.cjs.js +1 -1
  8. package/dist/cjs/loader.cjs.js +1 -1
  9. package/dist/collection/components/aico-article-detail/aico-article-detail.js +11 -7
  10. package/dist/collection/components/aico-article-detail/aico-article-detail.js.map +1 -1
  11. package/dist/collection/components/aico-neo-content/aico-neo-content.js +53 -2
  12. package/dist/collection/components/aico-neo-content/aico-neo-content.js.map +1 -1
  13. package/dist/collection/utils/neo/neo-lead-trim.js +106 -0
  14. package/dist/collection/utils/neo/neo-lead-trim.js.map +1 -0
  15. package/dist/components/aico-article-detail2.js +11 -7
  16. package/dist/components/aico-article-detail2.js.map +1 -1
  17. package/dist/components/aico-neo-content2.js +126 -5
  18. package/dist/components/aico-neo-content2.js.map +1 -1
  19. package/dist/esm/aico-album-content_28.entry.js +131 -10
  20. package/dist/esm/aico-album-content_28.entry.js.map +1 -1
  21. package/dist/esm/aico-components.js +1 -1
  22. package/dist/esm/loader.js +1 -1
  23. package/dist/ssr/index.js +134 -11
  24. package/dist/ssr/index.mjs +134 -11
  25. package/dist/types/components/aico-article-detail/aico-article-detail.d.ts +3 -1
  26. package/dist/types/components/aico-neo-content/aico-neo-content.d.ts +10 -0
  27. package/dist/types/components.d.ts +16 -0
  28. package/dist/types/utils/neo/neo-lead-trim.d.ts +33 -0
  29. package/package.json +1 -1
  30. package/dist/aico-components/p-17b7115a.entry.js.map +0 -1
@@ -19,7 +19,7 @@ var patchBrowser = () => {
19
19
 
20
20
  patchBrowser().then(async (options) => {
21
21
  await appGlobals.globalScripts();
22
- return index.bootstrapLazy([["aico-asking-list-content.cjs",[[6,"aico-asking-list-content"]]],["aico-collection-content.cjs",[[6,"aico-collection-content"]]],["aico-album-content_28.cjs",[[2,"aico-fetch-article-detail",{"aicoUrl":[1,"aico-url"],"aicoBearerToken":[1,"aico-bearer-token"],"locale":[1],"hideDateAndAuthor":[4,"hide-date-and-author"],"hideCategoryAndTags":[4,"hide-category-and-tags"],"articleId":[1,"article-id"],"articleUrlHandle":[1,"article-url-handle"],"article":[32]}],[2,"aico-news-list",{"aicoUrl":[1,"aico-url"],"aicoBearerToken":[1,"aico-bearer-token"],"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);
22
+ return index.bootstrapLazy([["aico-asking-list-content.cjs",[[6,"aico-asking-list-content"]]],["aico-collection-content.cjs",[[6,"aico-collection-content"]]],["aico-album-content_28.cjs",[[2,"aico-fetch-article-detail",{"aicoUrl":[1,"aico-url"],"aicoBearerToken":[1,"aico-bearer-token"],"locale":[1],"hideDateAndAuthor":[4,"hide-date-and-author"],"hideCategoryAndTags":[4,"hide-category-and-tags"],"articleId":[1,"article-id"],"articleUrlHandle":[1,"article-url-handle"],"article":[32]}],[2,"aico-news-list",{"aicoUrl":[1,"aico-url"],"aicoBearerToken":[1,"aico-bearer-token"],"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);
23
23
  });
24
24
 
25
25
  exports.setNonce = index.setNonce;
@@ -8,7 +8,7 @@ const appGlobals = require('./app-globals-3a1e7e63.js');
8
8
  const defineCustomElements = async (win, options) => {
9
9
  if (typeof window === 'undefined') return undefined;
10
10
  await appGlobals.globalScripts();
11
- return index.bootstrapLazy([["aico-asking-list-content.cjs",[[6,"aico-asking-list-content"]]],["aico-collection-content.cjs",[[6,"aico-collection-content"]]],["aico-album-content_28.cjs",[[2,"aico-fetch-article-detail",{"aicoUrl":[1,"aico-url"],"aicoBearerToken":[1,"aico-bearer-token"],"locale":[1],"hideDateAndAuthor":[4,"hide-date-and-author"],"hideCategoryAndTags":[4,"hide-category-and-tags"],"articleId":[1,"article-id"],"articleUrlHandle":[1,"article-url-handle"],"article":[32]}],[2,"aico-news-list",{"aicoUrl":[1,"aico-url"],"aicoBearerToken":[1,"aico-bearer-token"],"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);
11
+ return index.bootstrapLazy([["aico-asking-list-content.cjs",[[6,"aico-asking-list-content"]]],["aico-collection-content.cjs",[[6,"aico-collection-content"]]],["aico-album-content_28.cjs",[[2,"aico-fetch-article-detail",{"aicoUrl":[1,"aico-url"],"aicoBearerToken":[1,"aico-bearer-token"],"locale":[1],"hideDateAndAuthor":[4,"hide-date-and-author"],"hideCategoryAndTags":[4,"hide-category-and-tags"],"articleId":[1,"article-id"],"articleUrlHandle":[1,"article-url-handle"],"article":[32]}],[2,"aico-news-list",{"aicoUrl":[1,"aico-url"],"aicoBearerToken":[1,"aico-bearer-token"],"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);
12
12
  };
13
13
 
14
14
  exports.setNonce = index.setNonce;
@@ -16,11 +16,11 @@ export class AicoArticleDetail {
16
16
  const translation = (_a = this.article.attributes.translations.find(translation => translation.locale === this.locale)) !== null && _a !== void 0 ? _a : null;
17
17
  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;
18
18
  const articleDate = new Date(this.article.attributes.publishDate);
19
- const content = this.mapBodyContent();
19
+ const content = this.mapBodyContent(translation);
20
20
  const headlineFocusX = this.article.attributes.headlineImageFocusXPercentage ? `${this.article.attributes.headlineImageFocusXPercentage}%` : 'center';
21
21
  const headlineFocusY = this.article.attributes.headlineImageFocusYPercentage ? `${this.article.attributes.headlineImageFocusYPercentage}%` : 'center';
22
22
  const headlineImage = (_d = translation === null || translation === void 0 ? void 0 : translation.headlineImage) !== null && _d !== void 0 ? _d : this.article.attributes.headlineImage;
23
- return (h(Host, { key: 'f5b0a0d80a16cc93bf0158ce61e41e9d46af0d7d' }, h("figure", { key: '31a5a62a3cef0947b37eddeaad0e235719932888', class: "figure" }, h("blockquote", { key: '7f62b7e19ac4ad766973f91f4bac6dafe7c5eee8', class: "blockquote" }, h("h2", { key: '01bd07a082a7fd5961dfd03503c99d614b460f14', class: "text-uppercase" }, (_e = translation === null || translation === void 0 ? void 0 : translation.name) !== null && _e !== void 0 ? _e : this.article.attributes.name)), headlineImage && h("img", { key: '874ca0c3a11013f9966229af600f0f22ad41a008', class: "figure-img img-fluid rounded object-fit-cover", style: { 'object-position': `${headlineFocusX} ${headlineFocusY}` }, alt: "Headline image", src: headlineImage }), h(ConditionalRender, { key: '24191f3d2f5b41b3bc1477ad2f58d22a421f5dc7', condition: !this.hideDateAndAuthor }, h("figcaption", { key: '54f67a7575a164186924a5af9ec17815ba1fb819', class: "figure-caption mb-1" }, articleDate.toLocaleDateString('en-US', this.dateOptions), " by ", h("cite", { key: '5f58c6810a3ebf87d952bc5215df059bbafa8760', title: "Author" }, this.article.attributes.author))), h(ConditionalRender, { key: '120702974198d12f5948e65ff8f19ebcf1bf3d27', condition: !this.hideCategoryAndTags && !strIsNullOrEmptyOrWhitespace(category === null || category === void 0 ? void 0 : category.webName) }, h("span", { key: '21ef58fd94b6b11142536a7b7401e88013cdd6b5', class: "badge bg-info text-dark" }, category === null || category === void 0 ? void 0 : category.webName))), h("div", { key: '504fc30e0abc5617ea7b12d90770f2013a1a3d4a', class: "content-wrapper" }, content), h(ConditionalRender, { key: '895c5ee4b8e3c22e8264ed98ac9410f74cac0843', condition: !this.hideCategoryAndTags }, this.article.attributes.newsTags.map(tag => {
23
+ return (h(Host, { key: '4973f50c2a561ff5f68ff16b29285dde0ef75f87' }, h("figure", { key: '363fdcf4f12d61022d5153216ad574f590dc3e82', class: "figure" }, h("blockquote", { key: '357d1a947423d3bb99748ebfe65c0ce6f95647cb', class: "blockquote" }, h("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 && h("img", { key: '265565ff90b7b243555fb1c2aa5441e20826b43a', class: "figure-img img-fluid rounded object-fit-cover", style: { 'object-position': `${headlineFocusX} ${headlineFocusY}` }, alt: "Headline image", src: headlineImage }), h(ConditionalRender, { key: '3f94832f01549a5511a4927c53286c114953228d', condition: !this.hideDateAndAuthor }, h("figcaption", { key: '7afe217a895b0f9546a2beda40c9f143acdcc358', class: "figure-caption mb-1" }, articleDate.toLocaleDateString('en-US', this.dateOptions), " by ", h("cite", { key: '7a0c93292b1ed0bc39e8e94f68de9ba18ac99a36', title: "Author" }, this.article.attributes.author))), h(ConditionalRender, { key: 'a89fb90d8e7f6ba6048b43a119d127c7a6c6879b', condition: !this.hideCategoryAndTags && !strIsNullOrEmptyOrWhitespace(category === null || category === void 0 ? void 0 : category.webName) }, h("span", { key: '87aa1fe763f281238ed12d2b1dddbe043f58c8e6', class: "badge bg-info text-dark" }, category === null || category === void 0 ? void 0 : category.webName))), h("div", { key: 'e0bb9d8ebbedc684e4cb848042998874e3c7520b', class: "content-wrapper" }, content), h(ConditionalRender, { key: '81c6c20f4f8274a01ff8b65f1bf2c319e1811998', condition: !this.hideCategoryAndTags }, this.article.attributes.newsTags.map(tag => {
24
24
  var _a;
25
25
  const translation = (_a = tag.translations.find(translation => translation.locale === this.locale)) !== null && _a !== void 0 ? _a : null;
26
26
  return (h(ConditionalRender, { condition: !strIsNullOrEmptyOrWhitespace(translation === null || translation === void 0 ? void 0 : translation.webName) }, h("span", { class: "badge bg-light text-dark" }, translation.webName)));
@@ -32,15 +32,19 @@ export class AicoArticleDetail {
32
32
  * then empty, null, or a stale copy) — when the Neo document has sections it
33
33
  * wins, mirroring the b2b storefront's precedence. Otherwise the legacy
34
34
  * rows render; a null/absent legacy builder renders an empty body instead
35
- * of throwing.
35
+ * of throwing. When this page already shows its own headline image/title
36
+ * above the body, the Neo renderer is asked to trim a duplicate leading
37
+ * hero image/heading from the document (see neo-lead-trim.ts).
36
38
  */
37
- mapBodyContent() {
38
- var _a, _b;
39
+ mapBodyContent(translation) {
40
+ var _a, _b, _c, _d;
39
41
  const neoDocument = this.article.attributes.contentBuilderNeoJson;
40
42
  if (neoDocumentHasContent(neoDocument)) {
41
- return h("aico-neo-content", { neoDocument: neoDocument, locale: this.locale });
43
+ const headlineImage = (_a = translation === null || translation === void 0 ? void 0 : translation.headlineImage) !== null && _a !== void 0 ? _a : this.article.attributes.headlineImage;
44
+ const title = (_b = translation === null || translation === void 0 ? void 0 : translation.name) !== null && _b !== void 0 ? _b : this.article.attributes.name;
45
+ return h("aico-neo-content", { neoDocument: neoDocument, locale: this.locale, trimLeadImage: !!headlineImage, dedupeTitle: title });
42
46
  }
43
- const rows = (_b = (_a = this.article.attributes.contentBuilder) === null || _a === void 0 ? void 0 : _a.rows) !== null && _b !== void 0 ? _b : [];
47
+ const rows = (_d = (_c = this.article.attributes.contentBuilder) === null || _c === void 0 ? void 0 : _c.rows) !== null && _d !== void 0 ? _d : [];
44
48
  return [...rows].sort((a, b) => a.order - b.order).map((row, index) => this.mapRowContent(row, index));
45
49
  }
46
50
  mapRowContent(row, index) {
@@ -1 +1 @@
1
- {"version":3,"file":"aico-article-detail.js","sourceRoot":"","sources":["../../../src/components/aico-article-detail/aico-article-detail.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAsB9D,OAAO,iBAAiB,MAAM,+BAA+B,CAAC;AAC9D,OAAO,EAAE,4BAA4B,EAAE,MAAM,mBAAmB,CAAC;AACjE,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAOxE,MAAM,OAAO,iBAAiB;;QAoBX,gBAAW,GAA+B,EAAE,GAAG,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;;sBAZrF,IAAI;iCAKQ,KAAK;mCAKH,KAAK;;IAI5C,MAAM;;QACJ,MAAM,WAAW,GAAG,MAAA,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,YAAY,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC,WAAW,CAAC,MAAM,KAAK,IAAI,CAAC,MAAM,CAAC,mCAAI,IAAI,CAAC;QACzH,MAAM,QAAQ,GAAG,MAAA,MAAA,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,YAAY,0CAAE,YAAY,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC,WAAW,CAAC,MAAM,KAAK,IAAI,CAAC,MAAM,CAAC,mCAAI,IAAI,CAAC;QACpI,MAAM,WAAW,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;QAClE,MAAM,OAAO,GA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AW,CAAC,WAAW,CAAC;YAC7B,KAAK,WAAW,CAAC,WAAW,CAAC;YAC7B,KAAK,WAAW,CAAC,GAAG,CAAC;YACrB,KAAK,WAAW,CAAC,GAAG,CAAC;YACrB,KAAK,WAAW,CAAC,YAAY,CAAC;YAC9B,KAAK,WAAW,CAAC,MAAM,CAAC;YACxB,KAAK,WAAW,CAAC,UAAU,CAAC;YAC5B;gBACE,OAAO,WAAK,KAAK,EAAC,uCAAuC,gCAAgC,CAAC;QAC9F,CAAC;IACH,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Host, Prop, h } from '@stencil/core';\nimport { ContentType } from '../../model/article/ContentType';\nimport type { Article, ArticleContent, ArticleContentBuilderColumn, ArticleContentBuilderRow } from '../../model/Article';\nimport type { HtmlContent } from '../../model/article/content/HtmlContent';\nimport type { AlbumContent } from '../../model/article/content/AlbumContent';\nimport type { TitleContent } from '../../model/article/content/TitleContent';\nimport type { BlockQuoteContent } from '../../model/article/content/BlockQuoteContent';\nimport type { BulletContent } from '../../model/article/content/BulletContent';\nimport type { CardContent } from '../../model/article/content/CardContent';\nimport type { CarouselContent } from '../../model/article/content/CarouselContent';\nimport type { DividerContent } from '../../model/article/content/DividerContent';\nimport type { DocumentContent } from '../../model/article/content/DocumentContent';\nimport type { HeadingContent } from '../../model/article/content/HeadingContent';\nimport type { LinkContent } from '../../model/article/content/LinkContent';\nimport type { TableContent } from '../../model/article/content/TableContet';\nimport type { TestimonialContent } from '../../model/article/content/TestimonialContent';\nimport type { TextContent } from '../../model/article/content/TextContent';\nimport type { VideoContent } from '../../model/article/content/VideoContent';\nimport type { AskingContent } from '../../model/article/content/AskingContent';\nimport type { FaqContent } from '../../model/article/content/FaqContent';\nimport type { NewsContent } from '../../model/article/content/NewsContent';\nimport type { PageContent } from '../../model/article/content/PageContent';\nimport type { UploadContent } from '../../model/article/content/UploadContent';\nimport ConditionalRender from '../../utils/ConditionalRender';\nimport { strIsNullOrEmptyOrWhitespace } from '../../utils/utils';\nimport { neoDocumentHasContent } from '../../model/article/NeoDocument';\n\n@Component({\n tag: 'aico-article-detail',\n styleUrl: 'aico-article-detail.css',\n scoped: true,\n})\nexport class AicoArticleDetail {\n @Prop() article!: Article;\n\n /**\n * The article translation that will be used to render the content.\n *\n * If the locale specified is not present in the article's translations, most content will not be shown.\n */\n @Prop() locale: string = 'de';\n\n /**\n * Determines if the article date and author are shown or not.\n */\n @Prop() hideDateAndAuthor: boolean = false;\n\n /**\n * Determines if the article category and tags are shown or not.\n */\n @Prop() hideCategoryAndTags: boolean = false;\n\n private readonly dateOptions: Intl.DateTimeFormatOptions = { day: 'numeric', month: 'long', year: 'numeric' };\n\n render() {\n const translation = this.article.attributes.translations.find(translation => translation.locale === this.locale) ?? null;\n const category = this.article.attributes.newsCategory?.translations.find(translation => translation.locale === this.locale) ?? null;\n const articleDate = new Date(this.article.attributes.publishDate);\n const content = this.mapBodyContent();\n\n const headlineFocusX = this.article.attributes.headlineImageFocusXPercentage ? `${this.article.attributes.headlineImageFocusXPercentage}%` : 'center';\n const headlineFocusY = this.article.attributes.headlineImageFocusYPercentage ? `${this.article.attributes.headlineImageFocusYPercentage}%` : 'center';\n const headlineImage = translation?.headlineImage ?? this.article.attributes.headlineImage;\n\n return (\n <Host>\n <figure class=\"figure\">\n <blockquote class=\"blockquote\">\n <h2 class=\"text-uppercase\">{translation?.name ?? this.article.attributes.name}</h2>\n </blockquote>\n {headlineImage && <img class=\"figure-img img-fluid rounded object-fit-cover\" style={{ 'object-position': `${headlineFocusX} ${headlineFocusY}` }} alt=\"Headline image\" src={headlineImage} />}\n <ConditionalRender condition={!this.hideDateAndAuthor}>\n <figcaption class=\"figure-caption mb-1\">\n {articleDate.toLocaleDateString('en-US', this.dateOptions)} by <cite title=\"Author\">{this.article.attributes.author}</cite>\n </figcaption>\n </ConditionalRender>\n <ConditionalRender condition={!this.hideCategoryAndTags && !strIsNullOrEmptyOrWhitespace(category?.webName)}>\n <span class=\"badge bg-info text-dark\">{category?.webName}</span>\n </ConditionalRender>\n </figure>\n <div class=\"content-wrapper\">{content}</div>\n <ConditionalRender condition={!this.hideCategoryAndTags}>\n {this.article.attributes.newsTags.map(tag => {\n const translation = tag.translations.find(translation => translation.locale === this.locale) ?? null;\n return (\n <ConditionalRender condition={!strIsNullOrEmptyOrWhitespace(translation?.webName)}>\n <span class=\"badge bg-light text-dark\">{translation!.webName}</span>\n </ConditionalRender>\n );\n })}\n </ConditionalRender>\n </Host>\n );\n }\n\n /**\n * The article body. Articles authored in the AICO Neo content builder carry\n * their content in `contentBuilderNeoJson` (the legacy `contentBuilder` is\n * then empty, null, or a stale copy) — when the Neo document has sections it\n * wins, mirroring the b2b storefront's precedence. Otherwise the legacy\n * rows render; a null/absent legacy builder renders an empty body instead\n * of throwing.\n */\n private mapBodyContent() {\n const neoDocument = this.article.attributes.contentBuilderNeoJson;\n if (neoDocumentHasContent(neoDocument)) {\n return <aico-neo-content neoDocument={neoDocument!} locale={this.locale} />;\n }\n\n const rows = this.article.attributes.contentBuilder?.rows ?? [];\n return [...rows].sort((a, b) => a.order - b.order).map((row, index) => this.mapRowContent(row, index));\n }\n\n private mapRowContent(row: ArticleContentBuilderRow, index: number) {\n const rowContent = row.columns.map((column, columnIndex) => this.mapColumnContent(column, columnIndex));\n return <div class={`content-row content-row-index-${index}`}>{rowContent}</div>;\n }\n\n private mapColumnContent(column: ArticleContentBuilderColumn, index: number) {\n const columnContent = column.contentContainer.contents.sort((a, b) => (a.sort ?? 0) - (b.sort ?? 0)).map((content, contentIndex) => this.mapContent(content, contentIndex));\n return <div class={`content-column content-column-index-${index}`}>{columnContent}</div>;\n }\n\n private mapContent(content: ArticleContent, index: number) {\n return <div class={`content-data-wrapper content-data-wrapper-index-${index}`}>{this.mapContentData(content.type, content.contentData)}</div>;\n }\n\n private mapContentData(contentType: ContentType | undefined, content: object) {\n switch (contentType) {\n case ContentType.ALBUM:\n return <aico-album-content content={content as AlbumContent} />;\n\n case ContentType.ASKING:\n return <aico-asking-content content={content as AskingContent} locale={this.locale} />;\n\n case ContentType.BLOCK_QUOTE:\n return <aico-block-quote-content content={content as BlockQuoteContent} locale={this.locale} />;\n\n case ContentType.BULLET:\n return <aico-bullet-content content={content as BulletContent} locale={this.locale} />;\n\n case ContentType.CAROUSEL:\n return <aico-carousel-content content={content as CarouselContent} locale={this.locale} />;\n\n case ContentType.CONTENT_CARD:\n return <aico-content-card-content content={content as CardContent} locale={this.locale} />;\n\n case ContentType.DIVIDER:\n return <aico-divider-content content={content as DividerContent} locale={this.locale} />;\n\n case ContentType.DOCUMENT:\n return <aico-document-content content={content as DocumentContent} locale={this.locale} />;\n\n case ContentType.FAQ:\n return <aico-faq-content content={content as FaqContent} locale={this.locale} />;\n\n case ContentType.HEADING:\n return <aico-heading-content content={content as HeadingContent} locale={this.locale} />;\n\n case ContentType.HTML:\n return <aico-html-content content={content as HtmlContent} locale={this.locale} />;\n\n case ContentType.LINK:\n return <aico-link-content content={content as LinkContent} locale={this.locale} />;\n\n case ContentType.NEWS:\n return <aico-news-content content={content as NewsContent} />;\n\n case ContentType.PAGE:\n return <aico-page-content content={content as PageContent} locale={this.locale} />;\n\n case ContentType.TABLE:\n return <aico-table-content content={content as TableContent} locale={this.locale} />;\n\n case ContentType.TESTIMONIAL:\n return <aico-testimonial-content content={content as TestimonialContent} />;\n\n case ContentType.TEXT:\n return <aico-text-content content={content as TextContent} locale={this.locale} />;\n\n case ContentType.TITLE:\n return <aico-title-content content={content as TitleContent} locale={this.locale} />;\n\n case ContentType.UPLOAD:\n return <aico-upload-content content={content as UploadContent} locale={this.locale} />;\n\n case ContentType.VIDEO:\n return <aico-video-content content={content as VideoContent} locale={this.locale} />;\n\n case ContentType.PRODUCT:\n case ContentType.AGENDA:\n case ContentType.LIST_ASKING:\n case ContentType.LIST_AGENDA:\n case ContentType.CRM:\n case ContentType.B2B:\n case ContentType.FORM_BUILDER:\n case ContentType.COURSE:\n case ContentType.COLLECTION:\n default:\n return <div class=\"content-data content-data-not-handled\">Content type not handled.</div>;\n }\n }\n}\n"]}
1
+ {"version":3,"file":"aico-article-detail.js","sourceRoot":"","sources":["../../../src/components/aico-article-detail/aico-article-detail.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAsB9D,OAAO,iBAAiB,MAAM,+BAA+B,CAAC;AAC9D,OAAO,EAAE,4BAA4B,EAAE,MAAM,mBAAmB,CAAC;AACjE,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAOxE,MAAM,OAAO,iBAAiB;;QAoBX,gBAAW,GAA+B,EAAE,GAAG,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;;sBAZrF,IAAI;iCAKQ,KAAK;mCAKH,KAAK;;IAI5C,MAAM;;QACJ,MAAM,WAAW,GAAG,MAAA,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,YAAY,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC,WAAW,CAAC,MAAM,KAAK,IAAI,CAAC,MAAM,CAAC,mCAAI,IAAI,CAAC;QACzH,MAAM,QAAQ,GAAG,MAAA,MAAA,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,YAAY,0CAAE,YAAY,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC,WAAW,CAAC,MAAM,KAAK,IAAI,CAAC,MAAM,CAAC,mCAAI,IAAI,CAAC;QACpI,MAAM,WAAW,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;QAClE,MAAM,OAAO,GAAG,IAAI,CAAC,cAAc,CAAC,WAAW,CAA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AAC,MAAM;gBACrB,OAAO,2BAAqB,OAAO,EAAE,OAAwB,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,GAAI,CAAC;YAEzF,KAAK,WAAW,CAAC,KAAK;gBACpB,OAAO,0BAAoB,OAAO,EAAE,OAAuB,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,GAAI,CAAC;YAEvF,KAAK,WAAW,CAAC,OAAO,CAAC;YACzB,KAAK,WAAW,CAAC,MAAM,CAAC;YACxB,KAAK,WAAW,CAAC,WAAW,CAAC;YAC7B,KAAK,WAAW,CAAC,WAAW,CAAC;YAC7B,KAAK,WAAW,CAAC,GAAG,CAAC;YACrB,KAAK,WAAW,CAAC,GAAG,CAAC;YACrB,KAAK,WAAW,CAAC,YAAY,CAAC;YAC9B,KAAK,WAAW,CAAC,MAAM,CAAC;YACxB,KAAK,WAAW,CAAC,UAAU,CAAC;YAC5B;gBACE,OAAO,WAAK,KAAK,EAAC,uCAAuC,gCAAgC,CAAC;QAC9F,CAAC;IACH,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Host, Prop, h } from '@stencil/core';\nimport { ContentType } from '../../model/article/ContentType';\nimport type { Article, ArticleContent, ArticleContentBuilderColumn, ArticleContentBuilderRow, ArticleTranslation } from '../../model/Article';\nimport type { HtmlContent } from '../../model/article/content/HtmlContent';\nimport type { AlbumContent } from '../../model/article/content/AlbumContent';\nimport type { TitleContent } from '../../model/article/content/TitleContent';\nimport type { BlockQuoteContent } from '../../model/article/content/BlockQuoteContent';\nimport type { BulletContent } from '../../model/article/content/BulletContent';\nimport type { CardContent } from '../../model/article/content/CardContent';\nimport type { CarouselContent } from '../../model/article/content/CarouselContent';\nimport type { DividerContent } from '../../model/article/content/DividerContent';\nimport type { DocumentContent } from '../../model/article/content/DocumentContent';\nimport type { HeadingContent } from '../../model/article/content/HeadingContent';\nimport type { LinkContent } from '../../model/article/content/LinkContent';\nimport type { TableContent } from '../../model/article/content/TableContet';\nimport type { TestimonialContent } from '../../model/article/content/TestimonialContent';\nimport type { TextContent } from '../../model/article/content/TextContent';\nimport type { VideoContent } from '../../model/article/content/VideoContent';\nimport type { AskingContent } from '../../model/article/content/AskingContent';\nimport type { FaqContent } from '../../model/article/content/FaqContent';\nimport type { NewsContent } from '../../model/article/content/NewsContent';\nimport type { PageContent } from '../../model/article/content/PageContent';\nimport type { UploadContent } from '../../model/article/content/UploadContent';\nimport ConditionalRender from '../../utils/ConditionalRender';\nimport { strIsNullOrEmptyOrWhitespace } from '../../utils/utils';\nimport { neoDocumentHasContent } from '../../model/article/NeoDocument';\n\n@Component({\n tag: 'aico-article-detail',\n styleUrl: 'aico-article-detail.css',\n scoped: true,\n})\nexport class AicoArticleDetail {\n @Prop() article!: Article;\n\n /**\n * The article translation that will be used to render the content.\n *\n * If the locale specified is not present in the article's translations, most content will not be shown.\n */\n @Prop() locale: string = 'de';\n\n /**\n * Determines if the article date and author are shown or not.\n */\n @Prop() hideDateAndAuthor: boolean = false;\n\n /**\n * Determines if the article category and tags are shown or not.\n */\n @Prop() hideCategoryAndTags: boolean = false;\n\n private readonly dateOptions: Intl.DateTimeFormatOptions = { day: 'numeric', month: 'long', year: 'numeric' };\n\n render() {\n const translation = this.article.attributes.translations.find(translation => translation.locale === this.locale) ?? null;\n const category = this.article.attributes.newsCategory?.translations.find(translation => translation.locale === this.locale) ?? null;\n const articleDate = new Date(this.article.attributes.publishDate);\n const content = this.mapBodyContent(translation);\n\n const headlineFocusX = this.article.attributes.headlineImageFocusXPercentage ? `${this.article.attributes.headlineImageFocusXPercentage}%` : 'center';\n const headlineFocusY = this.article.attributes.headlineImageFocusYPercentage ? `${this.article.attributes.headlineImageFocusYPercentage}%` : 'center';\n const headlineImage = translation?.headlineImage ?? this.article.attributes.headlineImage;\n\n return (\n <Host>\n <figure class=\"figure\">\n <blockquote class=\"blockquote\">\n <h2 class=\"text-uppercase\">{translation?.name ?? this.article.attributes.name}</h2>\n </blockquote>\n {headlineImage && <img class=\"figure-img img-fluid rounded object-fit-cover\" style={{ 'object-position': `${headlineFocusX} ${headlineFocusY}` }} alt=\"Headline image\" src={headlineImage} />}\n <ConditionalRender condition={!this.hideDateAndAuthor}>\n <figcaption class=\"figure-caption mb-1\">\n {articleDate.toLocaleDateString('en-US', this.dateOptions)} by <cite title=\"Author\">{this.article.attributes.author}</cite>\n </figcaption>\n </ConditionalRender>\n <ConditionalRender condition={!this.hideCategoryAndTags && !strIsNullOrEmptyOrWhitespace(category?.webName)}>\n <span class=\"badge bg-info text-dark\">{category?.webName}</span>\n </ConditionalRender>\n </figure>\n <div class=\"content-wrapper\">{content}</div>\n <ConditionalRender condition={!this.hideCategoryAndTags}>\n {this.article.attributes.newsTags.map(tag => {\n const translation = tag.translations.find(translation => translation.locale === this.locale) ?? null;\n return (\n <ConditionalRender condition={!strIsNullOrEmptyOrWhitespace(translation?.webName)}>\n <span class=\"badge bg-light text-dark\">{translation!.webName}</span>\n </ConditionalRender>\n );\n })}\n </ConditionalRender>\n </Host>\n );\n }\n\n /**\n * The article body. Articles authored in the AICO Neo content builder carry\n * their content in `contentBuilderNeoJson` (the legacy `contentBuilder` is\n * then empty, null, or a stale copy) — when the Neo document has sections it\n * wins, mirroring the b2b storefront's precedence. Otherwise the legacy\n * rows render; a null/absent legacy builder renders an empty body instead\n * of throwing. When this page already shows its own headline image/title\n * above the body, the Neo renderer is asked to trim a duplicate leading\n * hero image/heading from the document (see neo-lead-trim.ts).\n */\n private mapBodyContent(translation: ArticleTranslation | null) {\n const neoDocument = this.article.attributes.contentBuilderNeoJson;\n if (neoDocumentHasContent(neoDocument)) {\n const headlineImage = translation?.headlineImage ?? this.article.attributes.headlineImage;\n const title = translation?.name ?? this.article.attributes.name;\n return <aico-neo-content neoDocument={neoDocument!} locale={this.locale} trimLeadImage={!!headlineImage} dedupeTitle={title} />;\n }\n\n const rows = this.article.attributes.contentBuilder?.rows ?? [];\n return [...rows].sort((a, b) => a.order - b.order).map((row, index) => this.mapRowContent(row, index));\n }\n\n private mapRowContent(row: ArticleContentBuilderRow, index: number) {\n const rowContent = row.columns.map((column, columnIndex) => this.mapColumnContent(column, columnIndex));\n return <div class={`content-row content-row-index-${index}`}>{rowContent}</div>;\n }\n\n private mapColumnContent(column: ArticleContentBuilderColumn, index: number) {\n const columnContent = column.contentContainer.contents.sort((a, b) => (a.sort ?? 0) - (b.sort ?? 0)).map((content, contentIndex) => this.mapContent(content, contentIndex));\n return <div class={`content-column content-column-index-${index}`}>{columnContent}</div>;\n }\n\n private mapContent(content: ArticleContent, index: number) {\n return <div class={`content-data-wrapper content-data-wrapper-index-${index}`}>{this.mapContentData(content.type, content.contentData)}</div>;\n }\n\n private mapContentData(contentType: ContentType | undefined, content: object) {\n switch (contentType) {\n case ContentType.ALBUM:\n return <aico-album-content content={content as AlbumContent} />;\n\n case ContentType.ASKING:\n return <aico-asking-content content={content as AskingContent} locale={this.locale} />;\n\n case ContentType.BLOCK_QUOTE:\n return <aico-block-quote-content content={content as BlockQuoteContent} locale={this.locale} />;\n\n case ContentType.BULLET:\n return <aico-bullet-content content={content as BulletContent} locale={this.locale} />;\n\n case ContentType.CAROUSEL:\n return <aico-carousel-content content={content as CarouselContent} locale={this.locale} />;\n\n case ContentType.CONTENT_CARD:\n return <aico-content-card-content content={content as CardContent} locale={this.locale} />;\n\n case ContentType.DIVIDER:\n return <aico-divider-content content={content as DividerContent} locale={this.locale} />;\n\n case ContentType.DOCUMENT:\n return <aico-document-content content={content as DocumentContent} locale={this.locale} />;\n\n case ContentType.FAQ:\n return <aico-faq-content content={content as FaqContent} locale={this.locale} />;\n\n case ContentType.HEADING:\n return <aico-heading-content content={content as HeadingContent} locale={this.locale} />;\n\n case ContentType.HTML:\n return <aico-html-content content={content as HtmlContent} locale={this.locale} />;\n\n case ContentType.LINK:\n return <aico-link-content content={content as LinkContent} locale={this.locale} />;\n\n case ContentType.NEWS:\n return <aico-news-content content={content as NewsContent} />;\n\n case ContentType.PAGE:\n return <aico-page-content content={content as PageContent} locale={this.locale} />;\n\n case ContentType.TABLE:\n return <aico-table-content content={content as TableContent} locale={this.locale} />;\n\n case ContentType.TESTIMONIAL:\n return <aico-testimonial-content content={content as TestimonialContent} />;\n\n case ContentType.TEXT:\n return <aico-text-content content={content as TextContent} locale={this.locale} />;\n\n case ContentType.TITLE:\n return <aico-title-content content={content as TitleContent} locale={this.locale} />;\n\n case ContentType.UPLOAD:\n return <aico-upload-content content={content as UploadContent} locale={this.locale} />;\n\n case ContentType.VIDEO:\n return <aico-video-content content={content as VideoContent} locale={this.locale} />;\n\n case ContentType.PRODUCT:\n case ContentType.AGENDA:\n case ContentType.LIST_ASKING:\n case ContentType.LIST_AGENDA:\n case ContentType.CRM:\n case ContentType.B2B:\n case ContentType.FORM_BUILDER:\n case ContentType.COURSE:\n case ContentType.COLLECTION:\n default:\n return <div class=\"content-data content-data-not-handled\">Content type not handled.</div>;\n }\n }\n}\n"]}
@@ -1,6 +1,7 @@
1
1
  import { Host, h } from "@stencil/core";
2
2
  import { neoDocumentHasContent } from "../../model/article/NeoDocument";
3
3
  import { hasLocaleStructure, resolveLocale } from "../../utils/neo/neo-locale-resolver";
4
+ import { trimNeoLead } from "../../utils/neo/neo-lead-trim";
4
5
  import { NewsNeo, setActiveLocale } from "../../utils/neo/news-neo-renderer";
5
6
  /**
6
7
  * Renders an AICO Neo content-builder document (`contentBuilderNeoJson`) —
@@ -19,12 +20,14 @@ export class AicoNeoContent {
19
20
  this.neoDocument = undefined;
20
21
  this.locale = 'de';
21
22
  this.defaultLocale = undefined;
23
+ this.trimLeadImage = false;
24
+ this.dedupeTitle = undefined;
22
25
  }
23
26
  componentWillLoad() {
24
27
  this.prepareHtml();
25
28
  }
26
29
  prepareHtml() {
27
- var _a;
30
+ var _a, _b;
28
31
  if (!neoDocumentHasContent(this.neoDocument)) {
29
32
  this.renderedHtml = '';
30
33
  return;
@@ -33,6 +36,13 @@ export class AicoNeoContent {
33
36
  if (hasLocaleStructure(resolvedDocument)) {
34
37
  resolvedDocument = resolveLocale(resolvedDocument, this.locale, (_a = this.defaultLocale) !== null && _a !== void 0 ? _a : null);
35
38
  }
39
+ if (this.trimLeadImage || this.dedupeTitle) {
40
+ resolvedDocument = trimNeoLead(resolvedDocument, { trimLeadImage: this.trimLeadImage, dedupeTitle: (_b = this.dedupeTitle) !== null && _b !== void 0 ? _b : null });
41
+ if (resolvedDocument.sections.length === 0) {
42
+ this.renderedHtml = '';
43
+ return;
44
+ }
45
+ }
36
46
  setActiveLocale(this.locale);
37
47
  this.renderedHtml = NewsNeo.render({ contentBuilderNeoJson: resolvedDocument });
38
48
  }
@@ -44,7 +54,7 @@ export class AicoNeoContent {
44
54
  }
45
55
  }
46
56
  render() {
47
- return (h(Host, { key: '82b5bdbc016d175f57ff0c2d9569da68728c304d' }, h("div", { key: '8a46741a6ce19c9e374928d6a4a0e4d76699f173', class: "aico-neo-content-mount", innerHTML: this.renderedHtml })));
57
+ return (h(Host, { key: '663be625008bd9444656dfedd24cfe9fa97e7d43' }, h("div", { key: 'f0827191bf2ccc6d8cb35644103aa558d338382f', class: "aico-neo-content-mount", innerHTML: this.renderedHtml })));
48
58
  }
49
59
  static get is() { return "aico-neo-content"; }
50
60
  static get originalStyleUrls() {
@@ -114,6 +124,41 @@ export class AicoNeoContent {
114
124
  },
115
125
  "attribute": "default-locale",
116
126
  "reflect": false
127
+ },
128
+ "trimLeadImage": {
129
+ "type": "boolean",
130
+ "mutable": false,
131
+ "complexType": {
132
+ "original": "boolean",
133
+ "resolved": "boolean",
134
+ "references": {}
135
+ },
136
+ "required": false,
137
+ "optional": false,
138
+ "docs": {
139
+ "tags": [],
140
+ "text": "Drop lead body images \u2014 the host page already shows its own hero image\nabove this content (see aico-article-detail)."
141
+ },
142
+ "attribute": "trim-lead-image",
143
+ "reflect": false,
144
+ "defaultValue": "false"
145
+ },
146
+ "dedupeTitle": {
147
+ "type": "string",
148
+ "mutable": false,
149
+ "complexType": {
150
+ "original": "string",
151
+ "resolved": "string | undefined",
152
+ "references": {}
153
+ },
154
+ "required": false,
155
+ "optional": true,
156
+ "docs": {
157
+ "tags": [],
158
+ "text": "Drop a leading heading whose text equals this \u2014 the host page's own\ntitle, restated as the article's first heading."
159
+ },
160
+ "attribute": "dedupe-title",
161
+ "reflect": false
117
162
  }
118
163
  };
119
164
  }
@@ -128,6 +173,12 @@ export class AicoNeoContent {
128
173
  }, {
129
174
  "propName": "defaultLocale",
130
175
  "methodName": "prepareHtml"
176
+ }, {
177
+ "propName": "trimLeadImage",
178
+ "methodName": "prepareHtml"
179
+ }, {
180
+ "propName": "dedupeTitle",
181
+ "methodName": "prepareHtml"
131
182
  }];
132
183
  }
133
184
  }
@@ -1 +1 @@
1
- {"version":3,"file":"aico-neo-content.js","sourceRoot":"","sources":["../../../src/components/aico-neo-content/aico-neo-content.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAEzE,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AACxF,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AAE7E;;;;;;;;;;GAUG;AAKH,MAAM,OAAO,cAAc;;QAmBjB,iBAAY,GAAW,EAAE,CAAC;;sBART,IAAI;;;IAU7B,iBAAiB;QACf,IAAI,CAAC,WAAW,EAAE,CAAC;IACrB,CAAC;IAKD,WAAW;;QACT,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC;YAC7C,IAAI,CAAC,YAAY,GAAG,EAAE,CAAC;YACvB,OAAO;QACT,CAAC;QAED,IAAI,gBAAgB,GAAG,IAAI,CAAC,WAAW,CAAC;QACxC,IAAI,kBAAkB,CAAC,gBAAgB,CAAC,EAAE,CAAC;YACzC,gBAAgB,GAAG,aAAa,CAAC,gBAAgB,EAAE,IAAI,CAAC,MAAM,EAAE,MAAA,IAAI,CAAC,aAAa,mCAAI,IAAI,CAAC,CAAC;QAC9F,CAAC;QAED,eAAe,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAC7B,IAAI,CAAC,YAAY,GAAG,OAAO,CAAC,MAAM,CAAC,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,CAAC,CAAC;IAClF,CAAC;IAED,kBAAkB;QAChB,+DAA+D;QAC/D,MAAM,KAAK,GAAG,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC,CAAC;QACjE,IAAI,KAAK,IAAI,IAAI,CAAC,YAAY,KAAK,EAAE,EAAE,CAAC;YACtC,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QACzB,CAAC;IACH,CAAC;IAED,MAAM;QACJ,OAAO,CACL,EAAC,IAAI;YACH,4DAAK,KAAK,EAAC,wBAAwB,EAAC,SAAS,EAAE,IAAI,CAAC,YAAY,GAAQ,CACnE,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, Host, Prop, Watch, h } from '@stencil/core';\nimport type { NeoDocument } from '../../model/article/NeoDocument';\nimport { neoDocumentHasContent } from '../../model/article/NeoDocument';\nimport { hasLocaleStructure, resolveLocale } from '../../utils/neo/neo-locale-resolver';\nimport { NewsNeo, setActiveLocale } from '../../utils/neo/news-neo-renderer';\n\n/**\n * Renders an AICO Neo content-builder document (`contentBuilderNeoJson`) —\n * the same renderer the kj b2b storefront uses for Neo news articles.\n *\n * Locale overrides carried by the document are resolved client-side before\n * rendering (the aico v1 API ships them unresolved).\n *\n * NOT scoped/shadow on purpose: the renderer emits plain HTML via innerHTML\n * and injects its own component CSS into the document head; style scoping\n * would never reach that markup.\n */\n@Component({\n tag: 'aico-neo-content',\n styleUrl: 'aico-neo-content.css',\n})\nexport class AicoNeoContent {\n @Element() host!: HTMLElement;\n\n /**\n * The Neo content-builder document (`attributes.contentBuilderNeoJson`).\n */\n @Prop() neoDocument!: NeoDocument;\n\n /**\n * The locale to resolve the document's content for, e.g. `de_CH`.\n */\n @Prop() locale: string = 'de';\n\n /**\n * The shop's default locale — the override fallback when the requested\n * language has no entries (mirrors the storefront's fallback rule).\n */\n @Prop() defaultLocale?: string;\n\n private renderedHtml: string = '';\n\n componentWillLoad() {\n this.prepareHtml();\n }\n\n @Watch('neoDocument')\n @Watch('locale')\n @Watch('defaultLocale')\n prepareHtml() {\n if (!neoDocumentHasContent(this.neoDocument)) {\n this.renderedHtml = '';\n return;\n }\n\n let resolvedDocument = this.neoDocument;\n if (hasLocaleStructure(resolvedDocument)) {\n resolvedDocument = resolveLocale(resolvedDocument, this.locale, this.defaultLocale ?? null);\n }\n\n setActiveLocale(this.locale);\n this.renderedHtml = NewsNeo.render({ contentBuilderNeoJson: resolvedDocument });\n }\n\n componentDidRender() {\n // Wire sliders / lightboxes inside the freshly painted markup.\n const mount = this.host.querySelector('.aico-neo-content-mount');\n if (mount && this.renderedHtml !== '') {\n NewsNeo.hydrate(mount);\n }\n }\n\n render() {\n return (\n <Host>\n <div class=\"aico-neo-content-mount\" innerHTML={this.renderedHtml}></div>\n </Host>\n );\n }\n}\n"]}
1
+ {"version":3,"file":"aico-neo-content.js","sourceRoot":"","sources":["../../../src/components/aico-neo-content/aico-neo-content.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAEzE,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAA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AAkB;QAChB,+DAA+D;QAC/D,MAAM,KAAK,GAAG,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,yBAAyB,CAAC,CAAC;QACjE,IAAI,KAAK,IAAI,IAAI,CAAC,YAAY,KAAK,EAAE,EAAE,CAAC;YACtC,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QACzB,CAAC;IACH,CAAC;IAED,MAAM;QACJ,OAAO,CACL,EAAC,IAAI;YACH,4DAAK,KAAK,EAAC,wBAAwB,EAAC,SAAS,EAAE,IAAI,CAAC,YAAY,GAAQ,CACnE,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, Host, Prop, Watch, h } from '@stencil/core';\nimport type { NeoDocument } from '../../model/article/NeoDocument';\nimport { neoDocumentHasContent } from '../../model/article/NeoDocument';\nimport { hasLocaleStructure, resolveLocale } from '../../utils/neo/neo-locale-resolver';\nimport { trimNeoLead } from '../../utils/neo/neo-lead-trim';\nimport { NewsNeo, setActiveLocale } from '../../utils/neo/news-neo-renderer';\n\n/**\n * Renders an AICO Neo content-builder document (`contentBuilderNeoJson`) —\n * the same renderer the kj b2b storefront uses for Neo news articles.\n *\n * Locale overrides carried by the document are resolved client-side before\n * rendering (the aico v1 API ships them unresolved).\n *\n * NOT scoped/shadow on purpose: the renderer emits plain HTML via innerHTML\n * and injects its own component CSS into the document head; style scoping\n * would never reach that markup.\n */\n@Component({\n tag: 'aico-neo-content',\n styleUrl: 'aico-neo-content.css',\n})\nexport class AicoNeoContent {\n @Element() host!: HTMLElement;\n\n /**\n * The Neo content-builder document (`attributes.contentBuilderNeoJson`).\n */\n @Prop() neoDocument!: NeoDocument;\n\n /**\n * The locale to resolve the document's content for, e.g. `de_CH`.\n */\n @Prop() locale: string = 'de';\n\n /**\n * The shop's default locale — the override fallback when the requested\n * language has no entries (mirrors the storefront's fallback rule).\n */\n @Prop() defaultLocale?: string;\n\n /**\n * Drop lead body images — the host page already shows its own hero image\n * above this content (see aico-article-detail).\n */\n @Prop() trimLeadImage: boolean = false;\n\n /**\n * Drop a leading heading whose text equals this — the host page's own\n * title, restated as the article's first heading.\n */\n @Prop() dedupeTitle?: string;\n\n private renderedHtml: string = '';\n\n componentWillLoad() {\n this.prepareHtml();\n }\n\n @Watch('neoDocument')\n @Watch('locale')\n @Watch('defaultLocale')\n @Watch('trimLeadImage')\n @Watch('dedupeTitle')\n prepareHtml() {\n if (!neoDocumentHasContent(this.neoDocument)) {\n this.renderedHtml = '';\n return;\n }\n\n let resolvedDocument = this.neoDocument;\n if (hasLocaleStructure(resolvedDocument)) {\n resolvedDocument = resolveLocale(resolvedDocument, this.locale, this.defaultLocale ?? null);\n }\n\n if (this.trimLeadImage || this.dedupeTitle) {\n resolvedDocument = trimNeoLead(resolvedDocument, { trimLeadImage: this.trimLeadImage, dedupeTitle: this.dedupeTitle ?? null });\n if (resolvedDocument.sections.length === 0) {\n this.renderedHtml = '';\n return;\n }\n }\n\n setActiveLocale(this.locale);\n this.renderedHtml = NewsNeo.render({ contentBuilderNeoJson: resolvedDocument });\n }\n\n componentDidRender() {\n // Wire sliders / lightboxes inside the freshly painted markup.\n const mount = this.host.querySelector('.aico-neo-content-mount');\n if (mount && this.renderedHtml !== '') {\n NewsNeo.hydrate(mount);\n }\n }\n\n render() {\n return (\n <Host>\n <div class=\"aico-neo-content-mount\" innerHTML={this.renderedHtml}></div>\n </Host>\n );\n }\n}\n"]}
@@ -0,0 +1,106 @@
1
+ const ENTITIES = {
2
+ '&amp;': '&',
3
+ '&lt;': '<',
4
+ '&gt;': '>',
5
+ '&quot;': '"',
6
+ '&#39;': "'",
7
+ '&nbsp;': ' ',
8
+ };
9
+ /** Plain text of an HTML fragment, whitespace-collapsed and lowercased (mirrors NeoNewsContentRenderer::normalizeText). */
10
+ export function normalizeText(html) {
11
+ const stripped = html.replace(/<[^>]*>/g, '');
12
+ const decoded = stripped.replace(/&amp;|&lt;|&gt;|&quot;|&#39;|&nbsp;/g, entity => ENTITIES[entity]);
13
+ return decoded.replace(/\s+/g, ' ').trim().toLowerCase();
14
+ }
15
+ function headingText(element) {
16
+ var _a;
17
+ const text = (_a = element.content) === null || _a === void 0 ? void 0 : _a.text;
18
+ return typeof text === 'string' ? text : '';
19
+ }
20
+ /** Filters one elements array, recursing into `columns` children. Returns the input array by reference when nothing changed. */
21
+ function trimElements(elements, state) {
22
+ const result = [];
23
+ let changed = false;
24
+ for (const element of elements) {
25
+ if (element.type === 'columns') {
26
+ const children = Array.isArray(element.children) ? element.children : [];
27
+ const newChildren = trimElements(children, state);
28
+ if (newChildren.length === 0) {
29
+ changed = true;
30
+ continue;
31
+ }
32
+ if (newChildren !== children) {
33
+ changed = true;
34
+ result.push(Object.assign(Object.assign({}, element), { children: newChildren }));
35
+ }
36
+ else {
37
+ result.push(element);
38
+ }
39
+ continue;
40
+ }
41
+ if (element.type === 'image') {
42
+ // Images never end the lead: kept or dropped, either way the next
43
+ // element is still evaluated as leading.
44
+ if (state.atLeadingEdge && state.dropLeadingImage) {
45
+ changed = true;
46
+ continue;
47
+ }
48
+ result.push(element);
49
+ continue;
50
+ }
51
+ if (element.type === 'divider') {
52
+ // Dividers don't end the lead either.
53
+ result.push(element);
54
+ continue;
55
+ }
56
+ if (element.type === 'heading') {
57
+ if (state.atLeadingEdge && state.normalizedTitle !== null && normalizeText(headingText(element)) === state.normalizedTitle) {
58
+ changed = true;
59
+ continue;
60
+ }
61
+ result.push(element);
62
+ state.atLeadingEdge = false;
63
+ continue;
64
+ }
65
+ // Any other element type (text, html, button, video, gallery, slideshow, …) is kept and ends the lead.
66
+ result.push(element);
67
+ state.atLeadingEdge = false;
68
+ }
69
+ return changed ? result : elements;
70
+ }
71
+ /**
72
+ * Preprocesses a locale-resolved Neo document, dropping lead content that
73
+ * duplicates the host page's own header. Non-mutating: returns the input
74
+ * unchanged (same reference) when there is nothing to do, otherwise a new
75
+ * document with a new `sections` array (untouched sections/elements may be
76
+ * reused by reference).
77
+ */
78
+ export function trimNeoLead(document, options) {
79
+ const sections = Array.isArray(document.sections) ? document.sections : [];
80
+ if (sections.length === 0) {
81
+ return document;
82
+ }
83
+ const dedupeTitle = options.dedupeTitle;
84
+ const hasDedupeTitle = typeof dedupeTitle === 'string' && dedupeTitle.trim() !== '';
85
+ if (!options.trimLeadImage && !hasDedupeTitle) {
86
+ return document;
87
+ }
88
+ const state = {
89
+ atLeadingEdge: true,
90
+ dropLeadingImage: options.trimLeadImage,
91
+ normalizedTitle: hasDedupeTitle ? normalizeText(dedupeTitle) : null,
92
+ };
93
+ const newSections = [];
94
+ for (const section of sections) {
95
+ const elements = Array.isArray(section.elements) ? section.elements : [];
96
+ const newElements = trimElements(elements, state);
97
+ if (newElements.length === 0) {
98
+ // An empty section must not survive — this is what removes a
99
+ // background-only hero section once its sole image is trimmed.
100
+ continue;
101
+ }
102
+ newSections.push(newElements === elements ? section : Object.assign(Object.assign({}, section), { elements: newElements }));
103
+ }
104
+ return Object.assign(Object.assign({}, document), { sections: newSections });
105
+ }
106
+ //# sourceMappingURL=neo-lead-trim.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"neo-lead-trim.js","sourceRoot":"","sources":["../../../src/utils/neo/neo-lead-trim.ts"],"names":[],"mappings":"AAyBA,MAAM,QAAQ,GAAiC;IAC7C,OAAO,EAAE,GAAG;IACZ,MAAM,EAAE,GAAG;IACX,MAAM,EAAE,GAAG;IACX,QAAQ,EAAE,GAAG;IACb,OAAO,EAAE,GAAG;IACZ,QAAQ,EAAE,GAAG;CACd,CAAC;AAEF,2HAA2H;AAC3H,MAAM,UAAU,aAAa,CAAC,IAAY;IACxC,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;IAC9C,MAAM,OAAO,GAAG,QAA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AAK,CAAC,EAAE,CAAC;QAC1B,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,MAAM,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC;IACxC,MAAM,cAAc,GAAG,OAAO,WAAW,KAAK,QAAQ,IAAI,WAAW,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC;IACpF,IAAI,CAAC,OAAO,CAAC,aAAa,IAAI,CAAC,cAAc,EAAE,CAAC;QAC9C,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,MAAM,KAAK,GAAkB;QAC3B,aAAa,EAAE,IAAI;QACnB,gBAAgB,EAAE,OAAO,CAAC,aAAa;QACvC,eAAe,EAAE,cAAc,CAAC,CAAC,CAAC,aAAa,CAAC,WAAqB,CAAC,CAAC,CAAC,CAAC,IAAI;KAC9E,CAAC;IAEF,MAAM,WAAW,GAAiB,EAAE,CAAC;IACrC,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;QAC/B,MAAM,QAAQ,GAAG,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC;QACzE,MAAM,WAAW,GAAG,YAAY,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;QAClD,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC7B,6DAA6D;YAC7D,+DAA+D;YAC/D,SAAS;QACX,CAAC;QACD,WAAW,CAAC,IAAI,CAAC,WAAW,KAAK,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,iCAAM,OAAO,KAAE,QAAQ,EAAE,WAAW,GAAE,CAAC,CAAC;IAC/F,CAAC;IAED,uCAAY,QAAQ,KAAE,QAAQ,EAAE,WAAW,IAAG;AAChD,CAAC","sourcesContent":["/**\n * b2c lead-trimming for AICO Neo content-builder documents.\n *\n * `<aico-article-detail>` already renders its own header (title + headline\n * image, see aico-article-detail.tsx), but Neo articles routinely restate\n * both as their first section/elements (a hero image + a heading). Rendering\n * them again would duplicate the host page's header. The dedup mirrors the\n * b2b backend's `NeoNewsContentRenderer`: it is POSITIONAL — while nothing\n * \"real\" has been emitted yet, drop body images (only when the host shows a\n * hero) and drop a leading heading whose text equals the host's title;\n * images/dividers never end the lead, anything else does.\n *\n * Kept as a SEPARATE preprocessor rather than folded into\n * `news-neo-renderer.ts`, which is vendored verbatim from the kj theme and\n * must stay diffable against it.\n */\nimport type { NeoDocument, NeoElement, NeoSection } from '../../model/article/NeoDocument';\n\nexport interface TrimNeoLeadOptions {\n /** Drop lead body images — the host page already shows a hero image. */\n trimLeadImage: boolean;\n /** Drop a leading heading whose text equals this — the host page's own title. */\n dedupeTitle?: string | null;\n}\n\nconst ENTITIES: { [entity: string]: string } = {\n '&amp;': '&',\n '&lt;': '<',\n '&gt;': '>',\n '&quot;': '\"',\n '&#39;': \"'\",\n '&nbsp;': ' ',\n};\n\n/** Plain text of an HTML fragment, whitespace-collapsed and lowercased (mirrors NeoNewsContentRenderer::normalizeText). */\nexport function normalizeText(html: string): string {\n const stripped = html.replace(/<[^>]*>/g, '');\n const decoded = stripped.replace(/&amp;|&lt;|&gt;|&quot;|&#39;|&nbsp;/g, entity => ENTITIES[entity]);\n return decoded.replace(/\\s+/g, ' ').trim().toLowerCase();\n}\n\n/** Shared, mutable state for a single pass over the document (mirrors the renderer's per-render instance fields). */\ntype LeadTrimState = {\n atLeadingEdge: boolean;\n dropLeadingImage: boolean;\n normalizedTitle: string | null;\n};\n\nfunction headingText(element: NeoElement): string {\n const text = element.content?.text;\n return typeof text === 'string' ? text : '';\n}\n\n/** Filters one elements array, recursing into `columns` children. Returns the input array by reference when nothing changed. */\nfunction trimElements(elements: NeoElement[], state: LeadTrimState): NeoElement[] {\n const result: NeoElement[] = [];\n let changed = false;\n\n for (const element of elements) {\n if (element.type === 'columns') {\n const children = Array.isArray(element.children) ? element.children : [];\n const newChildren = trimElements(children, state);\n if (newChildren.length === 0) {\n changed = true;\n continue;\n }\n if (newChildren !== children) {\n changed = true;\n result.push({ ...element, children: newChildren });\n } else {\n result.push(element);\n }\n continue;\n }\n\n if (element.type === 'image') {\n // Images never end the lead: kept or dropped, either way the next\n // element is still evaluated as leading.\n if (state.atLeadingEdge && state.dropLeadingImage) {\n changed = true;\n continue;\n }\n result.push(element);\n continue;\n }\n\n if (element.type === 'divider') {\n // Dividers don't end the lead either.\n result.push(element);\n continue;\n }\n\n if (element.type === 'heading') {\n if (state.atLeadingEdge && state.normalizedTitle !== null && normalizeText(headingText(element)) === state.normalizedTitle) {\n changed = true;\n continue;\n }\n result.push(element);\n state.atLeadingEdge = false;\n continue;\n }\n\n // Any other element type (text, html, button, video, gallery, slideshow, …) is kept and ends the lead.\n result.push(element);\n state.atLeadingEdge = false;\n }\n\n return changed ? result : elements;\n}\n\n/**\n * Preprocesses a locale-resolved Neo document, dropping lead content that\n * duplicates the host page's own header. Non-mutating: returns the input\n * unchanged (same reference) when there is nothing to do, otherwise a new\n * document with a new `sections` array (untouched sections/elements may be\n * reused by reference).\n */\nexport function trimNeoLead(document: NeoDocument, options: TrimNeoLeadOptions): NeoDocument {\n const sections = Array.isArray(document.sections) ? document.sections : [];\n if (sections.length === 0) {\n return document;\n }\n\n const dedupeTitle = options.dedupeTitle;\n const hasDedupeTitle = typeof dedupeTitle === 'string' && dedupeTitle.trim() !== '';\n if (!options.trimLeadImage && !hasDedupeTitle) {\n return document;\n }\n\n const state: LeadTrimState = {\n atLeadingEdge: true,\n dropLeadingImage: options.trimLeadImage,\n normalizedTitle: hasDedupeTitle ? normalizeText(dedupeTitle as string) : null,\n };\n\n const newSections: NeoSection[] = [];\n for (const section of sections) {\n const elements = Array.isArray(section.elements) ? section.elements : [];\n const newElements = trimElements(elements, state);\n if (newElements.length === 0) {\n // An empty section must not survive — this is what removes a\n // background-only hero section once its sole image is trimmed.\n continue;\n }\n newSections.push(newElements === elements ? section : { ...section, elements: newElements });\n }\n\n return { ...document, sections: newSections };\n}\n"]}
@@ -75,11 +75,11 @@ const AicoArticleDetail = /*@__PURE__*/ proxyCustomElement(class AicoArticleDeta
75
75
  const translation = (_a = this.article.attributes.translations.find(translation => translation.locale === this.locale)) !== null && _a !== void 0 ? _a : null;
76
76
  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;
77
77
  const articleDate = new Date(this.article.attributes.publishDate);
78
- const content = this.mapBodyContent();
78
+ const content = this.mapBodyContent(translation);
79
79
  const headlineFocusX = this.article.attributes.headlineImageFocusXPercentage ? `${this.article.attributes.headlineImageFocusXPercentage}%` : 'center';
80
80
  const headlineFocusY = this.article.attributes.headlineImageFocusYPercentage ? `${this.article.attributes.headlineImageFocusYPercentage}%` : 'center';
81
81
  const headlineImage = (_d = translation === null || translation === void 0 ? void 0 : translation.headlineImage) !== null && _d !== void 0 ? _d : this.article.attributes.headlineImage;
82
- return (h(Host, { key: 'f5b0a0d80a16cc93bf0158ce61e41e9d46af0d7d' }, h("figure", { key: '31a5a62a3cef0947b37eddeaad0e235719932888', class: "figure" }, h("blockquote", { key: '7f62b7e19ac4ad766973f91f4bac6dafe7c5eee8', class: "blockquote" }, h("h2", { key: '01bd07a082a7fd5961dfd03503c99d614b460f14', class: "text-uppercase" }, (_e = translation === null || translation === void 0 ? void 0 : translation.name) !== null && _e !== void 0 ? _e : this.article.attributes.name)), headlineImage && h("img", { key: '874ca0c3a11013f9966229af600f0f22ad41a008', class: "figure-img img-fluid rounded object-fit-cover", style: { 'object-position': `${headlineFocusX} ${headlineFocusY}` }, alt: "Headline image", src: headlineImage }), h(ConditionalRender, { key: '24191f3d2f5b41b3bc1477ad2f58d22a421f5dc7', condition: !this.hideDateAndAuthor }, h("figcaption", { key: '54f67a7575a164186924a5af9ec17815ba1fb819', class: "figure-caption mb-1" }, articleDate.toLocaleDateString('en-US', this.dateOptions), " by ", h("cite", { key: '5f58c6810a3ebf87d952bc5215df059bbafa8760', title: "Author" }, this.article.attributes.author))), h(ConditionalRender, { key: '120702974198d12f5948e65ff8f19ebcf1bf3d27', condition: !this.hideCategoryAndTags && !strIsNullOrEmptyOrWhitespace(category === null || category === void 0 ? void 0 : category.webName) }, h("span", { key: '21ef58fd94b6b11142536a7b7401e88013cdd6b5', class: "badge bg-info text-dark" }, category === null || category === void 0 ? void 0 : category.webName))), h("div", { key: '504fc30e0abc5617ea7b12d90770f2013a1a3d4a', class: "content-wrapper" }, content), h(ConditionalRender, { key: '895c5ee4b8e3c22e8264ed98ac9410f74cac0843', condition: !this.hideCategoryAndTags }, this.article.attributes.newsTags.map(tag => {
82
+ return (h(Host, { key: '4973f50c2a561ff5f68ff16b29285dde0ef75f87' }, h("figure", { key: '363fdcf4f12d61022d5153216ad574f590dc3e82', class: "figure" }, h("blockquote", { key: '357d1a947423d3bb99748ebfe65c0ce6f95647cb', class: "blockquote" }, h("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 && h("img", { key: '265565ff90b7b243555fb1c2aa5441e20826b43a', class: "figure-img img-fluid rounded object-fit-cover", style: { 'object-position': `${headlineFocusX} ${headlineFocusY}` }, alt: "Headline image", src: headlineImage }), h(ConditionalRender, { key: '3f94832f01549a5511a4927c53286c114953228d', condition: !this.hideDateAndAuthor }, h("figcaption", { key: '7afe217a895b0f9546a2beda40c9f143acdcc358', class: "figure-caption mb-1" }, articleDate.toLocaleDateString('en-US', this.dateOptions), " by ", h("cite", { key: '7a0c93292b1ed0bc39e8e94f68de9ba18ac99a36', title: "Author" }, this.article.attributes.author))), h(ConditionalRender, { key: 'a89fb90d8e7f6ba6048b43a119d127c7a6c6879b', condition: !this.hideCategoryAndTags && !strIsNullOrEmptyOrWhitespace(category === null || category === void 0 ? void 0 : category.webName) }, h("span", { key: '87aa1fe763f281238ed12d2b1dddbe043f58c8e6', class: "badge bg-info text-dark" }, category === null || category === void 0 ? void 0 : category.webName))), h("div", { key: 'e0bb9d8ebbedc684e4cb848042998874e3c7520b', class: "content-wrapper" }, content), h(ConditionalRender, { key: '81c6c20f4f8274a01ff8b65f1bf2c319e1811998', condition: !this.hideCategoryAndTags }, this.article.attributes.newsTags.map(tag => {
83
83
  var _a;
84
84
  const translation = (_a = tag.translations.find(translation => translation.locale === this.locale)) !== null && _a !== void 0 ? _a : null;
85
85
  return (h(ConditionalRender, { condition: !strIsNullOrEmptyOrWhitespace(translation === null || translation === void 0 ? void 0 : translation.webName) }, h("span", { class: "badge bg-light text-dark" }, translation.webName)));
@@ -91,15 +91,19 @@ const AicoArticleDetail = /*@__PURE__*/ proxyCustomElement(class AicoArticleDeta
91
91
  * then empty, null, or a stale copy) — when the Neo document has sections it
92
92
  * wins, mirroring the b2b storefront's precedence. Otherwise the legacy
93
93
  * rows render; a null/absent legacy builder renders an empty body instead
94
- * of throwing.
94
+ * of throwing. When this page already shows its own headline image/title
95
+ * above the body, the Neo renderer is asked to trim a duplicate leading
96
+ * hero image/heading from the document (see neo-lead-trim.ts).
95
97
  */
96
- mapBodyContent() {
97
- var _a, _b;
98
+ mapBodyContent(translation) {
99
+ var _a, _b, _c, _d;
98
100
  const neoDocument = this.article.attributes.contentBuilderNeoJson;
99
101
  if (neoDocumentHasContent(neoDocument)) {
100
- return h("aico-neo-content", { neoDocument: neoDocument, locale: this.locale });
102
+ const headlineImage = (_a = translation === null || translation === void 0 ? void 0 : translation.headlineImage) !== null && _a !== void 0 ? _a : this.article.attributes.headlineImage;
103
+ const title = (_b = translation === null || translation === void 0 ? void 0 : translation.name) !== null && _b !== void 0 ? _b : this.article.attributes.name;
104
+ return h("aico-neo-content", { neoDocument: neoDocument, locale: this.locale, trimLeadImage: !!headlineImage, dedupeTitle: title });
101
105
  }
102
- const rows = (_b = (_a = this.article.attributes.contentBuilder) === null || _a === void 0 ? void 0 : _a.rows) !== null && _b !== void 0 ? _b : [];
106
+ const rows = (_d = (_c = this.article.attributes.contentBuilder) === null || _c === void 0 ? void 0 : _c.rows) !== null && _d !== void 0 ? _d : [];
103
107
  return [...rows].sort((a, b) => a.order - b.order).map((row, index) => this.mapRowContent(row, index));
104
108
  }
105
109
  mapRowContent(row, index) {
@@ -1 +1 @@
1
- {"file":"aico-article-detail2.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAY,WA8BX;AA9BD,WAAY,WAAW;IACrB,gCAAiB,CAAA;IACjB,4BAAa,CAAA;IACb,8BAAe,CAAA;IACf,8BAAe,CAAA;IACf,kCAAmB,CAAA;IACnB,8BAAe,CAAA;IACf,4CAA6B,CAAA;IAC7B,0CAA2B,CAAA;IAC3B,kCAAmB,CAAA;IACnB,4BAAa,CAAA;IACb,gCAAiB,CAAA;IACjB,gCAAiB,CAAA;IACjB,0CAA2B,CAAA;IAC3B,0CAA2B,CAAA;IAC3B,0BAAW,CAAA;IACX,0BAAW,CAAA;IACX,4CAA6B,CAAA;IAC7B,0CAA2B,CAAA;IAC3B,0BAAW,CAAA;IACX,gCAAiB,CAAA;IACjB,oCAAqB,CAAA;IACrB,4BAAa,CAAA;IACb,4BAAa,CAAA;IACb,kCAAmB,CAAA;IACnB,wCAAyB,CAAA;IACzB,oCAAqB,CAAA;IACrB,4BAAa,CAAA;IACb,8BAAe,CAAA;IACf,gCAAiB,CAAA;AACnB,CAAC,EA9BW,WAAW,KAAX,WAAW;;ACAvB,MAAM,oBAAoB,GAAG,2ywTAA2ywT,CAAC;AACz0wT,gCAAe,oBAAoB;;MC+BtB,iBAAiB;;;;QAoBX,gBAAW,GAA+B,EAAE,GAAG,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;;sBAZrF,IAAI;iCAKQ,KAAK;mCAKH,KAAK;;IAI5C,MAAM;;QACJ,MAAM,WAAW,GAAG,MAAA,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,Y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,OAAO,EAAE,OAAuB,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,GAAI,CAAC;YAEvF,KAAK,WAAW,CAAC,OAAO,CAAC;YACzB,KAAK,WAAW,CAAC,MAAM,CAAC;YACxB,KAAK,WAAW,CAAC,WAAW,CAAC;YAC7B,KAAK,WAAW,CAAC,WAAW,CAAC;YAC7B,KAAK,WAAW,CAAC,GAAG,CAAC;YACrB,KAAK,WAAW,CAAC,GAAG,CAAC;YACrB,KAAK,WAAW,CAAC,YAAY,CAAC;YAC9B,KAAK,WAAW,CAAC,MAAM,CAAC;YACxB,KAAK,WAAW,CAAC,UAAU,CAAC;YAC5B;gBACE,OAAO,WAAK,KAAK,EAAC,uCAAuC,gCAAgC,CAAC;SAC7F;KACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/model/article/ContentType.ts","src/components/aico-article-detail/aico-article-detail.css?tag=aico-article-detail&encapsulation=scoped","src/components/aico-article-detail/aico-article-detail.tsx"],"sourcesContent":["export enum ContentType {\n BULLET = 'BULLET',\n TEXT = 'TEXT',\n VIDEO = 'VIDEO',\n TABLE = 'TABLE',\n HEADING = 'HEADING',\n TITLE = 'TITLE',\n CONTENT_CARD = 'CONTENT_CARD',\n TESTIMONIAL = 'TESTIMONIAL',\n PRODUCT = 'PRODUCT',\n NEWS = 'NEWS',\n ASKING = 'ASKING',\n AGENDA = 'AGENDA',\n LIST_ASKING = 'LIST_ASKING',\n LIST_AGENDA = 'LIST_AGENDA',\n CRM = 'CRM',\n B2B = 'B2B',\n FORM_BUILDER = 'FORM_BUILDER',\n BLOCK_QUOTE = 'BLOCK_QUOTE',\n FAQ = 'FAQ',\n COURSE = 'COURSE',\n DOCUMENT = 'DOCUMENT',\n LINK = 'LINK',\n HTML = 'HTML',\n DIVIDER = 'DIVIDER',\n COLLECTION = 'COLLECTION',\n CAROUSEL = 'CAROUSEL',\n PAGE = 'PAGE',\n ALBUM = 'ALBUM',\n UPLOAD = 'UPLOAD',\n}\n","@import '../../../node_modules/bootstrap/dist/css/bootstrap.css';\n\n:host,\n:host::before,\n:host::after {\n box-sizing: border-box;\n}\n\n:host {\n font-family: var(--bs-body-font-family);\n font-size: var(--bs-body-font-size);\n font-weight: var(--bs-body-font-weight);\n line-height: var(--bs-body-line-height);\n color: var(--bs-body-color);\n text-align: var(--bs-body-text-align);\n -webkit-text-size-adjust: 100%;\n}\n","import { Component, Host, Prop, h } from '@stencil/core';\nimport { ContentType } from '../../model/article/ContentType';\nimport type { Article, ArticleContent, ArticleContentBuilderColumn, ArticleContentBuilderRow } from '../../model/Article';\nimport type { HtmlContent } from '../../model/article/content/HtmlContent';\nimport type { AlbumContent } from '../../model/article/content/AlbumContent';\nimport type { TitleContent } from '../../model/article/content/TitleContent';\nimport type { BlockQuoteContent } from '../../model/article/content/BlockQuoteContent';\nimport type { BulletContent } from '../../model/article/content/BulletContent';\nimport type { CardContent } from '../../model/article/content/CardContent';\nimport type { CarouselContent } from '../../model/article/content/CarouselContent';\nimport type { DividerContent } from '../../model/article/content/DividerContent';\nimport type { DocumentContent } from '../../model/article/content/DocumentContent';\nimport type { HeadingContent } from '../../model/article/content/HeadingContent';\nimport type { LinkContent } from '../../model/article/content/LinkContent';\nimport type { TableContent } from '../../model/article/content/TableContet';\nimport type { TestimonialContent } from '../../model/article/content/TestimonialContent';\nimport type { TextContent } from '../../model/article/content/TextContent';\nimport type { VideoContent } from '../../model/article/content/VideoContent';\nimport type { AskingContent } from '../../model/article/content/AskingContent';\nimport type { FaqContent } from '../../model/article/content/FaqContent';\nimport type { NewsContent } from '../../model/article/content/NewsContent';\nimport type { PageContent } from '../../model/article/content/PageContent';\nimport type { UploadContent } from '../../model/article/content/UploadContent';\nimport ConditionalRender from '../../utils/ConditionalRender';\nimport { strIsNullOrEmptyOrWhitespace } from '../../utils/utils';\nimport { neoDocumentHasContent } from '../../model/article/NeoDocument';\n\n@Component({\n tag: 'aico-article-detail',\n styleUrl: 'aico-article-detail.css',\n scoped: true,\n})\nexport class AicoArticleDetail {\n @Prop() article!: Article;\n\n /**\n * The article translation that will be used to render the content.\n *\n * If the locale specified is not present in the article's translations, most content will not be shown.\n */\n @Prop() locale: string = 'de';\n\n /**\n * Determines if the article date and author are shown or not.\n */\n @Prop() hideDateAndAuthor: boolean = false;\n\n /**\n * Determines if the article category and tags are shown or not.\n */\n @Prop() hideCategoryAndTags: boolean = false;\n\n private readonly dateOptions: Intl.DateTimeFormatOptions = { day: 'numeric', month: 'long', year: 'numeric' };\n\n render() {\n const translation = this.article.attributes.translations.find(translation => translation.locale === this.locale) ?? null;\n const category = this.article.attributes.newsCategory?.translations.find(translation => translation.locale === this.locale) ?? null;\n const articleDate = new Date(this.article.attributes.publishDate);\n const content = this.mapBodyContent();\n\n const headlineFocusX = this.article.attributes.headlineImageFocusXPercentage ? `${this.article.attributes.headlineImageFocusXPercentage}%` : 'center';\n const headlineFocusY = this.article.attributes.headlineImageFocusYPercentage ? `${this.article.attributes.headlineImageFocusYPercentage}%` : 'center';\n const headlineImage = translation?.headlineImage ?? this.article.attributes.headlineImage;\n\n return (\n <Host>\n <figure class=\"figure\">\n <blockquote class=\"blockquote\">\n <h2 class=\"text-uppercase\">{translation?.name ?? this.article.attributes.name}</h2>\n </blockquote>\n {headlineImage && <img class=\"figure-img img-fluid rounded object-fit-cover\" style={{ 'object-position': `${headlineFocusX} ${headlineFocusY}` }} alt=\"Headline image\" src={headlineImage} />}\n <ConditionalRender condition={!this.hideDateAndAuthor}>\n <figcaption class=\"figure-caption mb-1\">\n {articleDate.toLocaleDateString('en-US', this.dateOptions)} by <cite title=\"Author\">{this.article.attributes.author}</cite>\n </figcaption>\n </ConditionalRender>\n <ConditionalRender condition={!this.hideCategoryAndTags && !strIsNullOrEmptyOrWhitespace(category?.webName)}>\n <span class=\"badge bg-info text-dark\">{category?.webName}</span>\n </ConditionalRender>\n </figure>\n <div class=\"content-wrapper\">{content}</div>\n <ConditionalRender condition={!this.hideCategoryAndTags}>\n {this.article.attributes.newsTags.map(tag => {\n const translation = tag.translations.find(translation => translation.locale === this.locale) ?? null;\n return (\n <ConditionalRender condition={!strIsNullOrEmptyOrWhitespace(translation?.webName)}>\n <span class=\"badge bg-light text-dark\">{translation!.webName}</span>\n </ConditionalRender>\n );\n })}\n </ConditionalRender>\n </Host>\n );\n }\n\n /**\n * The article body. Articles authored in the AICO Neo content builder carry\n * their content in `contentBuilderNeoJson` (the legacy `contentBuilder` is\n * then empty, null, or a stale copy) — when the Neo document has sections it\n * wins, mirroring the b2b storefront's precedence. Otherwise the legacy\n * rows render; a null/absent legacy builder renders an empty body instead\n * of throwing.\n */\n private mapBodyContent() {\n const neoDocument = this.article.attributes.contentBuilderNeoJson;\n if (neoDocumentHasContent(neoDocument)) {\n return <aico-neo-content neoDocument={neoDocument!} locale={this.locale} />;\n }\n\n const rows = this.article.attributes.contentBuilder?.rows ?? [];\n return [...rows].sort((a, b) => a.order - b.order).map((row, index) => this.mapRowContent(row, index));\n }\n\n private mapRowContent(row: ArticleContentBuilderRow, index: number) {\n const rowContent = row.columns.map((column, columnIndex) => this.mapColumnContent(column, columnIndex));\n return <div class={`content-row content-row-index-${index}`}>{rowContent}</div>;\n }\n\n private mapColumnContent(column: ArticleContentBuilderColumn, index: number) {\n const columnContent = column.contentContainer.contents.sort((a, b) => (a.sort ?? 0) - (b.sort ?? 0)).map((content, contentIndex) => this.mapContent(content, contentIndex));\n return <div class={`content-column content-column-index-${index}`}>{columnContent}</div>;\n }\n\n private mapContent(content: ArticleContent, index: number) {\n return <div class={`content-data-wrapper content-data-wrapper-index-${index}`}>{this.mapContentData(content.type, content.contentData)}</div>;\n }\n\n private mapContentData(contentType: ContentType | undefined, content: object) {\n switch (contentType) {\n case ContentType.ALBUM:\n return <aico-album-content content={content as AlbumContent} />;\n\n case ContentType.ASKING:\n return <aico-asking-content content={content as AskingContent} locale={this.locale} />;\n\n case ContentType.BLOCK_QUOTE:\n return <aico-block-quote-content content={content as BlockQuoteContent} locale={this.locale} />;\n\n case ContentType.BULLET:\n return <aico-bullet-content content={content as BulletContent} locale={this.locale} />;\n\n case ContentType.CAROUSEL:\n return <aico-carousel-content content={content as CarouselContent} locale={this.locale} />;\n\n case ContentType.CONTENT_CARD:\n return <aico-content-card-content content={content as CardContent} locale={this.locale} />;\n\n case ContentType.DIVIDER:\n return <aico-divider-content content={content as DividerContent} locale={this.locale} />;\n\n case ContentType.DOCUMENT:\n return <aico-document-content content={content as DocumentContent} locale={this.locale} />;\n\n case ContentType.FAQ:\n return <aico-faq-content content={content as FaqContent} locale={this.locale} />;\n\n case ContentType.HEADING:\n return <aico-heading-content content={content as HeadingContent} locale={this.locale} />;\n\n case ContentType.HTML:\n return <aico-html-content content={content as HtmlContent} locale={this.locale} />;\n\n case ContentType.LINK:\n return <aico-link-content content={content as LinkContent} locale={this.locale} />;\n\n case ContentType.NEWS:\n return <aico-news-content content={content as NewsContent} />;\n\n case ContentType.PAGE:\n return <aico-page-content content={content as PageContent} locale={this.locale} />;\n\n case ContentType.TABLE:\n return <aico-table-content content={content as TableContent} locale={this.locale} />;\n\n case ContentType.TESTIMONIAL:\n return <aico-testimonial-content content={content as TestimonialContent} />;\n\n case ContentType.TEXT:\n return <aico-text-content content={content as TextContent} locale={this.locale} />;\n\n case ContentType.TITLE:\n return <aico-title-content content={content as TitleContent} locale={this.locale} />;\n\n case ContentType.UPLOAD:\n return <aico-upload-content content={content as UploadContent} locale={this.locale} />;\n\n case ContentType.VIDEO:\n return <aico-video-content content={content as VideoContent} locale={this.locale} />;\n\n case ContentType.PRODUCT:\n case ContentType.AGENDA:\n case ContentType.LIST_ASKING:\n case ContentType.LIST_AGENDA:\n case ContentType.CRM:\n case ContentType.B2B:\n case ContentType.FORM_BUILDER:\n case ContentType.COURSE:\n case ContentType.COLLECTION:\n default:\n return <div class=\"content-data content-data-not-handled\">Content type not handled.</div>;\n }\n }\n}\n"],"version":3}
1
+ {"file":"aico-article-detail2.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAY,WA8BX;AA9BD,WAAY,WAAW;IACrB,gCAAiB,CAAA;IACjB,4BAAa,CAAA;IACb,8BAAe,CAAA;IACf,8BAAe,CAAA;IACf,kCAAmB,CAAA;IACnB,8BAAe,CAAA;IACf,4CAA6B,CAAA;IAC7B,0CAA2B,CAAA;IAC3B,kCAAmB,CAAA;IACnB,4BAAa,CAAA;IACb,gCAAiB,CAAA;IACjB,gCAAiB,CAAA;IACjB,0CAA2B,CAAA;IAC3B,0CAA2B,CAAA;IAC3B,0BAAW,CAAA;IACX,0BAAW,CAAA;IACX,4CAA6B,CAAA;IAC7B,0CAA2B,CAAA;IAC3B,0BAAW,CAAA;IACX,gCAAiB,CAAA;IACjB,oCAAqB,CAAA;IACrB,4BAAa,CAAA;IACb,4BAAa,CAAA;IACb,kCAAmB,CAAA;IACnB,wCAAyB,CAAA;IACzB,oCAAqB,CAAA;IACrB,4BAAa,CAAA;IACb,8BAAe,CAAA;IACf,gCAAiB,CAAA;AACnB,CAAC,EA9BW,WAAW,KAAX,WAAW;;ACAvB,MAAM,oBAAoB,GAAG,2ywTAA2ywT,CAAC;AACz0wT,gCAAe,oBAAoB;;MC+BtB,iBAAiB;;;;QAoBX,gBAAW,GAA+B,EAAE,GAAG,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;;sBAZrF,IAAI;iCAKQ,KAAK;mCAKH,KAAK;;IAI5C,MAAM;;QACJ,MAAM,WAAW,GAAG,MAAA,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,YAAY,CAAC,IAAI,CAAC,WAAW,IAAI,WAAW,CAAC,MAAM,KAAK,IAAI,CAAC,MAAM,CAAC,mCAAI,IAAI,CAAC;QACzH,MAAM,QAAQ,GAAG,MAAA,MA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M,EAAE,IAAI,CAAC,MAAM,GAAI,CAAC;YAEvF,KAAK,WAAW,CAAC,MAAM;gBACrB,OAAO,2BAAqB,OAAO,EAAE,OAAwB,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,GAAI,CAAC;YAEzF,KAAK,WAAW,CAAC,KAAK;gBACpB,OAAO,0BAAoB,OAAO,EAAE,OAAuB,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,GAAI,CAAC;YAEvF,KAAK,WAAW,CAAC,OAAO,CAAC;YACzB,KAAK,WAAW,CAAC,MAAM,CAAC;YACxB,KAAK,WAAW,CAAC,WAAW,CAAC;YAC7B,KAAK,WAAW,CAAC,WAAW,CAAC;YAC7B,KAAK,WAAW,CAAC,GAAG,CAAC;YACrB,KAAK,WAAW,CAAC,GAAG,CAAC;YACrB,KAAK,WAAW,CAAC,YAAY,CAAC;YAC9B,KAAK,WAAW,CAAC,MAAM,CAAC;YACxB,KAAK,WAAW,CAAC,UAAU,CAAC;YAC5B;gBACE,OAAO,WAAK,KAAK,EAAC,uCAAuC,gCAAgC,CAAC;SAC7F;KACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/model/article/ContentType.ts","src/components/aico-article-detail/aico-article-detail.css?tag=aico-article-detail&encapsulation=scoped","src/components/aico-article-detail/aico-article-detail.tsx"],"sourcesContent":["export enum ContentType {\n BULLET = 'BULLET',\n TEXT = 'TEXT',\n VIDEO = 'VIDEO',\n TABLE = 'TABLE',\n HEADING = 'HEADING',\n TITLE = 'TITLE',\n CONTENT_CARD = 'CONTENT_CARD',\n TESTIMONIAL = 'TESTIMONIAL',\n PRODUCT = 'PRODUCT',\n NEWS = 'NEWS',\n ASKING = 'ASKING',\n AGENDA = 'AGENDA',\n LIST_ASKING = 'LIST_ASKING',\n LIST_AGENDA = 'LIST_AGENDA',\n CRM = 'CRM',\n B2B = 'B2B',\n FORM_BUILDER = 'FORM_BUILDER',\n BLOCK_QUOTE = 'BLOCK_QUOTE',\n FAQ = 'FAQ',\n COURSE = 'COURSE',\n DOCUMENT = 'DOCUMENT',\n LINK = 'LINK',\n HTML = 'HTML',\n DIVIDER = 'DIVIDER',\n COLLECTION = 'COLLECTION',\n CAROUSEL = 'CAROUSEL',\n PAGE = 'PAGE',\n ALBUM = 'ALBUM',\n UPLOAD = 'UPLOAD',\n}\n","@import '../../../node_modules/bootstrap/dist/css/bootstrap.css';\n\n:host,\n:host::before,\n:host::after {\n box-sizing: border-box;\n}\n\n:host {\n font-family: var(--bs-body-font-family);\n font-size: var(--bs-body-font-size);\n font-weight: var(--bs-body-font-weight);\n line-height: var(--bs-body-line-height);\n color: var(--bs-body-color);\n text-align: var(--bs-body-text-align);\n -webkit-text-size-adjust: 100%;\n}\n","import { Component, Host, Prop, h } from '@stencil/core';\nimport { ContentType } from '../../model/article/ContentType';\nimport type { Article, ArticleContent, ArticleContentBuilderColumn, ArticleContentBuilderRow, ArticleTranslation } from '../../model/Article';\nimport type { HtmlContent } from '../../model/article/content/HtmlContent';\nimport type { AlbumContent } from '../../model/article/content/AlbumContent';\nimport type { TitleContent } from '../../model/article/content/TitleContent';\nimport type { BlockQuoteContent } from '../../model/article/content/BlockQuoteContent';\nimport type { BulletContent } from '../../model/article/content/BulletContent';\nimport type { CardContent } from '../../model/article/content/CardContent';\nimport type { CarouselContent } from '../../model/article/content/CarouselContent';\nimport type { DividerContent } from '../../model/article/content/DividerContent';\nimport type { DocumentContent } from '../../model/article/content/DocumentContent';\nimport type { HeadingContent } from '../../model/article/content/HeadingContent';\nimport type { LinkContent } from '../../model/article/content/LinkContent';\nimport type { TableContent } from '../../model/article/content/TableContet';\nimport type { TestimonialContent } from '../../model/article/content/TestimonialContent';\nimport type { TextContent } from '../../model/article/content/TextContent';\nimport type { VideoContent } from '../../model/article/content/VideoContent';\nimport type { AskingContent } from '../../model/article/content/AskingContent';\nimport type { FaqContent } from '../../model/article/content/FaqContent';\nimport type { NewsContent } from '../../model/article/content/NewsContent';\nimport type { PageContent } from '../../model/article/content/PageContent';\nimport type { UploadContent } from '../../model/article/content/UploadContent';\nimport ConditionalRender from '../../utils/ConditionalRender';\nimport { strIsNullOrEmptyOrWhitespace } from '../../utils/utils';\nimport { neoDocumentHasContent } from '../../model/article/NeoDocument';\n\n@Component({\n tag: 'aico-article-detail',\n styleUrl: 'aico-article-detail.css',\n scoped: true,\n})\nexport class AicoArticleDetail {\n @Prop() article!: Article;\n\n /**\n * The article translation that will be used to render the content.\n *\n * If the locale specified is not present in the article's translations, most content will not be shown.\n */\n @Prop() locale: string = 'de';\n\n /**\n * Determines if the article date and author are shown or not.\n */\n @Prop() hideDateAndAuthor: boolean = false;\n\n /**\n * Determines if the article category and tags are shown or not.\n */\n @Prop() hideCategoryAndTags: boolean = false;\n\n private readonly dateOptions: Intl.DateTimeFormatOptions = { day: 'numeric', month: 'long', year: 'numeric' };\n\n render() {\n const translation = this.article.attributes.translations.find(translation => translation.locale === this.locale) ?? null;\n const category = this.article.attributes.newsCategory?.translations.find(translation => translation.locale === this.locale) ?? null;\n const articleDate = new Date(this.article.attributes.publishDate);\n const content = this.mapBodyContent(translation);\n\n const headlineFocusX = this.article.attributes.headlineImageFocusXPercentage ? `${this.article.attributes.headlineImageFocusXPercentage}%` : 'center';\n const headlineFocusY = this.article.attributes.headlineImageFocusYPercentage ? `${this.article.attributes.headlineImageFocusYPercentage}%` : 'center';\n const headlineImage = translation?.headlineImage ?? this.article.attributes.headlineImage;\n\n return (\n <Host>\n <figure class=\"figure\">\n <blockquote class=\"blockquote\">\n <h2 class=\"text-uppercase\">{translation?.name ?? this.article.attributes.name}</h2>\n </blockquote>\n {headlineImage && <img class=\"figure-img img-fluid rounded object-fit-cover\" style={{ 'object-position': `${headlineFocusX} ${headlineFocusY}` }} alt=\"Headline image\" src={headlineImage} />}\n <ConditionalRender condition={!this.hideDateAndAuthor}>\n <figcaption class=\"figure-caption mb-1\">\n {articleDate.toLocaleDateString('en-US', this.dateOptions)} by <cite title=\"Author\">{this.article.attributes.author}</cite>\n </figcaption>\n </ConditionalRender>\n <ConditionalRender condition={!this.hideCategoryAndTags && !strIsNullOrEmptyOrWhitespace(category?.webName)}>\n <span class=\"badge bg-info text-dark\">{category?.webName}</span>\n </ConditionalRender>\n </figure>\n <div class=\"content-wrapper\">{content}</div>\n <ConditionalRender condition={!this.hideCategoryAndTags}>\n {this.article.attributes.newsTags.map(tag => {\n const translation = tag.translations.find(translation => translation.locale === this.locale) ?? null;\n return (\n <ConditionalRender condition={!strIsNullOrEmptyOrWhitespace(translation?.webName)}>\n <span class=\"badge bg-light text-dark\">{translation!.webName}</span>\n </ConditionalRender>\n );\n })}\n </ConditionalRender>\n </Host>\n );\n }\n\n /**\n * The article body. Articles authored in the AICO Neo content builder carry\n * their content in `contentBuilderNeoJson` (the legacy `contentBuilder` is\n * then empty, null, or a stale copy) — when the Neo document has sections it\n * wins, mirroring the b2b storefront's precedence. Otherwise the legacy\n * rows render; a null/absent legacy builder renders an empty body instead\n * of throwing. When this page already shows its own headline image/title\n * above the body, the Neo renderer is asked to trim a duplicate leading\n * hero image/heading from the document (see neo-lead-trim.ts).\n */\n private mapBodyContent(translation: ArticleTranslation | null) {\n const neoDocument = this.article.attributes.contentBuilderNeoJson;\n if (neoDocumentHasContent(neoDocument)) {\n const headlineImage = translation?.headlineImage ?? this.article.attributes.headlineImage;\n const title = translation?.name ?? this.article.attributes.name;\n return <aico-neo-content neoDocument={neoDocument!} locale={this.locale} trimLeadImage={!!headlineImage} dedupeTitle={title} />;\n }\n\n const rows = this.article.attributes.contentBuilder?.rows ?? [];\n return [...rows].sort((a, b) => a.order - b.order).map((row, index) => this.mapRowContent(row, index));\n }\n\n private mapRowContent(row: ArticleContentBuilderRow, index: number) {\n const rowContent = row.columns.map((column, columnIndex) => this.mapColumnContent(column, columnIndex));\n return <div class={`content-row content-row-index-${index}`}>{rowContent}</div>;\n }\n\n private mapColumnContent(column: ArticleContentBuilderColumn, index: number) {\n const columnContent = column.contentContainer.contents.sort((a, b) => (a.sort ?? 0) - (b.sort ?? 0)).map((content, contentIndex) => this.mapContent(content, contentIndex));\n return <div class={`content-column content-column-index-${index}`}>{columnContent}</div>;\n }\n\n private mapContent(content: ArticleContent, index: number) {\n return <div class={`content-data-wrapper content-data-wrapper-index-${index}`}>{this.mapContentData(content.type, content.contentData)}</div>;\n }\n\n private mapContentData(contentType: ContentType | undefined, content: object) {\n switch (contentType) {\n case ContentType.ALBUM:\n return <aico-album-content content={content as AlbumContent} />;\n\n case ContentType.ASKING:\n return <aico-asking-content content={content as AskingContent} locale={this.locale} />;\n\n case ContentType.BLOCK_QUOTE:\n return <aico-block-quote-content content={content as BlockQuoteContent} locale={this.locale} />;\n\n case ContentType.BULLET:\n return <aico-bullet-content content={content as BulletContent} locale={this.locale} />;\n\n case ContentType.CAROUSEL:\n return <aico-carousel-content content={content as CarouselContent} locale={this.locale} />;\n\n case ContentType.CONTENT_CARD:\n return <aico-content-card-content content={content as CardContent} locale={this.locale} />;\n\n case ContentType.DIVIDER:\n return <aico-divider-content content={content as DividerContent} locale={this.locale} />;\n\n case ContentType.DOCUMENT:\n return <aico-document-content content={content as DocumentContent} locale={this.locale} />;\n\n case ContentType.FAQ:\n return <aico-faq-content content={content as FaqContent} locale={this.locale} />;\n\n case ContentType.HEADING:\n return <aico-heading-content content={content as HeadingContent} locale={this.locale} />;\n\n case ContentType.HTML:\n return <aico-html-content content={content as HtmlContent} locale={this.locale} />;\n\n case ContentType.LINK:\n return <aico-link-content content={content as LinkContent} locale={this.locale} />;\n\n case ContentType.NEWS:\n return <aico-news-content content={content as NewsContent} />;\n\n case ContentType.PAGE:\n return <aico-page-content content={content as PageContent} locale={this.locale} />;\n\n case ContentType.TABLE:\n return <aico-table-content content={content as TableContent} locale={this.locale} />;\n\n case ContentType.TESTIMONIAL:\n return <aico-testimonial-content content={content as TestimonialContent} />;\n\n case ContentType.TEXT:\n return <aico-text-content content={content as TextContent} locale={this.locale} />;\n\n case ContentType.TITLE:\n return <aico-title-content content={content as TitleContent} locale={this.locale} />;\n\n case ContentType.UPLOAD:\n return <aico-upload-content content={content as UploadContent} locale={this.locale} />;\n\n case ContentType.VIDEO:\n return <aico-video-content content={content as VideoContent} locale={this.locale} />;\n\n case ContentType.PRODUCT:\n case ContentType.AGENDA:\n case ContentType.LIST_ASKING:\n case ContentType.LIST_AGENDA:\n case ContentType.CRM:\n case ContentType.B2B:\n case ContentType.FORM_BUILDER:\n case ContentType.COURSE:\n case ContentType.COLLECTION:\n default:\n return <div class=\"content-data content-data-not-handled\">Content type not handled.</div>;\n }\n }\n}\n"],"version":3}