@aiconomy/aico-components 0.0.120 → 0.0.124
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/aico-components/aico-components.esm.js +1 -1
- package/dist/aico-components/p-eedb0ba1.entry.js +2 -0
- package/dist/aico-components/p-eedb0ba1.entry.js.map +1 -0
- package/dist/cjs/aico-article-detail.cjs.entry.js +2 -2
- package/dist/cjs/aico-article-detail.cjs.entry.js.map +1 -1
- package/dist/collection/components/aico-article-detail/aico-article-detail.js +2 -2
- package/dist/collection/components/aico-article-detail/aico-article-detail.js.map +1 -1
- package/dist/collection/model/Article.js.map +1 -1
- package/dist/components/aico-article-detail2.js +2 -2
- package/dist/components/aico-article-detail2.js.map +1 -1
- package/dist/esm/aico-article-detail.entry.js +2 -2
- package/dist/esm/aico-article-detail.entry.js.map +1 -1
- package/dist/types/model/Article.d.ts +2 -1
- package/package.json +1 -1
- package/dist/aico-components/p-b61bc8e9.entry.js +0 -2
- package/dist/aico-components/p-b61bc8e9.entry.js.map +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as e,b as t}from"./p-ae20e789.js";export{s as setNonce}from"./p-ae20e789.js";const n=()=>{const t=import.meta.url;const n={};if(t!==""){n.resourcesUrl=new URL(".",t).href}return e(n)};n().then((e=>t([["p-a4f7ae53",[[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]}]]],["p-bf3db54a",[[2,"aico-news-list",{aicoUrl:[1,"aico-url"],aicoBearerToken:[1,"aico-bearer-token"],newsChannels:[16],newsSellerIds:[16],newsBrandIds:[16],newsLanguageLocales:[16],pageSize:[2,"page-size"],nextButtonText:[1,"next-button-text"],previousButtonText:[1,"previous-button-text"],newsResponse:[32],pageNumber:[32]}]]],["p-68930822",[[6,"aico-asking-list-content"]]],["p-90c2d3dc",[[6,"aico-collection-content"]]],["p-7f6fcb2e",[[2,"aico-special-news-carousel",{aicoUrl:[1,"aico-url"],aicoBearerToken:[1,"aico-bearer-token"],newsChannels:[16],newsSellerIds:[16],newsBrandIds:[16],newsLanguageLocales:[16],numberOfArticles:[2,"number-of-articles"],newsResponse:[32]}]]],["p-0b6e7469",[[2,"aico-title-content",{content:[16],locale:[1]}],[2,"aico-no-content"]]],["p-b9bc0400",[[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]}],[2,"aico-news-content",{content:[16]}],[2,"aico-page-content",{content:[16],locale:[1]}],[2,"aico-testimonial-content",{content:[16]}]]],["p-
|
|
1
|
+
import{p as e,b as t}from"./p-ae20e789.js";export{s as setNonce}from"./p-ae20e789.js";const n=()=>{const t=import.meta.url;const n={};if(t!==""){n.resourcesUrl=new URL(".",t).href}return e(n)};n().then((e=>t([["p-a4f7ae53",[[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]}]]],["p-bf3db54a",[[2,"aico-news-list",{aicoUrl:[1,"aico-url"],aicoBearerToken:[1,"aico-bearer-token"],newsChannels:[16],newsSellerIds:[16],newsBrandIds:[16],newsLanguageLocales:[16],pageSize:[2,"page-size"],nextButtonText:[1,"next-button-text"],previousButtonText:[1,"previous-button-text"],newsResponse:[32],pageNumber:[32]}]]],["p-68930822",[[6,"aico-asking-list-content"]]],["p-90c2d3dc",[[6,"aico-collection-content"]]],["p-7f6fcb2e",[[2,"aico-special-news-carousel",{aicoUrl:[1,"aico-url"],aicoBearerToken:[1,"aico-bearer-token"],newsChannels:[16],newsSellerIds:[16],newsBrandIds:[16],newsLanguageLocales:[16],numberOfArticles:[2,"number-of-articles"],newsResponse:[32]}]]],["p-0b6e7469",[[2,"aico-title-content",{content:[16],locale:[1]}],[2,"aico-no-content"]]],["p-b9bc0400",[[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]}],[2,"aico-news-content",{content:[16]}],[2,"aico-page-content",{content:[16],locale:[1]}],[2,"aico-testimonial-content",{content:[16]}]]],["p-eedb0ba1",[[2,"aico-article-detail",{article:[16],locale:[1],hideDateAndAuthor:[4,"hide-date-and-author"],hideCategoryAndTags:[4,"hide-category-and-tags"]}]]],["p-9ea26390",[[2,"aico-news-list-item",{article:[16]}]]]],e)));
|
|
2
2
|
//# sourceMappingURL=aico-components.esm.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{r as t,h as n,H as e}from"./p-ae20e789.js";import{C as c}from"./p-34bd96ca.js";import{s as o}from"./p-e187bbea.js";var a;(function(t){t["BULLET"]="BULLET";t["TEXT"]="TEXT";t["VIDEO"]="VIDEO";t["TABLE"]="TABLE";t["HEADING"]="HEADING";t["TITLE"]="TITLE";t["CONTENT_CARD"]="CONTENT_CARD";t["TESTIMONIAL"]="TESTIMONIAL";t["PRODUCT"]="PRODUCT";t["NEWS"]="NEWS";t["ASKING"]="ASKING";t["AGENDA"]="AGENDA";t["LIST_ASKING"]="LIST_ASKING";t["LIST_AGENDA"]="LIST_AGENDA";t["CRM"]="CRM";t["B2B"]="B2B";t["FORM_BUILDER"]="FORM_BUILDER";t["BLOCK_QUOTE"]="BLOCK_QUOTE";t["FAQ"]="FAQ";t["COURSE"]="COURSE";t["DOCUMENT"]="DOCUMENT";t["LINK"]="LINK";t["HTML"]="HTML";t["DIVIDER"]="DIVIDER";t["COLLECTION"]="COLLECTION";t["CAROUSEL"]="CAROUSEL";t["PAGE"]="PAGE";t["ALBUM"]="ALBUM";t["UPLOAD"]="UPLOAD"})(a||(a={}));const s="";const i=class{constructor(n){t(this,n);this.dateOptions={day:"numeric",month:"long",year:"numeric"};this.article=undefined;this.locale="de";this.hideDateAndAuthor=false;this.hideCategoryAndTags=false}render(){var t,a;const s=(a=(t=this.article.attributes.newsCategory)===null||t===void 0?void 0:t.translations.find((t=>t.locale===this.locale)))!==null&&a!==void 0?a:null;const i=new Date(this.article.attributes.publishDate);const l=this.article.attributes.contentBuilder.rows.sort(((t,n)=>t.order-n.order)).map(((t,n)=>this.mapRowContent(t,n)));return n(e,null,n("figure",null,n("blockquote",{class:"blockquote"},n("h2",{class:"text-uppercase"},this.article.attributes.name)),n(c,{condition:!this.hideDateAndAuthor},n("figcaption",{class:"blockquote-footer mb-1"},i.toLocaleDateString("en-US",this.dateOptions)," by ",n("cite",{title:"Author"},this.article.attributes.author))),n(c,{condition:!this.hideCategoryAndTags&&!o(s===null||s===void 0?void 0:s.webName)},n("span",{class:"badge bg-info text-dark"},s.webName))),n("div",{class:"content-wrapper"},l),n(c,{condition:!this.hideCategoryAndTags},this.article.attributes.newsTags.map((t=>{var e;const a=(e=t.translations.find((t=>t.locale===this.locale)))!==null&&e!==void 0?e:null;return n(c,{condition:!o(a===null||a===void 0?void 0:a.webName)},n("span",{class:"badge bg-light text-dark"},a.webName))}))))}mapRowContent(t,e){const c=t.columns.map(((t,n)=>this.mapColumnContent(t,n)));return n("div",{class:`content-row content-row-index-${e}`},c)}mapColumnContent(t,e){const c=t.contentContainer.contents.sort(((t,n)=>{var e,c;return((e=t.sort)!==null&&e!==void 0?e:0)-((c=n.sort)!==null&&c!==void 0?c:0)})).map(((t,n)=>this.mapContent(t,n)));return n("div",{class:`content-column content-column-index-${e}`},c)}mapContent(t,e){return n("div",{class:`content-data-wrapper content-data-wrapper-index-${e}`},this.mapContentData(t.type,t.contentData))}mapContentData(t,e){switch(t){case a.ALBUM:return n("aico-album-content",{content:e});case a.ASKING:return n("aico-asking-content",{content:e,locale:this.locale});case a.BLOCK_QUOTE:return n("aico-block-quote-content",{content:e,locale:this.locale});case a.BULLET:return n("aico-bullet-content",{content:e,locale:this.locale});case a.CAROUSEL:return n("aico-carousel-content",{content:e,locale:this.locale});case a.CONTENT_CARD:return n("aico-content-card-content",{content:e,locale:this.locale});case a.DIVIDER:return n("aico-divider-content",{content:e,locale:this.locale});case a.DOCUMENT:return n("aico-document-content",{content:e,locale:this.locale});case a.FAQ:return n("aico-faq-content",{content:e,locale:this.locale});case a.HEADING:return n("aico-heading-content",{content:e,locale:this.locale});case a.HTML:return n("aico-html-content",{content:e,locale:this.locale});case a.LINK:return n("aico-link-content",{content:e,locale:this.locale});case a.NEWS:return n("aico-news-content",{content:e});case a.PAGE:return n("aico-page-content",{content:e,locale:this.locale});case a.TABLE:return n("aico-table-content",{content:e,locale:this.locale});case a.TESTIMONIAL:return n("aico-testimonial-content",{content:e});case a.TEXT:return n("aico-text-content",{content:e,locale:this.locale});case a.TITLE:return n("aico-title-content",{content:e,locale:this.locale});case a.UPLOAD:return n("aico-upload-content",{content:e,locale:this.locale});case a.VIDEO:return n("aico-video-content",{content:e,locale:this.locale});case a.PRODUCT:case a.AGENDA:case a.LIST_ASKING:case a.LIST_AGENDA:case a.CRM:case a.B2B:case a.FORM_BUILDER:case a.COURSE:case a.COLLECTION:default:return n("div",{class:"content-data content-data-not-handled"},"Content type not handled.")}}};i.style=s;export{i as aico_article_detail};
|
|
2
|
+
//# sourceMappingURL=p-eedb0ba1.entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["ContentType","aicoArticleDetailCss","AicoArticleDetail","this","dateOptions","day","month","year","render","category","_b","_a","article","attributes","newsCategory","translations","find","translation","locale","articleDate","Date","publishDate","content","contentBuilder","rows","sort","a","b","order","map","row","index","mapRowContent","h","Host","class","name","ConditionalRender","condition","hideDateAndAuthor","toLocaleDateString","title","author","hideCategoryAndTags","strIsNullOrEmptyOrWhitespace","webName","newsTags","tag","rowContent","columns","column","columnIndex","mapColumnContent","columnContent","contentContainer","contents","contentIndex","mapContent","mapContentData","type","contentData","contentType","ALBUM","ASKING","BLOCK_QUOTE","BULLET","CAROUSEL","CONTENT_CARD","DIVIDER","DOCUMENT","FAQ","HEADING","HTML","LINK","NEWS","PAGE","TABLE","TESTIMONIAL","TEXT","TITLE","UPLOAD","VIDEO","PRODUCT","AGENDA","LIST_ASKING","LIST_AGENDA","CRM","B2B","FORM_BUILDER","COURSE","COLLECTION"],"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",null,"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';\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 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.article.attributes.contentBuilder.rows.sort((a, b) => a.order - b.order).map((row, index) => this.mapRowContent(row, index));\n return (\n <Host>\n <figure>\n <blockquote class=\"blockquote\">\n <h2 class=\"text-uppercase\">{this.article.attributes.name}</h2>\n </blockquote>\n <ConditionalRender condition={!this.hideDateAndAuthor}>\n <figcaption class=\"blockquote-footer 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 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"],"mappings":"0HAAA,IAAYA,GAAZ,SAAYA,GACVA,EAAA,mBACAA,EAAA,eACAA,EAAA,iBACAA,EAAA,iBACAA,EAAA,qBACAA,EAAA,iBACAA,EAAA,+BACAA,EAAA,6BACAA,EAAA,qBACAA,EAAA,eACAA,EAAA,mBACAA,EAAA,mBACAA,EAAA,6BACAA,EAAA,6BACAA,EAAA,aACAA,EAAA,aACAA,EAAA,+BACAA,EAAA,6BACAA,EAAA,aACAA,EAAA,mBACAA,EAAA,uBACAA,EAAA,eACAA,EAAA,eACAA,EAAA,qBACAA,EAAA,2BACAA,EAAA,uBACAA,EAAA,eACAA,EAAA,iBACAA,EAAA,kBACD,EA9BD,CAAYA,MAAW,KCAvB,MAAMC,EAAuB,G,MC+BhBC,EAAiB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YoF,YACjB,KAAKpF,EAAYqF,YACjB,KAAKrF,EAAYsF,IACjB,KAAKtF,EAAYuF,IACjB,KAAKvF,EAAYwF,aACjB,KAAKxF,EAAYyF,OACjB,KAAKzF,EAAY0F,WACjB,QACE,OAAOzD,EAAA,OAAKE,MAAM,yCAAuC,6B"}
|
|
@@ -51,8 +51,8 @@ const AicoArticleDetail = class {
|
|
|
51
51
|
this.hideCategoryAndTags = false;
|
|
52
52
|
}
|
|
53
53
|
render() {
|
|
54
|
-
var _a;
|
|
55
|
-
const category = (_a = this.article.attributes.newsCategory.translations.find(translation => translation.locale === this.locale)) !== null &&
|
|
54
|
+
var _a, _b;
|
|
55
|
+
const category = (_b = (_a = this.article.attributes.newsCategory) === null || _a === void 0 ? void 0 : _a.translations.find(translation => translation.locale === this.locale)) !== null && _b !== void 0 ? _b : null;
|
|
56
56
|
const articleDate = new Date(this.article.attributes.publishDate);
|
|
57
57
|
const content = this.article.attributes.contentBuilder.rows.sort((a, b) => a.order - b.order).map((row, index) => this.mapRowContent(row, index));
|
|
58
58
|
return (index.h(index.Host, null, index.h("figure", null, index.h("blockquote", { class: "blockquote" }, index.h("h2", { class: "text-uppercase" }, this.article.attributes.name)), index.h(ConditionalRender.ConditionalRender, { condition: !this.hideDateAndAuthor }, index.h("figcaption", { class: "blockquote-footer mb-1" }, articleDate.toLocaleDateString('en-US', this.dateOptions), " by ", index.h("cite", { title: "Author" }, this.article.attributes.author))), index.h(ConditionalRender.ConditionalRender, { condition: !this.hideCategoryAndTags && !utils.strIsNullOrEmptyOrWhitespace(category === null || category === void 0 ? void 0 : category.webName) }, index.h("span", { class: "badge bg-info text-dark" }, category.webName))), index.h("div", { class: "content-wrapper" }, content), index.h(ConditionalRender.ConditionalRender, { condition: !this.hideCategoryAndTags }, this.article.attributes.newsTags.map(tag => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"aico-article-detail.entry.cjs.js","mappings":";;;;;;;;AAAA,IAAY,WA8BX;AA9BD,WAA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,CAAC,YAAY,CAAC;YAC9B,KAAK,WAAW,CAAC,MAAM,CAAC;YACxB,KAAK,WAAW,CAAC,UAAU,CAAC;YAC5B;gBACE,OAAOA,iBAAK,KAAK,EAAC,uCAAuC,gCAAgC,CAAC;SAC7F;KACF;;;;;;","names":["h","Host","ConditionalRender","strIsNullOrEmptyOrWhitespace","index"],"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 { 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';\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 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.article.attributes.contentBuilder.rows.sort((a, b) => a.order - b.order).map((row, index) => this.mapRowContent(row, index));\n return (\n <Host>\n <figure>\n <blockquote class=\"blockquote\">\n <h2 class=\"text-uppercase\">{this.article.attributes.name}</h2>\n </blockquote>\n <ConditionalRender condition={!this.hideDateAndAuthor}>\n <figcaption class=\"blockquote-footer 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 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-detail.entry.cjs.js","mappings":";;;;;;;;AAAA,IAAY,WA8BX;AA9BD,WAAY,WAAW;IACrB,gCAAiB,CAAA;IACjB,4BAAa,CAAA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AAC,MAAM,CAAC;YACxB,KAAK,WAAW,CAAC,UAAU,CAAC;YAC5B;gBACE,OAAOA,iBAAK,KAAK,EAAC,uCAAuC,gCAAgC,CAAC;SAC7F;KACF;;;;;;","names":["h","Host","ConditionalRender","strIsNullOrEmptyOrWhitespace","index"],"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 { 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';\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 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.article.attributes.contentBuilder.rows.sort((a, b) => a.order - b.order).map((row, index) => this.mapRowContent(row, index));\n return (\n <Host>\n <figure>\n <blockquote class=\"blockquote\">\n <h2 class=\"text-uppercase\">{this.article.attributes.name}</h2>\n </blockquote>\n <ConditionalRender condition={!this.hideDateAndAuthor}>\n <figcaption class=\"blockquote-footer 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 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}
|
|
@@ -11,8 +11,8 @@ export class AicoArticleDetail {
|
|
|
11
11
|
this.hideCategoryAndTags = false;
|
|
12
12
|
}
|
|
13
13
|
render() {
|
|
14
|
-
var _a;
|
|
15
|
-
const category = (_a = this.article.attributes.newsCategory.translations.find(translation => translation.locale === this.locale)) !== null &&
|
|
14
|
+
var _a, _b;
|
|
15
|
+
const category = (_b = (_a = this.article.attributes.newsCategory) === null || _a === void 0 ? void 0 : _a.translations.find(translation => translation.locale === this.locale)) !== null && _b !== void 0 ? _b : null;
|
|
16
16
|
const articleDate = new Date(this.article.attributes.publishDate);
|
|
17
17
|
const content = this.article.attributes.contentBuilder.rows.sort((a, b) => a.order - b.order).map((row, index) => this.mapRowContent(row, index));
|
|
18
18
|
return (h(Host, null, h("figure", null, h("blockquote", { class: "blockquote" }, h("h2", { class: "text-uppercase" }, this.article.attributes.name)), h(ConditionalRender, { condition: !this.hideDateAndAuthor }, h("figcaption", { class: "blockquote-footer mb-1" }, articleDate.toLocaleDateString('en-US', this.dateOptions), " by ", h("cite", { title: "Author" }, this.article.attributes.author))), h(ConditionalRender, { condition: !this.hideCategoryAndTags && !strIsNullOrEmptyOrWhitespace(category === null || category === void 0 ? void 0 : category.webName) }, h("span", { class: "badge bg-info text-dark" }, category.webName))), h("div", { class: "content-wrapper" }, content), h(ConditionalRender, { condition: !this.hideCategoryAndTags }, this.article.attributes.newsTags.map(tag => {
|
|
@@ -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;AAOjE,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;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uB,EAAE,MAAM,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;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';\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 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.article.attributes.contentBuilder.rows.sort((a, b) => a.order - b.order).map((row, index) => this.mapRowContent(row, index));\n return (\n <Host>\n <figure>\n <blockquote class=\"blockquote\">\n <h2 class=\"text-uppercase\">{this.article.attributes.name}</h2>\n </blockquote>\n <ConditionalRender condition={!this.hideDateAndAuthor}>\n <figcaption class=\"blockquote-footer 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 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,+BA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C,WAAW;gBAC1B,OAAO,gCAA0B,OAAO,EAAE,OAA6B,GAAI,CAAC;YAE9E,KAAK,WAAW,CAAC,IAAI;gBACnB,OAAO,yBAAmB,OAAO,EAAE,OAAsB,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,GAAI,CAAC;YAErF,KAAK,WAAW,CAAC,KAAK;gBACpB,OAAO,0BAAoB,OAAO,EAAE,OAAuB,EAAE,MAAM,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;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';\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 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.article.attributes.contentBuilder.rows.sort((a, b) => a.order - b.order).map((row, index) => this.mapRowContent(row, index));\n return (\n <Host>\n <figure>\n <blockquote class=\"blockquote\">\n <h2 class=\"text-uppercase\">{this.article.attributes.name}</h2>\n </blockquote>\n <ConditionalRender condition={!this.hideDateAndAuthor}>\n <figcaption class=\"blockquote-footer 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 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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Article.js","sourceRoot":"","sources":["../../src/model/Article.ts"],"names":[],"mappings":"","sourcesContent":["import { Entity } from './Entity';\nimport { NewsCategory } from './NewsCategory';\nimport { NewsTag } from './NewsTag';\nimport { ContentType } from './article/ContentType';\n\nexport type ArticleTranslation = Entity & {\n locale: string;\n name: string;\n description: string;\n excerpt: string;\n image?: string;\n optimizedImage?: string;\n portraitImage?: string;\n optimizedPortraitImage?: string;\n optimizedListImage?: string;\n shouldShowTranslation: boolean;\n};\n\nexport type ArticleContentTranslation = Entity & {\n locale: string;\n text: string;\n};\n\nexport type ArticleContent = Entity & {\n sort?: number;\n containerOrder?: number;\n type?: ContentType;\n contentData: object;\n};\n\nexport type ArticleContentBuilderColumn = Entity & {\n contentContainer: Entity & {\n isSplit?: object;\n contents: ArticleContent[];\n };\n};\n\nexport type ArticleContentBuilderRow = Entity & {\n defaultTextColor?: string;\n promptText?: string;\n order: number;\n isFullWidth: boolean;\n hasBackground: boolean;\n isOnPrompt: boolean;\n shouldMinimizeColumnSpacing: boolean;\n backgroundColor?: string;\n backgroundType?: string;\n backgroundImage?: string;\n backgroundGradientFrom?: string;\n backgroundGradientTo?: string;\n columns: ArticleContentBuilderColumn[];\n};\n\nexport type ArticleContetBuilder = Entity & {\n name: string;\n rows: ArticleContentBuilderRow[];\n};\n\nexport type ArticleAttributes = {\n createdAt: Date;\n updatedAt: Date;\n publishDate: Date;\n endDatePermanentNews?: Date;\n\n newsCategory
|
|
1
|
+
{"version":3,"file":"Article.js","sourceRoot":"","sources":["../../src/model/Article.ts"],"names":[],"mappings":"","sourcesContent":["import { Entity } from './Entity';\nimport { NewsCategory } from './NewsCategory';\nimport { NewsTag } from './NewsTag';\nimport { ContentType } from './article/ContentType';\n\nexport type ArticleTranslation = Entity & {\n locale: string;\n name: string;\n description: string;\n excerpt: string;\n image?: string;\n optimizedImage?: string;\n portraitImage?: string;\n optimizedPortraitImage?: string;\n optimizedListImage?: string;\n shouldShowTranslation: boolean;\n};\n\nexport type ArticleContentTranslation = Entity & {\n locale: string;\n text: string;\n};\n\nexport type ArticleContent = Entity & {\n sort?: number;\n containerOrder?: number;\n type?: ContentType;\n contentData: object;\n};\n\nexport type ArticleContentBuilderColumn = Entity & {\n contentContainer: Entity & {\n isSplit?: object;\n contents: ArticleContent[];\n };\n};\n\nexport type ArticleContentBuilderRow = Entity & {\n defaultTextColor?: string;\n promptText?: string;\n order: number;\n isFullWidth: boolean;\n hasBackground: boolean;\n isOnPrompt: boolean;\n shouldMinimizeColumnSpacing: boolean;\n backgroundColor?: string;\n backgroundType?: string;\n backgroundImage?: string;\n backgroundGradientFrom?: string;\n backgroundGradientTo?: string;\n columns: ArticleContentBuilderColumn[];\n};\n\nexport type ArticleContetBuilder = Entity & {\n name: string;\n rows: ArticleContentBuilderRow[];\n};\n\nexport type ArticleAttributes = {\n createdAt: Date;\n updatedAt: Date;\n publishDate: Date;\n endDatePermanentNews?: Date;\n\n newsCategory?: NewsCategory;\n newsCategories?: NewsCategory[];\n newsTags: NewsTag[];\n soccerTeams: object[];\n brands: object[];\n album?: object;\n match?: object;\n\n // content\n pageTitle: string;\n metaDescription?: string;\n urlHandle: string;\n author: string;\n contentBuilder: ArticleContetBuilder;\n\n // flags\n isActive: boolean;\n isSpecialArticle: boolean;\n isFullWidth: boolean;\n showInApp: boolean;\n isPermanent: boolean;\n translations: ArticleTranslation[];\n name: string;\n description: string;\n excerpt: string;\n\n // visuals\n headlineImage?: string;\n videoUrl?: string;\n image?: string;\n optimizedImage?: string;\n portraitImage?: string;\n optimizedPortraitImage?: string;\n optimizedListImage?: string;\n\n // coordinates\n focusXCoordinate?: number;\n focusYCoordinate?: number;\n focusXPercentage?: number;\n focusYPercentage?: number;\n mobileFocusXCoordinate?: number;\n mobileFocusYCoordinate?: number;\n mobileFocusXPercentage?: number;\n mobileFocusYPercentage?: number;\n headlineImageFocusXCoordinate?: number;\n headlineImageFocusYCoordinate?: number;\n headlineImageFocusXPercentage?: number;\n headlineImageFocusYPercentage?: number;\n};\n\nexport type Article = {\n id: string;\n type: string;\n links: {\n self: string;\n };\n attributes: ArticleAttributes;\n};\n"]}
|
|
@@ -69,8 +69,8 @@ const AicoArticleDetail = /*@__PURE__*/ proxyCustomElement(class AicoArticleDeta
|
|
|
69
69
|
this.hideCategoryAndTags = false;
|
|
70
70
|
}
|
|
71
71
|
render() {
|
|
72
|
-
var _a;
|
|
73
|
-
const category = (_a = this.article.attributes.newsCategory.translations.find(translation => translation.locale === this.locale)) !== null &&
|
|
72
|
+
var _a, _b;
|
|
73
|
+
const category = (_b = (_a = this.article.attributes.newsCategory) === null || _a === void 0 ? void 0 : _a.translations.find(translation => translation.locale === this.locale)) !== null && _b !== void 0 ? _b : null;
|
|
74
74
|
const articleDate = new Date(this.article.attributes.publishDate);
|
|
75
75
|
const content = this.article.attributes.contentBuilder.rows.sort((a, b) => a.order - b.order).map((row, index) => this.mapRowContent(row, index));
|
|
76
76
|
return (h(Host, null, h("figure", null, h("blockquote", { class: "blockquote" }, h("h2", { class: "text-uppercase" }, this.article.attributes.name)), h(ConditionalRender, { condition: !this.hideDateAndAuthor }, h("figcaption", { class: "blockquote-footer mb-1" }, articleDate.toLocaleDateString('en-US', this.dateOptions), " by ", h("cite", { title: "Author" }, this.article.attributes.author))), h(ConditionalRender, { condition: !this.hideCategoryAndTags && !strIsNullOrEmptyOrWhitespace(category === null || category === void 0 ? void 0 : category.webName) }, h("span", { class: "badge bg-info text-dark" }, category.webName))), h("div", { class: "content-wrapper" }, content), h(ConditionalRender, { condition: !this.hideCategoryAndTags }, this.article.attributes.newsTags.map(tag => {
|
|
@@ -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;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","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 { 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';\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 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.article.attributes.contentBuilder.rows.sort((a, b) => a.order - b.order).map((row, index) => this.mapRowContent(row, index));\n return (\n <Host>\n <figure>\n <blockquote class=\"blockquote\">\n <h2 class=\"text-uppercase\">{this.article.attributes.name}</h2>\n </blockquote>\n <ConditionalRender condition={!this.hideDateAndAuthor}>\n <figcaption class=\"blockquote-footer 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 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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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 { 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';\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 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.article.attributes.contentBuilder.rows.sort((a, b) => a.order - b.order).map((row, index) => this.mapRowContent(row, index));\n return (\n <Host>\n <figure>\n <blockquote class=\"blockquote\">\n <h2 class=\"text-uppercase\">{this.article.attributes.name}</h2>\n </blockquote>\n <ConditionalRender condition={!this.hideDateAndAuthor}>\n <figcaption class=\"blockquote-footer 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 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}
|
|
@@ -47,8 +47,8 @@ const AicoArticleDetail = class {
|
|
|
47
47
|
this.hideCategoryAndTags = false;
|
|
48
48
|
}
|
|
49
49
|
render() {
|
|
50
|
-
var _a;
|
|
51
|
-
const category = (_a = this.article.attributes.newsCategory.translations.find(translation => translation.locale === this.locale)) !== null &&
|
|
50
|
+
var _a, _b;
|
|
51
|
+
const category = (_b = (_a = this.article.attributes.newsCategory) === null || _a === void 0 ? void 0 : _a.translations.find(translation => translation.locale === this.locale)) !== null && _b !== void 0 ? _b : null;
|
|
52
52
|
const articleDate = new Date(this.article.attributes.publishDate);
|
|
53
53
|
const content = this.article.attributes.contentBuilder.rows.sort((a, b) => a.order - b.order).map((row, index) => this.mapRowContent(row, index));
|
|
54
54
|
return (h(Host, null, h("figure", null, h("blockquote", { class: "blockquote" }, h("h2", { class: "text-uppercase" }, this.article.attributes.name)), h(ConditionalRender, { condition: !this.hideDateAndAuthor }, h("figcaption", { class: "blockquote-footer mb-1" }, articleDate.toLocaleDateString('en-US', this.dateOptions), " by ", h("cite", { title: "Author" }, this.article.attributes.author))), h(ConditionalRender, { condition: !this.hideCategoryAndTags && !strIsNullOrEmptyOrWhitespace(category === null || category === void 0 ? void 0 : category.webName) }, h("span", { class: "badge bg-info text-dark" }, category.webName))), h("div", { class: "content-wrapper" }, content), h(ConditionalRender, { condition: !this.hideCategoryAndTags }, this.article.attributes.newsTags.map(tag => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"aico-article-detail.entry.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,CAA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,CAAC;YAE9E,KAAK,WAAW,CAAC,IAAI;gBACnB,OAAO,yBAAmB,OAAO,EAAE,OAAsB,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,GAAI,CAAC;YAErF,KAAK,WAAW,CAAC,KAAK;gBACpB,OAAO,0BAAoB,OAAO,EAAE,OAAuB,EAAE,MAAM,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 { 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';\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 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.article.attributes.contentBuilder.rows.sort((a, b) => a.order - b.order).map((row, index) => this.mapRowContent(row, index));\n return (\n <Host>\n <figure>\n <blockquote class=\"blockquote\">\n <h2 class=\"text-uppercase\">{this.article.attributes.name}</h2>\n </blockquote>\n <ConditionalRender condition={!this.hideDateAndAuthor}>\n <figcaption class=\"blockquote-footer 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 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-detail.entry.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,KA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gBACpB,OAAO,0BAAoB,OAAO,EAAE,OAAuB,EAAE,MAAM,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 { 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';\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 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.article.attributes.contentBuilder.rows.sort((a, b) => a.order - b.order).map((row, index) => this.mapRowContent(row, index));\n return (\n <Host>\n <figure>\n <blockquote class=\"blockquote\">\n <h2 class=\"text-uppercase\">{this.article.attributes.name}</h2>\n </blockquote>\n <ConditionalRender condition={!this.hideDateAndAuthor}>\n <figcaption class=\"blockquote-footer 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 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}
|
|
@@ -54,7 +54,8 @@ export type ArticleAttributes = {
|
|
|
54
54
|
updatedAt: Date;
|
|
55
55
|
publishDate: Date;
|
|
56
56
|
endDatePermanentNews?: Date;
|
|
57
|
-
newsCategory
|
|
57
|
+
newsCategory?: NewsCategory;
|
|
58
|
+
newsCategories?: NewsCategory[];
|
|
58
59
|
newsTags: NewsTag[];
|
|
59
60
|
soccerTeams: object[];
|
|
60
61
|
brands: object[];
|
package/package.json
CHANGED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{r as t,h as n,H as e}from"./p-ae20e789.js";import{C as c}from"./p-34bd96ca.js";import{s as o}from"./p-e187bbea.js";var a;(function(t){t["BULLET"]="BULLET";t["TEXT"]="TEXT";t["VIDEO"]="VIDEO";t["TABLE"]="TABLE";t["HEADING"]="HEADING";t["TITLE"]="TITLE";t["CONTENT_CARD"]="CONTENT_CARD";t["TESTIMONIAL"]="TESTIMONIAL";t["PRODUCT"]="PRODUCT";t["NEWS"]="NEWS";t["ASKING"]="ASKING";t["AGENDA"]="AGENDA";t["LIST_ASKING"]="LIST_ASKING";t["LIST_AGENDA"]="LIST_AGENDA";t["CRM"]="CRM";t["B2B"]="B2B";t["FORM_BUILDER"]="FORM_BUILDER";t["BLOCK_QUOTE"]="BLOCK_QUOTE";t["FAQ"]="FAQ";t["COURSE"]="COURSE";t["DOCUMENT"]="DOCUMENT";t["LINK"]="LINK";t["HTML"]="HTML";t["DIVIDER"]="DIVIDER";t["COLLECTION"]="COLLECTION";t["CAROUSEL"]="CAROUSEL";t["PAGE"]="PAGE";t["ALBUM"]="ALBUM";t["UPLOAD"]="UPLOAD"})(a||(a={}));const s="";const i=class{constructor(n){t(this,n);this.dateOptions={day:"numeric",month:"long",year:"numeric"};this.article=undefined;this.locale="de";this.hideDateAndAuthor=false;this.hideCategoryAndTags=false}render(){var t;const a=(t=this.article.attributes.newsCategory.translations.find((t=>t.locale===this.locale)))!==null&&t!==void 0?t:null;const s=new Date(this.article.attributes.publishDate);const i=this.article.attributes.contentBuilder.rows.sort(((t,n)=>t.order-n.order)).map(((t,n)=>this.mapRowContent(t,n)));return n(e,null,n("figure",null,n("blockquote",{class:"blockquote"},n("h2",{class:"text-uppercase"},this.article.attributes.name)),n(c,{condition:!this.hideDateAndAuthor},n("figcaption",{class:"blockquote-footer mb-1"},s.toLocaleDateString("en-US",this.dateOptions)," by ",n("cite",{title:"Author"},this.article.attributes.author))),n(c,{condition:!this.hideCategoryAndTags&&!o(a===null||a===void 0?void 0:a.webName)},n("span",{class:"badge bg-info text-dark"},a.webName))),n("div",{class:"content-wrapper"},i),n(c,{condition:!this.hideCategoryAndTags},this.article.attributes.newsTags.map((t=>{var e;const a=(e=t.translations.find((t=>t.locale===this.locale)))!==null&&e!==void 0?e:null;return n(c,{condition:!o(a===null||a===void 0?void 0:a.webName)},n("span",{class:"badge bg-light text-dark"},a.webName))}))))}mapRowContent(t,e){const c=t.columns.map(((t,n)=>this.mapColumnContent(t,n)));return n("div",{class:`content-row content-row-index-${e}`},c)}mapColumnContent(t,e){const c=t.contentContainer.contents.sort(((t,n)=>{var e,c;return((e=t.sort)!==null&&e!==void 0?e:0)-((c=n.sort)!==null&&c!==void 0?c:0)})).map(((t,n)=>this.mapContent(t,n)));return n("div",{class:`content-column content-column-index-${e}`},c)}mapContent(t,e){return n("div",{class:`content-data-wrapper content-data-wrapper-index-${e}`},this.mapContentData(t.type,t.contentData))}mapContentData(t,e){switch(t){case a.ALBUM:return n("aico-album-content",{content:e});case a.ASKING:return n("aico-asking-content",{content:e,locale:this.locale});case a.BLOCK_QUOTE:return n("aico-block-quote-content",{content:e,locale:this.locale});case a.BULLET:return n("aico-bullet-content",{content:e,locale:this.locale});case a.CAROUSEL:return n("aico-carousel-content",{content:e,locale:this.locale});case a.CONTENT_CARD:return n("aico-content-card-content",{content:e,locale:this.locale});case a.DIVIDER:return n("aico-divider-content",{content:e,locale:this.locale});case a.DOCUMENT:return n("aico-document-content",{content:e,locale:this.locale});case a.FAQ:return n("aico-faq-content",{content:e,locale:this.locale});case a.HEADING:return n("aico-heading-content",{content:e,locale:this.locale});case a.HTML:return n("aico-html-content",{content:e,locale:this.locale});case a.LINK:return n("aico-link-content",{content:e,locale:this.locale});case a.NEWS:return n("aico-news-content",{content:e});case a.PAGE:return n("aico-page-content",{content:e,locale:this.locale});case a.TABLE:return n("aico-table-content",{content:e,locale:this.locale});case a.TESTIMONIAL:return n("aico-testimonial-content",{content:e});case a.TEXT:return n("aico-text-content",{content:e,locale:this.locale});case a.TITLE:return n("aico-title-content",{content:e,locale:this.locale});case a.UPLOAD:return n("aico-upload-content",{content:e,locale:this.locale});case a.VIDEO:return n("aico-video-content",{content:e,locale:this.locale});case a.PRODUCT:case a.AGENDA:case a.LIST_ASKING:case a.LIST_AGENDA:case a.CRM:case a.B2B:case a.FORM_BUILDER:case a.COURSE:case a.COLLECTION:default:return n("div",{class:"content-data content-data-not-handled"},"Content type not handled.")}}};i.style=s;export{i as aico_article_detail};
|
|
2
|
-
//# sourceMappingURL=p-b61bc8e9.entry.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["ContentType","aicoArticleDetailCss","AicoArticleDetail","this","dateOptions","day","month","year","render","category","_a","article","attributes","newsCategory","translations","find","translation","locale","articleDate","Date","publishDate","content","contentBuilder","rows","sort","a","b","order","map","row","index","mapRowContent","h","Host","class","name","ConditionalRender","condition","hideDateAndAuthor","toLocaleDateString","title","author","hideCategoryAndTags","strIsNullOrEmptyOrWhitespace","webName","newsTags","tag","rowContent","columns","column","columnIndex","mapColumnContent","columnContent","contentContainer","contents","_b","contentIndex","mapContent","mapContentData","type","contentData","contentType","ALBUM","ASKING","BLOCK_QUOTE","BULLET","CAROUSEL","CONTENT_CARD","DIVIDER","DOCUMENT","FAQ","HEADING","HTML","LINK","NEWS","PAGE","TABLE","TESTIMONIAL","TEXT","TITLE","UPLOAD","VIDEO","PRODUCT","AGENDA","LIST_ASKING","LIST_AGENDA","CRM","B2B","FORM_BUILDER","COURSE","COLLECTION"],"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",null,"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';\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 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.article.attributes.contentBuilder.rows.sort((a, b) => a.order - b.order).map((row, index) => this.mapRowContent(row, index));\n return (\n <Host>\n <figure>\n <blockquote class=\"blockquote\">\n <h2 class=\"text-uppercase\">{this.article.attributes.name}</h2>\n </blockquote>\n <ConditionalRender condition={!this.hideDateAndAuthor}>\n <figcaption class=\"blockquote-footer 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 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"],"mappings":"0HAAA,IAAYA,GAAZ,SAAYA,GACVA,EAAA,mBACAA,EAAA,eACAA,EAAA,iBACAA,EAAA,iBACAA,EAAA,qBACAA,EAAA,iBACAA,EAAA,+BACAA,EAAA,6BACAA,EAAA,qBACAA,EAAA,eACAA,EAAA,mBACAA,EAAA,mBACAA,EAAA,6BACAA,EAAA,6BACAA,EAAA,aACAA,EAAA,aACAA,EAAA,+BACAA,EAAA,6BACAA,EAAA,aACAA,EAAA,mBACAA,EAAA,uBACAA,EAAA,eACAA,EAAA,eACAA,EAAA,qBACAA,EAAA,2BACAA,EAAA,uBACAA,EAAA,eACAA,EAAA,iBACAA,EAAA,kBACD,EA9BD,CAAYA,MAAW,KCAvB,MAAMC,EAAuB,G,MC+BhBC,EAAiB,M,yBAoBXC,KAAAC,YAA0C,CAAEC,IAAK,UAAWC,MAAO,OAAQC,KAAM,W,mCAZzE,K,uBAKY,M,yBAKE,K,CAIvC,MAAAC,G,MACE,MAAMC,GAAWC,EAAAP,KAAKQ,QAAQC,WAAWC,aAAaC,aAAaC,MAAKC,GAAeA,EAAYC,SAAWd,KAAKc,YAAO,MAAAP,SAAA,EAAAA,EAAI,KAC9H,MAAMQ,EAAc,IAAIC,KAAKhB,KAAKQ,QAAQC,WAAWQ,aACrD,MAAMC,EAAUlB,KAAKQ,QAAQC,WAAWU,eAAeC,KAAKC,MAAK,CAACC,EAAGC,IAAMD,EAAEE,MAAQD,EAAEC,QAAOC,KAAI,CAACC,EAAKC,IAAU3B,KAAK4B,cAAcF,EAAKC,KAC1I,OACEE,EAACC,EAAI,KACHD,EAAA,cACEA,EAAA,cAAYE,MAAM,cAChBF,EAAA,MAAIE,MAAM,kBAAkB/B,KAAKQ,QAAQC,WAAWuB,OAEtDH,EAACI,EAAiB,CAACC,WAAYlC,KAAKmC,mBAClCN,EAAA,cAAYE,MAAM,0BACfhB,EAAYqB,mBAAmB,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