@aiconomy/aico-components 0.0.124 → 0.0.128
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/aico-components/aico-components.esm.js +1 -1
- package/dist/aico-components/aico-components.esm.js.map +1 -1
- package/dist/aico-components/p-64d6361b.entry.js +18 -0
- package/dist/aico-components/p-64d6361b.entry.js.map +1 -0
- package/dist/cjs/{slick-d0dfbd94.js → aico-album-content_26.cjs.entry.js} +7395 -2
- package/dist/cjs/aico-album-content_26.cjs.entry.js.map +1 -0
- package/dist/cjs/aico-components.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/aico-article-detail/aico-article-detail.js +1 -1
- package/dist/collection/components/aico-article-detail/aico-article-detail.js.map +1 -1
- package/dist/collection/components/aico-fetch-article-detail/aico-fetch-article-detail.js +12 -6
- package/dist/collection/components/aico-fetch-article-detail/aico-fetch-article-detail.js.map +1 -1
- package/dist/components/aico-article-detail2.js +1 -1
- package/dist/components/aico-article-detail2.js.map +1 -1
- package/dist/components/aico-fetch-article-detail.js +12 -6
- package/dist/components/aico-fetch-article-detail.js.map +1 -1
- package/dist/esm/{slick-d11cf173.js → aico-album-content_26.entry.js} +7368 -2
- package/dist/esm/aico-album-content_26.entry.js.map +1 -0
- package/dist/esm/aico-components.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/types/components/aico-fetch-article-detail/aico-fetch-article-detail.d.ts +1 -1
- package/package.json +1 -1
- package/dist/aico-components/p-0b6e7469.entry.js +0 -2
- package/dist/aico-components/p-0b6e7469.entry.js.map +0 -1
- package/dist/aico-components/p-34bd96ca.js +0 -2
- package/dist/aico-components/p-34bd96ca.js.map +0 -1
- package/dist/aico-components/p-7f6fcb2e.entry.js +0 -2
- package/dist/aico-components/p-7f6fcb2e.entry.js.map +0 -1
- package/dist/aico-components/p-86c7fdc7.js +0 -13
- package/dist/aico-components/p-86c7fdc7.js.map +0 -1
- package/dist/aico-components/p-9ea26390.entry.js +0 -2
- package/dist/aico-components/p-9ea26390.entry.js.map +0 -1
- package/dist/aico-components/p-a4f7ae53.entry.js +0 -2
- package/dist/aico-components/p-a4f7ae53.entry.js.map +0 -1
- package/dist/aico-components/p-b9bc0400.entry.js +0 -7
- package/dist/aico-components/p-b9bc0400.entry.js.map +0 -1
- package/dist/aico-components/p-bf3db54a.entry.js +0 -2
- package/dist/aico-components/p-bf3db54a.entry.js.map +0 -1
- package/dist/aico-components/p-e187bbea.js +0 -2
- package/dist/aico-components/p-e187bbea.js.map +0 -1
- package/dist/aico-components/p-eedb0ba1.entry.js +0 -2
- package/dist/aico-components/p-eedb0ba1.entry.js.map +0 -1
- package/dist/cjs/ConditionalRender-52579540.js +0 -9
- package/dist/cjs/ConditionalRender-52579540.js.map +0 -1
- package/dist/cjs/aico-album-content_19.cjs.entry.js +0 -6924
- package/dist/cjs/aico-album-content_19.cjs.entry.js.map +0 -1
- package/dist/cjs/aico-article-detail.cjs.entry.js +0 -135
- package/dist/cjs/aico-article-detail.cjs.entry.js.map +0 -1
- package/dist/cjs/aico-fetch-article-detail.cjs.entry.js +0 -47
- package/dist/cjs/aico-fetch-article-detail.cjs.entry.js.map +0 -1
- package/dist/cjs/aico-news-list-item.cjs.entry.js +0 -27
- package/dist/cjs/aico-news-list-item.cjs.entry.js.map +0 -1
- package/dist/cjs/aico-news-list.cjs.entry.js +0 -96
- package/dist/cjs/aico-news-list.cjs.entry.js.map +0 -1
- package/dist/cjs/aico-no-content_2.cjs.entry.js +0 -51
- package/dist/cjs/aico-no-content_2.cjs.entry.js.map +0 -1
- package/dist/cjs/aico-special-news-carousel.cjs.entry.js +0 -64
- package/dist/cjs/aico-special-news-carousel.cjs.entry.js.map +0 -1
- package/dist/cjs/slick-d0dfbd94.js.map +0 -1
- package/dist/cjs/utils-3d8a97f6.js +0 -114
- package/dist/cjs/utils-3d8a97f6.js.map +0 -1
- package/dist/esm/ConditionalRender-7460c386.js +0 -7
- package/dist/esm/ConditionalRender-7460c386.js.map +0 -1
- package/dist/esm/aico-album-content_19.entry.js +0 -6902
- package/dist/esm/aico-album-content_19.entry.js.map +0 -1
- package/dist/esm/aico-article-detail.entry.js +0 -131
- package/dist/esm/aico-article-detail.entry.js.map +0 -1
- package/dist/esm/aico-fetch-article-detail.entry.js +0 -43
- package/dist/esm/aico-fetch-article-detail.entry.js.map +0 -1
- package/dist/esm/aico-news-list-item.entry.js +0 -23
- package/dist/esm/aico-news-list-item.entry.js.map +0 -1
- package/dist/esm/aico-news-list.entry.js +0 -92
- package/dist/esm/aico-news-list.entry.js.map +0 -1
- package/dist/esm/aico-no-content_2.entry.js +0 -46
- package/dist/esm/aico-no-content_2.entry.js.map +0 -1
- package/dist/esm/aico-special-news-carousel.entry.js +0 -60
- package/dist/esm/aico-special-news-carousel.entry.js.map +0 -1
- package/dist/esm/slick-d11cf173.js.map +0 -1
- package/dist/esm/utils-f81eb958.js +0 -105
- package/dist/esm/utils-f81eb958.js.map +0 -1
|
@@ -17,7 +17,7 @@ const patchBrowser = () => {
|
|
|
17
17
|
};
|
|
18
18
|
|
|
19
19
|
patchBrowser().then(options => {
|
|
20
|
-
return index.bootstrapLazy([["aico-
|
|
20
|
+
return index.bootstrapLazy([["aico-asking-list-content.cjs",[[6,"aico-asking-list-content"]]],["aico-collection-content.cjs",[[6,"aico-collection-content"]]],["aico-album-content_26.cjs",[[2,"aico-fetch-article-detail",{"aicoUrl":[1,"aico-url"],"aicoBearerToken":[1,"aico-bearer-token"],"locale":[1],"hideDateAndAuthor":[4,"hide-date-and-author"],"hideCategoryAndTags":[4,"hide-category-and-tags"],"articleId":[1,"article-id"],"articleUrlHandle":[1,"article-url-handle"],"article":[32]}],[2,"aico-news-list",{"aicoUrl":[1,"aico-url"],"aicoBearerToken":[1,"aico-bearer-token"],"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]}],[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]}],[2,"aico-article-detail",{"article":[16],"locale":[1],"hideDateAndAuthor":[4,"hide-date-and-author"],"hideCategoryAndTags":[4,"hide-category-and-tags"]}],[2,"aico-news-list-item",{"article":[16]}],[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]}],[2,"aico-title-content",{"content":[16],"locale":[1]}],[2,"aico-no-content"]]]], options);
|
|
21
21
|
});
|
|
22
22
|
|
|
23
23
|
exports.setNonce = index.setNonce;
|
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -6,7 +6,7 @@ const index = require('./index-e52034b7.js');
|
|
|
6
6
|
|
|
7
7
|
const defineCustomElements = (win, options) => {
|
|
8
8
|
if (typeof window === 'undefined') return undefined;
|
|
9
|
-
return index.bootstrapLazy([["aico-
|
|
9
|
+
return index.bootstrapLazy([["aico-asking-list-content.cjs",[[6,"aico-asking-list-content"]]],["aico-collection-content.cjs",[[6,"aico-collection-content"]]],["aico-album-content_26.cjs",[[2,"aico-fetch-article-detail",{"aicoUrl":[1,"aico-url"],"aicoBearerToken":[1,"aico-bearer-token"],"locale":[1],"hideDateAndAuthor":[4,"hide-date-and-author"],"hideCategoryAndTags":[4,"hide-category-and-tags"],"articleId":[1,"article-id"],"articleUrlHandle":[1,"article-url-handle"],"article":[32]}],[2,"aico-news-list",{"aicoUrl":[1,"aico-url"],"aicoBearerToken":[1,"aico-bearer-token"],"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]}],[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]}],[2,"aico-article-detail",{"article":[16],"locale":[1],"hideDateAndAuthor":[4,"hide-date-and-author"],"hideCategoryAndTags":[4,"hide-category-and-tags"]}],[2,"aico-news-list-item",{"article":[16]}],[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]}],[2,"aico-title-content",{"content":[16],"locale":[1]}],[2,"aico-no-content"]]]], options);
|
|
10
10
|
};
|
|
11
11
|
|
|
12
12
|
exports.setNonce = index.setNonce;
|
|
@@ -15,7 +15,7 @@ export class AicoArticleDetail {
|
|
|
15
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
|
-
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 => {
|
|
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 === null || category === void 0 ? void 0 : category.webName))), h("div", { class: "content-wrapper" }, content), h(ConditionalRender, { condition: !this.hideCategoryAndTags }, this.article.attributes.newsTags.map(tag => {
|
|
19
19
|
var _a;
|
|
20
20
|
const translation = (_a = tag.translations.find(translation => translation.locale === this.locale)) !== null && _a !== void 0 ? _a : null;
|
|
21
21
|
return (h(ConditionalRender, { condition: !strIsNullOrEmptyOrWhitespace(translation === null || translation === void 0 ? void 0 : translation.webName) }, h("span", { class: "badge bg-light text-dark" }, translation.webName)));
|
|
@@ -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;;IAI5C,MAAM;;QACJ,MAAM,QAAQ,GAAG,MAAA,MAAA,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,YAAY,0CAAE,YAAY,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC,WAAW,CAAC,MAAM,KAAK,IAAI,CAAC,MAAM,CAAC,mCAAI,IAAI,CA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pB,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,+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;;sBAZ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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,5 +1,6 @@
|
|
|
1
|
-
import { h } from "@stencil/core";
|
|
1
|
+
import { Fragment, h } from "@stencil/core";
|
|
2
2
|
import { fetchNewsArticle, fetchNewsArticleByHandle } from "../../utils/utils";
|
|
3
|
+
import ConditionalRender from "../../utils/ConditionalRender";
|
|
3
4
|
export class AicoFetchArticleDetail {
|
|
4
5
|
constructor() {
|
|
5
6
|
this.article = undefined;
|
|
@@ -22,14 +23,19 @@ export class AicoFetchArticleDetail {
|
|
|
22
23
|
if (!this.articleId && !this.articleUrlHandle) {
|
|
23
24
|
throw new Error('Either the article id or the url handle must be provided.');
|
|
24
25
|
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
try {
|
|
27
|
+
if (this.articleUrlHandle) {
|
|
28
|
+
this.article = await fetchNewsArticleByHandle(this.api, this.articleUrlHandle, this.articleFetchController.signal);
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
this.article = await fetchNewsArticle(this.api, this.articleId, this.articleFetchController.signal);
|
|
32
|
+
}
|
|
33
|
+
catch (e) {
|
|
34
|
+
console.error('Could not fetch the news Article with the given data', '[articleId]', this.articleId, '[articleUrlHandle]', this.articleUrlHandle);
|
|
28
35
|
}
|
|
29
|
-
this.article = await fetchNewsArticle(this.api, this.articleId, this.articleFetchController.signal);
|
|
30
36
|
}
|
|
31
37
|
render() {
|
|
32
|
-
return h("aico-article-detail", { article: this.article, locale: this.locale, "hide-date-and-author": this.hideDateAndAuthor });
|
|
38
|
+
return (h(Fragment, null, h(ConditionalRender, { condition: this.article !== undefined }, h("aico-article-detail", { article: this.article, locale: this.locale, "hide-date-and-author": this.hideDateAndAuthor })), h(ConditionalRender, { condition: this.article === undefined }, h("p", null, "Not found"))));
|
|
33
39
|
}
|
|
34
40
|
static get is() { return "aico-fetch-article-detail"; }
|
|
35
41
|
static get encapsulation() { return "scoped"; }
|
package/dist/collection/components/aico-fetch-article-detail/aico-fetch-article-detail.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aico-fetch-article-detail.js","sourceRoot":"","sources":["../../../src/components/aico-fetch-article-detail/aico-fetch-article-detail.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"aico-fetch-article-detail.js","sourceRoot":"","sources":["../../../src/components/aico-fetch-article-detail/aico-fetch-article-detail.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAG/E,OAAO,iBAAiB,MAAM,+BAA+B,CAAC;AAO9D,MAAM,OAAO,sBAAsB;;;;;sBAkBR,IAAI;iCAKQ,KAAK;mCAKH,KAAK;;;;IAmB5C,iBAAiB;QACf,IAAI,CAAC,sBAAsB,GAAG,IAAI,eAAe,EAAE,CAAC;QACpD,IAAI,CAAC,GAAG,GAAG,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,WAAW,EAAE,IAAI,CAAC,eAAe,EAAE,CAAC;IAC1E,CAAC;IAED,oBAAoB;QAClB,IAAI,CAAC,sBAAuB,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;IACrD,CAAC;IAED,KAAK,CAAC,iBAAiB;QACrB,IAAI,CAAC,IAAI,CAAC,SAAS,IAAI,CAAC,IAAI,CAAC,gBAAgB,EAAE;YAC7C,MAAM,IAAI,KAAK,CAAC,2DAA2D,CAAC,CAAC;SAC9E;QAED,IAAI;YACF,IAAI,IAAI,CAAC,gBAAgB,EAAE;gBACzB,IAAI,CAAC,OAAO,GAAG,MAAM,wBAAwB,CAAC,IAAI,CAAC,GAAI,EAAE,IAAI,CAAC,gBAAgB,EAAE,IAAI,CAAC,sBAAuB,CAAC,MAAM,CAAC,CAAC;gBACrH,OAAO;aACR;YAED,IAAI,CAAC,OAAO,GAAG,MAAM,gBAAgB,CAAC,IAAI,CAAC,GAAI,EAAE,IAAI,CAAC,SAAU,EAAE,IAAI,CAAC,sBAAuB,CAAC,MAAM,CAAC,CAAC;SACxG;QAAC,OAAO,CAAC,EAAE;YACV,OAAO,CAAC,KAAK,CAAC,sDAAsD,EAAE,aAAa,EAAE,IAAI,CAAC,SAAS,EAAE,oBAAoB,EAAE,IAAI,CAAC,gBAAgB,CAAC,CAAC;SACnJ;IACH,CAAC;IAED,MAAM;QACJ,OAAO,CACL,EAAC,QAAQ;YACP,EAAC,iBAAiB,IAAC,SAAS,EAAE,IAAI,CAAC,OAAO,KAAK,SAAS;gBACtD,2BAAqB,OAAO,EAAE,IAAI,CAAC,OAAQ,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,0BAAwB,IAAI,CAAC,iBAAiB,GAAI,CAChG;YACpB,EAAC,iBAAiB,IAAC,SAAS,EAAE,IAAI,CAAC,OAAO,KAAK,SAAS;gBACtD,yBAAgB,CACE,CACX,CACZ,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Fragment, Prop, State, h } from '@stencil/core';\nimport { fetchNewsArticle, fetchNewsArticleByHandle } from '../../utils/utils';\nimport { Article } from '../../model/Article';\nimport { AicoApiRequestInfo } from '../../model/AicoApiRequestInfo';\nimport ConditionalRender from '../../utils/ConditionalRender';\n\n@Component({\n tag: 'aico-fetch-article-detail',\n styleUrl: 'aico-fetch-article-detail.css',\n scoped: true,\n})\nexport class AicoFetchArticleDetail {\n @State() article?: Article;\n\n /**\n * The url of the Aico Api that will be used to retrieve the article.\n */\n @Prop() aicoUrl!: string;\n\n /**\n * The token used to authenticate against he Aico Api.\n */\n @Prop() aicoBearerToken!: string;\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 /**\n * The id will be used to fetch the article.\n *\n * If both the 'articleId' and 'articleUrlHandle' are provided, the latter will be used. If neither are provided, an error is thrown.\n */\n @Prop() articleId?: string;\n\n /**\n * The url handle will be used to fetch the article.\n *\n * If both the 'articleId' and 'articleUrlHandle' are provided, the latter will be used. If neither are provided, an error is thrown.\n */\n @Prop() articleUrlHandle?: string;\n\n private api?: AicoApiRequestInfo;\n private articleFetchController?: AbortController;\n\n connectedCallback() {\n this.articleFetchController = new AbortController();\n this.api = { baseApi: this.aicoUrl, bearerToken: this.aicoBearerToken };\n }\n\n disconnectedCallback() {\n this.articleFetchController!.abort('disconnected');\n }\n\n async componentWillLoad(): Promise<void> {\n if (!this.articleId && !this.articleUrlHandle) {\n throw new Error('Either the article id or the url handle must be provided.');\n }\n\n try {\n if (this.articleUrlHandle) {\n this.article = await fetchNewsArticleByHandle(this.api!, this.articleUrlHandle, this.articleFetchController!.signal);\n return;\n }\n\n this.article = await fetchNewsArticle(this.api!, this.articleId!, this.articleFetchController!.signal);\n } catch (e) {\n console.error('Could not fetch the news Article with the given data', '[articleId]', this.articleId, '[articleUrlHandle]', this.articleUrlHandle);\n }\n }\n\n render() {\n return (\n <Fragment>\n <ConditionalRender condition={this.article !== undefined}>\n <aico-article-detail article={this.article!} locale={this.locale} hide-date-and-author={this.hideDateAndAuthor} />\n </ConditionalRender>\n <ConditionalRender condition={this.article === undefined}>\n <p>Not found</p>\n </ConditionalRender>\n </Fragment>\n );\n }\n}\n"]}
|
|
@@ -73,7 +73,7 @@ const AicoArticleDetail = /*@__PURE__*/ proxyCustomElement(class AicoArticleDeta
|
|
|
73
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
|
-
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 => {
|
|
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 === null || category === void 0 ? void 0 : category.webName))), h("div", { class: "content-wrapper" }, content), h(ConditionalRender, { condition: !this.hideCategoryAndTags }, this.article.attributes.newsTags.map(tag => {
|
|
77
77
|
var _a;
|
|
78
78
|
const translation = (_a = tag.translations.find(translation => translation.locale === this.locale)) !== null && _a !== void 0 ? _a : null;
|
|
79
79
|
return (h(ConditionalRender, { condition: !strIsNullOrEmptyOrWhitespace(translation === null || translation === void 0 ? void 0 : translation.webName) }, h("span", { class: "badge bg-light text-dark" }, translation.webName)));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"aico-article-detail2.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;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,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-detail2.js","mappings":";;;;;;;;;;;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C;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,5 +1,6 @@
|
|
|
1
|
-
import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
|
|
1
|
+
import { proxyCustomElement, HTMLElement, h, Fragment } from '@stencil/core/internal/client';
|
|
2
2
|
import { f as fetchNewsArticleByHandle, c as fetchNewsArticle } from './utils.js';
|
|
3
|
+
import { C as ConditionalRender } from './ConditionalRender.js';
|
|
3
4
|
import { d as defineCustomElement$n } from './aico-album-content2.js';
|
|
4
5
|
import { d as defineCustomElement$m } from './aico-article-detail2.js';
|
|
5
6
|
import { d as defineCustomElement$l } from './aico-asking-content2.js';
|
|
@@ -49,14 +50,19 @@ const AicoFetchArticleDetail$1 = /*@__PURE__*/ proxyCustomElement(class AicoFetc
|
|
|
49
50
|
if (!this.articleId && !this.articleUrlHandle) {
|
|
50
51
|
throw new Error('Either the article id or the url handle must be provided.');
|
|
51
52
|
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
53
|
+
try {
|
|
54
|
+
if (this.articleUrlHandle) {
|
|
55
|
+
this.article = await fetchNewsArticleByHandle(this.api, this.articleUrlHandle, this.articleFetchController.signal);
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
this.article = await fetchNewsArticle(this.api, this.articleId, this.articleFetchController.signal);
|
|
59
|
+
}
|
|
60
|
+
catch (e) {
|
|
61
|
+
console.error('Could not fetch the news Article with the given data', '[articleId]', this.articleId, '[articleUrlHandle]', this.articleUrlHandle);
|
|
55
62
|
}
|
|
56
|
-
this.article = await fetchNewsArticle(this.api, this.articleId, this.articleFetchController.signal);
|
|
57
63
|
}
|
|
58
64
|
render() {
|
|
59
|
-
return h("aico-article-detail", { article: this.article, locale: this.locale, "hide-date-and-author": this.hideDateAndAuthor });
|
|
65
|
+
return (h(Fragment, null, h(ConditionalRender, { condition: this.article !== undefined }, h("aico-article-detail", { article: this.article, locale: this.locale, "hide-date-and-author": this.hideDateAndAuthor })), h(ConditionalRender, { condition: this.article === undefined }, h("p", null, "Not found"))));
|
|
60
66
|
}
|
|
61
67
|
static get style() { return aicoFetchArticleDetailCss; }
|
|
62
68
|
}, [2, "aico-fetch-article-detail", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"aico-fetch-article-detail.js","mappings":"
|
|
1
|
+
{"file":"aico-fetch-article-detail.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,MAAM,yBAAyB,GAAG,EAAE;;MCWvBA,wBAAsB;;;;;;;sBAkBR,IAAI;iCAKQ,KAAK;mCAKH,KAAK;;;;IAmB5C,iBAAiB;QACf,IAAI,CAAC,sBAAsB,GAAG,IAAI,eAAe,EAAE,CAAC;QACpD,IAAI,CAAC,GAAG,GAAG,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,WAAW,EAAE,IAAI,CAAC,eAAe,EAAE,CAAC;KACzE;IAED,oBAAoB;QAClB,IAAI,CAAC,sBAAuB,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;KACpD;IAED,MAAM,iBAAiB;QACrB,IAAI,CAAC,IAAI,CAAC,SAAS,IAAI,CAAC,IAAI,CAAC,gBAAgB,EAAE;YAC7C,MAAM,IAAI,KAAK,CAAC,2DAA2D,CAAC,CAAC;SAC9E;QAED,IAAI;YACF,IAAI,IAAI,CAAC,gBAAgB,EAAE;gBACzB,IAAI,CAAC,OAAO,GAAG,MAAM,wBAAwB,CAAC,IAAI,CAAC,GAAI,EAAE,IAAI,CAAC,gBAAgB,EAAE,IAAI,CAAC,sBAAuB,CAAC,MAAM,CAAC,CAAC;gBACrH,OAAO;aACR;YAED,IAAI,CAAC,OAAO,GAAG,MAAM,gBAAgB,CAAC,IAAI,CAAC,GAAI,EAAE,IAAI,CAAC,SAAU,EAAE,IAAI,CAAC,sBAAuB,CAAC,MAAM,CAAC,CAAC;SACxG;QAAC,OAAO,CAAC,EAAE;YACV,OAAO,CAAC,KAAK,CAAC,sDAAsD,EAAE,aAAa,EAAE,IAAI,CAAC,SAAS,EAAE,oBAAoB,EAAE,IAAI,CAAC,gBAAgB,CAAC,CAAC;SACnJ;KACF;IAED,MAAM;QACJ,QACE,EAAC,QAAQ,QACP,EAAC,iBAAiB,IAAC,SAAS,EAAE,IAAI,CAAC,OAAO,KAAK,SAAS,IACtD,2BAAqB,OAAO,EAAE,IAAI,CAAC,OAAQ,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,0BAAwB,IAAI,CAAC,iBAAiB,GAAI,CAChG,EACpB,EAAC,iBAAiB,IAAC,SAAS,EAAE,IAAI,CAAC,OAAO,KAAK,SAAS,IACtD,yBAAgB,CACE,CACX,EACX;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["AicoFetchArticleDetail"],"sources":["src/components/aico-fetch-article-detail/aico-fetch-article-detail.css?tag=aico-fetch-article-detail&encapsulation=scoped","src/components/aico-fetch-article-detail/aico-fetch-article-detail.tsx"],"sourcesContent":["","import { Component, Fragment, Prop, State, h } from '@stencil/core';\nimport { fetchNewsArticle, fetchNewsArticleByHandle } from '../../utils/utils';\nimport { Article } from '../../model/Article';\nimport { AicoApiRequestInfo } from '../../model/AicoApiRequestInfo';\nimport ConditionalRender from '../../utils/ConditionalRender';\n\n@Component({\n tag: 'aico-fetch-article-detail',\n styleUrl: 'aico-fetch-article-detail.css',\n scoped: true,\n})\nexport class AicoFetchArticleDetail {\n @State() article?: Article;\n\n /**\n * The url of the Aico Api that will be used to retrieve the article.\n */\n @Prop() aicoUrl!: string;\n\n /**\n * The token used to authenticate against he Aico Api.\n */\n @Prop() aicoBearerToken!: string;\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 /**\n * The id will be used to fetch the article.\n *\n * If both the 'articleId' and 'articleUrlHandle' are provided, the latter will be used. If neither are provided, an error is thrown.\n */\n @Prop() articleId?: string;\n\n /**\n * The url handle will be used to fetch the article.\n *\n * If both the 'articleId' and 'articleUrlHandle' are provided, the latter will be used. If neither are provided, an error is thrown.\n */\n @Prop() articleUrlHandle?: string;\n\n private api?: AicoApiRequestInfo;\n private articleFetchController?: AbortController;\n\n connectedCallback() {\n this.articleFetchController = new AbortController();\n this.api = { baseApi: this.aicoUrl, bearerToken: this.aicoBearerToken };\n }\n\n disconnectedCallback() {\n this.articleFetchController!.abort('disconnected');\n }\n\n async componentWillLoad(): Promise<void> {\n if (!this.articleId && !this.articleUrlHandle) {\n throw new Error('Either the article id or the url handle must be provided.');\n }\n\n try {\n if (this.articleUrlHandle) {\n this.article = await fetchNewsArticleByHandle(this.api!, this.articleUrlHandle, this.articleFetchController!.signal);\n return;\n }\n\n this.article = await fetchNewsArticle(this.api!, this.articleId!, this.articleFetchController!.signal);\n } catch (e) {\n console.error('Could not fetch the news Article with the given data', '[articleId]', this.articleId, '[articleUrlHandle]', this.articleUrlHandle);\n }\n }\n\n render() {\n return (\n <Fragment>\n <ConditionalRender condition={this.article !== undefined}>\n <aico-article-detail article={this.article!} locale={this.locale} hide-date-and-author={this.hideDateAndAuthor} />\n </ConditionalRender>\n <ConditionalRender condition={this.article === undefined}>\n <p>Not found</p>\n </ConditionalRender>\n </Fragment>\n );\n }\n}\n"],"version":3}
|