@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.
Files changed (80) hide show
  1. package/dist/aico-components/aico-components.esm.js +1 -1
  2. package/dist/aico-components/aico-components.esm.js.map +1 -1
  3. package/dist/aico-components/p-64d6361b.entry.js +18 -0
  4. package/dist/aico-components/p-64d6361b.entry.js.map +1 -0
  5. package/dist/cjs/{slick-d0dfbd94.js → aico-album-content_26.cjs.entry.js} +7395 -2
  6. package/dist/cjs/aico-album-content_26.cjs.entry.js.map +1 -0
  7. package/dist/cjs/aico-components.cjs.js +1 -1
  8. package/dist/cjs/loader.cjs.js +1 -1
  9. package/dist/collection/components/aico-article-detail/aico-article-detail.js +1 -1
  10. package/dist/collection/components/aico-article-detail/aico-article-detail.js.map +1 -1
  11. package/dist/collection/components/aico-fetch-article-detail/aico-fetch-article-detail.js +12 -6
  12. package/dist/collection/components/aico-fetch-article-detail/aico-fetch-article-detail.js.map +1 -1
  13. package/dist/components/aico-article-detail2.js +1 -1
  14. package/dist/components/aico-article-detail2.js.map +1 -1
  15. package/dist/components/aico-fetch-article-detail.js +12 -6
  16. package/dist/components/aico-fetch-article-detail.js.map +1 -1
  17. package/dist/esm/{slick-d11cf173.js → aico-album-content_26.entry.js} +7368 -2
  18. package/dist/esm/aico-album-content_26.entry.js.map +1 -0
  19. package/dist/esm/aico-components.js +1 -1
  20. package/dist/esm/loader.js +1 -1
  21. package/dist/types/components/aico-fetch-article-detail/aico-fetch-article-detail.d.ts +1 -1
  22. package/package.json +1 -1
  23. package/dist/aico-components/p-0b6e7469.entry.js +0 -2
  24. package/dist/aico-components/p-0b6e7469.entry.js.map +0 -1
  25. package/dist/aico-components/p-34bd96ca.js +0 -2
  26. package/dist/aico-components/p-34bd96ca.js.map +0 -1
  27. package/dist/aico-components/p-7f6fcb2e.entry.js +0 -2
  28. package/dist/aico-components/p-7f6fcb2e.entry.js.map +0 -1
  29. package/dist/aico-components/p-86c7fdc7.js +0 -13
  30. package/dist/aico-components/p-86c7fdc7.js.map +0 -1
  31. package/dist/aico-components/p-9ea26390.entry.js +0 -2
  32. package/dist/aico-components/p-9ea26390.entry.js.map +0 -1
  33. package/dist/aico-components/p-a4f7ae53.entry.js +0 -2
  34. package/dist/aico-components/p-a4f7ae53.entry.js.map +0 -1
  35. package/dist/aico-components/p-b9bc0400.entry.js +0 -7
  36. package/dist/aico-components/p-b9bc0400.entry.js.map +0 -1
  37. package/dist/aico-components/p-bf3db54a.entry.js +0 -2
  38. package/dist/aico-components/p-bf3db54a.entry.js.map +0 -1
  39. package/dist/aico-components/p-e187bbea.js +0 -2
  40. package/dist/aico-components/p-e187bbea.js.map +0 -1
  41. package/dist/aico-components/p-eedb0ba1.entry.js +0 -2
  42. package/dist/aico-components/p-eedb0ba1.entry.js.map +0 -1
  43. package/dist/cjs/ConditionalRender-52579540.js +0 -9
  44. package/dist/cjs/ConditionalRender-52579540.js.map +0 -1
  45. package/dist/cjs/aico-album-content_19.cjs.entry.js +0 -6924
  46. package/dist/cjs/aico-album-content_19.cjs.entry.js.map +0 -1
  47. package/dist/cjs/aico-article-detail.cjs.entry.js +0 -135
  48. package/dist/cjs/aico-article-detail.cjs.entry.js.map +0 -1
  49. package/dist/cjs/aico-fetch-article-detail.cjs.entry.js +0 -47
  50. package/dist/cjs/aico-fetch-article-detail.cjs.entry.js.map +0 -1
  51. package/dist/cjs/aico-news-list-item.cjs.entry.js +0 -27
  52. package/dist/cjs/aico-news-list-item.cjs.entry.js.map +0 -1
  53. package/dist/cjs/aico-news-list.cjs.entry.js +0 -96
  54. package/dist/cjs/aico-news-list.cjs.entry.js.map +0 -1
  55. package/dist/cjs/aico-no-content_2.cjs.entry.js +0 -51
  56. package/dist/cjs/aico-no-content_2.cjs.entry.js.map +0 -1
  57. package/dist/cjs/aico-special-news-carousel.cjs.entry.js +0 -64
  58. package/dist/cjs/aico-special-news-carousel.cjs.entry.js.map +0 -1
  59. package/dist/cjs/slick-d0dfbd94.js.map +0 -1
  60. package/dist/cjs/utils-3d8a97f6.js +0 -114
  61. package/dist/cjs/utils-3d8a97f6.js.map +0 -1
  62. package/dist/esm/ConditionalRender-7460c386.js +0 -7
  63. package/dist/esm/ConditionalRender-7460c386.js.map +0 -1
  64. package/dist/esm/aico-album-content_19.entry.js +0 -6902
  65. package/dist/esm/aico-album-content_19.entry.js.map +0 -1
  66. package/dist/esm/aico-article-detail.entry.js +0 -131
  67. package/dist/esm/aico-article-detail.entry.js.map +0 -1
  68. package/dist/esm/aico-fetch-article-detail.entry.js +0 -43
  69. package/dist/esm/aico-fetch-article-detail.entry.js.map +0 -1
  70. package/dist/esm/aico-news-list-item.entry.js +0 -23
  71. package/dist/esm/aico-news-list-item.entry.js.map +0 -1
  72. package/dist/esm/aico-news-list.entry.js +0 -92
  73. package/dist/esm/aico-news-list.entry.js.map +0 -1
  74. package/dist/esm/aico-no-content_2.entry.js +0 -46
  75. package/dist/esm/aico-no-content_2.entry.js.map +0 -1
  76. package/dist/esm/aico-special-news-carousel.entry.js +0 -60
  77. package/dist/esm/aico-special-news-carousel.entry.js.map +0 -1
  78. package/dist/esm/slick-d11cf173.js.map +0 -1
  79. package/dist/esm/utils-f81eb958.js +0 -105
  80. package/dist/esm/utils-f81eb958.js.map +0 -1
@@ -1,131 +0,0 @@
1
- import { r as registerInstance, h, H as Host } from './index-4621a8ba.js';
2
- import { C as ConditionalRender } from './ConditionalRender-7460c386.js';
3
- import { s as strIsNullOrEmptyOrWhitespace } from './utils-f81eb958.js';
4
-
5
- var ContentType;
6
- (function (ContentType) {
7
- ContentType["BULLET"] = "BULLET";
8
- ContentType["TEXT"] = "TEXT";
9
- ContentType["VIDEO"] = "VIDEO";
10
- ContentType["TABLE"] = "TABLE";
11
- ContentType["HEADING"] = "HEADING";
12
- ContentType["TITLE"] = "TITLE";
13
- ContentType["CONTENT_CARD"] = "CONTENT_CARD";
14
- ContentType["TESTIMONIAL"] = "TESTIMONIAL";
15
- ContentType["PRODUCT"] = "PRODUCT";
16
- ContentType["NEWS"] = "NEWS";
17
- ContentType["ASKING"] = "ASKING";
18
- ContentType["AGENDA"] = "AGENDA";
19
- ContentType["LIST_ASKING"] = "LIST_ASKING";
20
- ContentType["LIST_AGENDA"] = "LIST_AGENDA";
21
- ContentType["CRM"] = "CRM";
22
- ContentType["B2B"] = "B2B";
23
- ContentType["FORM_BUILDER"] = "FORM_BUILDER";
24
- ContentType["BLOCK_QUOTE"] = "BLOCK_QUOTE";
25
- ContentType["FAQ"] = "FAQ";
26
- ContentType["COURSE"] = "COURSE";
27
- ContentType["DOCUMENT"] = "DOCUMENT";
28
- ContentType["LINK"] = "LINK";
29
- ContentType["HTML"] = "HTML";
30
- ContentType["DIVIDER"] = "DIVIDER";
31
- ContentType["COLLECTION"] = "COLLECTION";
32
- ContentType["CAROUSEL"] = "CAROUSEL";
33
- ContentType["PAGE"] = "PAGE";
34
- ContentType["ALBUM"] = "ALBUM";
35
- ContentType["UPLOAD"] = "UPLOAD";
36
- })(ContentType || (ContentType = {}));
37
-
38
- const aicoArticleDetailCss = "";
39
-
40
- const AicoArticleDetail = class {
41
- constructor(hostRef) {
42
- registerInstance(this, hostRef);
43
- this.dateOptions = { day: 'numeric', month: 'long', year: 'numeric' };
44
- this.article = undefined;
45
- this.locale = 'de';
46
- this.hideDateAndAuthor = false;
47
- this.hideCategoryAndTags = false;
48
- }
49
- render() {
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
- const articleDate = new Date(this.article.attributes.publishDate);
53
- const content = this.article.attributes.contentBuilder.rows.sort((a, b) => a.order - b.order).map((row, index) => this.mapRowContent(row, index));
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 => {
55
- var _a;
56
- const translation = (_a = tag.translations.find(translation => translation.locale === this.locale)) !== null && _a !== void 0 ? _a : null;
57
- return (h(ConditionalRender, { condition: !strIsNullOrEmptyOrWhitespace(translation === null || translation === void 0 ? void 0 : translation.webName) }, h("span", { class: "badge bg-light text-dark" }, translation.webName)));
58
- }))));
59
- }
60
- mapRowContent(row, index) {
61
- const rowContent = row.columns.map((column, columnIndex) => this.mapColumnContent(column, columnIndex));
62
- return h("div", { class: `content-row content-row-index-${index}` }, rowContent);
63
- }
64
- mapColumnContent(column, index) {
65
- const columnContent = column.contentContainer.contents.sort((a, b) => { var _a, _b; return ((_a = a.sort) !== null && _a !== void 0 ? _a : 0) - ((_b = b.sort) !== null && _b !== void 0 ? _b : 0); }).map((content, contentIndex) => this.mapContent(content, contentIndex));
66
- return h("div", { class: `content-column content-column-index-${index}` }, columnContent);
67
- }
68
- mapContent(content, index) {
69
- return h("div", { class: `content-data-wrapper content-data-wrapper-index-${index}` }, this.mapContentData(content.type, content.contentData));
70
- }
71
- mapContentData(contentType, content) {
72
- switch (contentType) {
73
- case ContentType.ALBUM:
74
- return h("aico-album-content", { content: content });
75
- case ContentType.ASKING:
76
- return h("aico-asking-content", { content: content, locale: this.locale });
77
- case ContentType.BLOCK_QUOTE:
78
- return h("aico-block-quote-content", { content: content, locale: this.locale });
79
- case ContentType.BULLET:
80
- return h("aico-bullet-content", { content: content, locale: this.locale });
81
- case ContentType.CAROUSEL:
82
- return h("aico-carousel-content", { content: content, locale: this.locale });
83
- case ContentType.CONTENT_CARD:
84
- return h("aico-content-card-content", { content: content, locale: this.locale });
85
- case ContentType.DIVIDER:
86
- return h("aico-divider-content", { content: content, locale: this.locale });
87
- case ContentType.DOCUMENT:
88
- return h("aico-document-content", { content: content, locale: this.locale });
89
- case ContentType.FAQ:
90
- return h("aico-faq-content", { content: content, locale: this.locale });
91
- case ContentType.HEADING:
92
- return h("aico-heading-content", { content: content, locale: this.locale });
93
- case ContentType.HTML:
94
- return h("aico-html-content", { content: content, locale: this.locale });
95
- case ContentType.LINK:
96
- return h("aico-link-content", { content: content, locale: this.locale });
97
- case ContentType.NEWS:
98
- return h("aico-news-content", { content: content });
99
- case ContentType.PAGE:
100
- return h("aico-page-content", { content: content, locale: this.locale });
101
- case ContentType.TABLE:
102
- return h("aico-table-content", { content: content, locale: this.locale });
103
- case ContentType.TESTIMONIAL:
104
- return h("aico-testimonial-content", { content: content });
105
- case ContentType.TEXT:
106
- return h("aico-text-content", { content: content, locale: this.locale });
107
- case ContentType.TITLE:
108
- return h("aico-title-content", { content: content, locale: this.locale });
109
- case ContentType.UPLOAD:
110
- return h("aico-upload-content", { content: content, locale: this.locale });
111
- case ContentType.VIDEO:
112
- return h("aico-video-content", { content: content, locale: this.locale });
113
- case ContentType.PRODUCT:
114
- case ContentType.AGENDA:
115
- case ContentType.LIST_ASKING:
116
- case ContentType.LIST_AGENDA:
117
- case ContentType.CRM:
118
- case ContentType.B2B:
119
- case ContentType.FORM_BUILDER:
120
- case ContentType.COURSE:
121
- case ContentType.COLLECTION:
122
- default:
123
- return h("div", { class: "content-data content-data-not-handled" }, "Content type not handled.");
124
- }
125
- }
126
- };
127
- AicoArticleDetail.style = aicoArticleDetailCss;
128
-
129
- export { AicoArticleDetail as aico_article_detail };
130
-
131
- //# sourceMappingURL=aico-article-detail.entry.js.map
@@ -1 +0,0 @@
1
- {"file":"aico-article-detail.entry.js","mappings":";;;;AAAA,IAAY,WA8BX;AA9BD,WAAY,WAAW;IACrB,gCAAiB,CAAA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,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,43 +0,0 @@
1
- import { r as registerInstance, h } from './index-4621a8ba.js';
2
- import { f as fetchNewsArticleByHandle, a as fetchNewsArticle } from './utils-f81eb958.js';
3
-
4
- const aicoFetchArticleDetailCss = "";
5
-
6
- const AicoFetchArticleDetail = class {
7
- constructor(hostRef) {
8
- registerInstance(this, hostRef);
9
- this.article = undefined;
10
- this.aicoUrl = undefined;
11
- this.aicoBearerToken = undefined;
12
- this.locale = 'de';
13
- this.hideDateAndAuthor = false;
14
- this.hideCategoryAndTags = false;
15
- this.articleId = undefined;
16
- this.articleUrlHandle = undefined;
17
- }
18
- connectedCallback() {
19
- this.articleFetchController = new AbortController();
20
- this.api = { baseApi: this.aicoUrl, bearerToken: this.aicoBearerToken };
21
- }
22
- disconnectedCallback() {
23
- this.articleFetchController.abort('disconnected');
24
- }
25
- async componentWillLoad() {
26
- if (!this.articleId && !this.articleUrlHandle) {
27
- throw new Error('Either the article id or the url handle must be provided.');
28
- }
29
- if (this.articleUrlHandle) {
30
- this.article = await fetchNewsArticleByHandle(this.api, this.articleUrlHandle, this.articleFetchController.signal);
31
- return;
32
- }
33
- this.article = await fetchNewsArticle(this.api, this.articleId, this.articleFetchController.signal);
34
- }
35
- render() {
36
- return h("aico-article-detail", { article: this.article, locale: this.locale, "hide-date-and-author": this.hideDateAndAuthor });
37
- }
38
- };
39
- AicoFetchArticleDetail.style = aicoFetchArticleDetailCss;
40
-
41
- export { AicoFetchArticleDetail as aico_fetch_article_detail };
42
-
43
- //# sourceMappingURL=aico-fetch-article-detail.entry.js.map
@@ -1 +0,0 @@
1
- {"file":"aico-fetch-article-detail.entry.js","mappings":";;;AAAA,MAAM,yBAAyB,GAAG,EAAE;;MCUvB,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;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,IAAI,CAAC,gBAAgB,EAAE;YACzB,IAAI,CAAC,OAAO,GAAG,MAAM,wBAAwB,CAAC,IAAI,CAAC,GAAI,EAAE,IAAI,CAAC,gBAAgB,EAAE,IAAI,CAAC,sBAAuB,CAAC,MAAM,CAAC,CAAC;YACrH,OAAO;SACR;QAED,IAAI,CAAC,OAAO,GAAG,MAAM,gBAAgB,CAAC,IAAI,CAAC,GAAI,EAAE,IAAI,CAAC,SAAU,EAAE,IAAI,CAAC,sBAAuB,CAAC,MAAM,CAAC,CAAC;KACxG;IAED,MAAM;QACJ,OAAO,2BAAqB,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,0BAAwB,IAAI,CAAC,iBAAiB,GAAI,CAAC;KAC1H;;;;;;","names":[],"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, Prop, State, h } from '@stencil/core';\nimport { fetchNewsArticle, fetchNewsArticleByHandle } from '../../utils/utils';\nimport { Article } from '../../model/Article';\nimport { AicoApiRequestInfo } from '../../model/AicoApiRequestInfo';\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 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 }\n\n render() {\n return <aico-article-detail article={this.article} locale={this.locale} hide-date-and-author={this.hideDateAndAuthor} />;\n }\n}\n"],"version":3}
@@ -1,23 +0,0 @@
1
- import { r as registerInstance, c as createEvent, h } from './index-4621a8ba.js';
2
-
3
- const aicoNewsListItemCss = "";
4
-
5
- const AicoNewsListItem = class {
6
- constructor(hostRef) {
7
- registerInstance(this, hostRef);
8
- this.articleClick = createEvent(this, "articleClick", 7);
9
- this.article = undefined;
10
- }
11
- render() {
12
- var _a, _b;
13
- return (h("div", { class: "card h-100 pe-auto", style: { cursor: 'pointer' }, onClick: () => {
14
- var _a;
15
- (_a = this.articleClick) === null || _a === void 0 ? void 0 : _a.emit(this.article);
16
- } }, h("div", { class: "ratio ratio-16x9 overflow-hidden" }, h("img", { class: "object-fit-cover", style: { 'min-height': '15rem' }, alt: "Article image", src: (_b = (_a = this.article.attributes.optimizedListImage) !== null && _a !== void 0 ? _a : this.article.attributes.optimizedImage) !== null && _b !== void 0 ? _b : this.article.attributes.image }), h("div", { class: "card-img-overlay d-flex justify-content-end" })), h("div", { class: "card-body" }, h("h5", { class: "card-title" }, this.article.attributes.name), h("p", { class: "card-text" }, this.article.attributes.excerpt))));
17
- }
18
- };
19
- AicoNewsListItem.style = aicoNewsListItemCss;
20
-
21
- export { AicoNewsListItem as aico_news_list_item };
22
-
23
- //# sourceMappingURL=aico-news-list-item.entry.js.map
@@ -1 +0,0 @@
1
- {"file":"aico-news-list-item.entry.js","mappings":";;AAAA,MAAM,mBAAmB,GAAG,EAAE;;MCQjB,gBAAgB;;;;;;IAK3B,MAAM;;QACJ,QACE,WAAK,KAAK,EAAC,oBAAoB,EAC3B,KAAK,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,EAC5B,OAAO,EAAE;;gBACP,MAAA,IAAI,CAAC,YAAY,0CAAE,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;aACvC,IACH,WAAK,KAAK,EAAC,kCAAkC,IAC3C,WACE,KAAK,EAAC,kBAAkB,EACxB,KAAK,EAAE,EAAE,YAAY,EAAE,OAAO,EAAE,EAChC,GAAG,EAAC,eAAe,EACnB,GAAG,EAAE,MAAA,MAAA,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,kBAAkB,mCAAI,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,cAAc,mCAAI,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,KAAK,GAC1H,EACF,WAAK,KAAK,EAAC,6CAA6C,GAA0C,CAC9F,EACN,WAAK,KAAK,EAAC,WAAW,IACpB,UAAI,KAAK,EAAC,YAAY,IAAE,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,CAAM,EAC1D,SAAG,KAAK,EAAC,WAAW,IAAE,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,OAAO,CAAK,CACtD,CACF,EACN;KACH;;;;;;","names":[],"sources":["src/components/aico-news-list-item/aico-news-list-item.css?tag=aico-news-list-item&encapsulation=scoped","src/components/aico-news-list-item/aico-news-list-item.tsx"],"sourcesContent":["","import { Component, Prop, Event, EventEmitter, h } from '@stencil/core';\nimport { Article } from '../../model/Article';\n\n@Component({\n tag: 'aico-news-list-item',\n styleUrl: 'aico-news-list-item.css',\n scoped: true,\n})\nexport class AicoNewsListItem {\n @Prop() article!: Article;\n\n @Event() articleClick?: EventEmitter<Article>;\n\n render() {\n return (\n <div class=\"card h-100 pe-auto\"\n style={{ cursor: 'pointer' }}\n onClick={() => {\n this.articleClick?.emit(this.article);\n }}>\n <div class=\"ratio ratio-16x9 overflow-hidden\">\n <img\n class=\"object-fit-cover\"\n style={{ 'min-height': '15rem' }}\n alt=\"Article image\"\n src={this.article.attributes.optimizedListImage ?? this.article.attributes.optimizedImage ?? this.article.attributes.image}\n />\n <div class=\"card-img-overlay d-flex justify-content-end\">{/*TODO: set the date top-right?*/}</div>\n </div>\n <div class=\"card-body\">\n <h5 class=\"card-title\">{this.article.attributes.name}</h5>\n <p class=\"card-text\">{this.article.attributes.excerpt}</p>\n </div>\n </div>\n );\n }\n}\n"],"version":3}
@@ -1,92 +0,0 @@
1
- import { r as registerInstance, c as createEvent, h, H as Host } from './index-4621a8ba.js';
2
- import { b as fetchNewsArticles } from './utils-f81eb958.js';
3
-
4
- const aicoNewsListCss = "";
5
-
6
- const AicoNewsList = class {
7
- constructor(hostRef) {
8
- registerInstance(this, hostRef);
9
- this.articleClick = createEvent(this, "articleClick", 7);
10
- this.newsResponse = undefined;
11
- this.pageNumber = 1;
12
- this.aicoUrl = undefined;
13
- this.aicoBearerToken = undefined;
14
- this.newsChannels = [];
15
- this.newsSellerIds = [];
16
- this.newsBrandIds = [];
17
- this.newsLanguageLocales = [];
18
- this.pageSize = 16;
19
- this.nextButtonText = 'Next';
20
- this.previousButtonText = 'Previous';
21
- }
22
- connectedCallback() {
23
- this.newsListFetchController = new AbortController();
24
- this.pageNumber = 1;
25
- this.api = { baseApi: this.aicoUrl, bearerToken: this.aicoBearerToken };
26
- }
27
- disconnectedCallback() {
28
- this.newsListFetchController.abort('disconnected');
29
- }
30
- async componentWillLoad() {
31
- this.newsResponse = await fetchNewsArticles(this.api, this.pageNumber, this.pageSize, this.newsListFetchController.signal, this.newsChannels, this.newsSellerIds, this.newsBrandIds, this.newsLanguageLocales);
32
- }
33
- async componentWillUpdate() {
34
- this.newsListFetchController = new AbortController();
35
- this.newsResponse = await fetchNewsArticles(this.api, this.pageNumber, this.pageSize, this.newsListFetchController.signal, this.newsChannels, this.newsSellerIds, this.newsBrandIds, this.newsLanguageLocales);
36
- }
37
- render() {
38
- var _a, _b, _c;
39
- return (h(Host, null, h("div", { class: "row row-cols-1 row-cols-sm-2 row-cols-lg-4 g-4 mb-4" }, (_a = this.newsResponse) === null || _a === void 0 ? void 0 : _a.data.map(article => (h("div", { class: "col" }, h("aico-news-list-item", { article: article, onArticleClick: e => {
40
- var _a;
41
- (_a = this.articleClick) === null || _a === void 0 ? void 0 : _a.emit(e.detail);
42
- } }))))), h("nav", { class: "w-100", "aria-label": "News navigation" }, h("ul", { class: "pagination justify-content-center" }, h("li", { class: `page-item page-link user-select-none d-flex align-items-center ${!((_b = this.newsResponse) === null || _b === void 0 ? void 0 : _b.links.prev) ? 'disabled' : ''}`, style: { cursor: 'pointer' }, onClick: () => {
43
- if (this.pageNumber > 1) {
44
- this.pageNumber -= 1;
45
- }
46
- return false;
47
- } }, h("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "currentColor", class: "bi bi-chevron-left me-1 fs-4", style: { width: '1em', height: '1em' }, viewBox: "0 0 16 16" }, h("path", { "fill-rule": "evenodd", d: "M11.354 1.646a.5.5 0 0 1 0 .708L5.707 8l5.647 5.646a.5.5 0 0 1-.708.708l-6-6a.5.5 0 0 1 0-.708l6-6a.5.5 0 0 1 .708 0" })), this.previousButtonText), this.getViewablePages().map(page => (h("li", { class: `page-item page-link user-select-none ${page === '...' ? 'disabled' : Number(page) === this.pageNumber ? 'active' : ''}`, style: { cursor: 'pointer' }, onClick: () => {
48
- if (page !== '...') {
49
- this.pageNumber = Number(page);
50
- }
51
- return false;
52
- } }, page))), h("li", { class: `page-item page-link user-select-none d-flex align-items-center ${!((_c = this.newsResponse) === null || _c === void 0 ? void 0 : _c.links.next) ? 'disabled' : ''}`, style: { cursor: 'pointer' }, onClick: () => {
53
- var _a, _b;
54
- if (((_a = this.newsResponse) === null || _a === void 0 ? void 0 : _a.meta.page.lastPage) && this.pageNumber < ((_b = this.newsResponse) === null || _b === void 0 ? void 0 : _b.meta.page.lastPage)) {
55
- this.pageNumber += 1;
56
- }
57
- } }, this.nextButtonText, h("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "currentColor", class: "bi bi-chevron-right ms-1 fs-4", style: { width: '1em', height: '1em' }, viewBox: "0 0 16 16" }, h("path", { "fill-rule": "evenodd", d: "M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708" })))))));
58
- }
59
- getViewablePages(lookAhead = 2) {
60
- var _a, _b, _c, _d, _e, _f, _g;
61
- const pages = [];
62
- if (this.pageNumber - lookAhead >= 2) {
63
- pages.push('1');
64
- }
65
- if (this.pageNumber - lookAhead > 2) {
66
- pages.push('...');
67
- }
68
- for (let i = this.pageNumber - lookAhead; i < this.pageNumber; i += 1) {
69
- if (i >= 1) {
70
- pages.push(`${i}`);
71
- }
72
- }
73
- pages.push(`${this.pageNumber}`);
74
- for (let i = this.pageNumber + 1; i <= this.pageNumber + lookAhead; i += 1) {
75
- if (i <= ((_b = (_a = this.newsResponse) === null || _a === void 0 ? void 0 : _a.meta.page.lastPage) !== null && _b !== void 0 ? _b : 0)) {
76
- pages.push(`${i}`);
77
- }
78
- }
79
- if (this.pageNumber + lookAhead < ((_d = (_c = this.newsResponse) === null || _c === void 0 ? void 0 : _c.meta.page.lastPage) !== null && _d !== void 0 ? _d : 0) - 1) {
80
- pages.push('...');
81
- }
82
- if (this.pageNumber + lookAhead <= ((_f = (_e = this.newsResponse) === null || _e === void 0 ? void 0 : _e.meta.page.lastPage) !== null && _f !== void 0 ? _f : 0) - 1) {
83
- pages.push(`${(_g = this.newsResponse) === null || _g === void 0 ? void 0 : _g.meta.page.lastPage}`);
84
- }
85
- return pages;
86
- }
87
- };
88
- AicoNewsList.style = aicoNewsListCss;
89
-
90
- export { AicoNewsList as aico_news_list };
91
-
92
- //# sourceMappingURL=aico-news-list.entry.js.map
@@ -1 +0,0 @@
1
- {"file":"aico-news-list.entry.js","mappings":";;;AAAA,MAAM,eAAe,GAAG,EAAE;;MCWb,YAAY;;;;;0BAGD,CAAC;;;4BAeU,EAAE;6BAKD,EAAE;4BAKH,EAAE;mCAKK,EAAE;wBAKf,EAAE;8BAKI,MAAM;kCAKF,UAAU;;IAY/C,iBAAiB;QACf,IAAI,CAAC,uBAAuB,GAAG,IAAI,eAAe,EAAE,CAAC;QACrD,IAAI,CAAC,UAAU,GAAG,CAAC,CAAC;QAEpB,IAAI,CAAC,GAAG,GAAG,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,WAAW,EAAE,IAAI,CAAC,eAAe,EAAE,CAAC;KACzE;IAED,oBAAoB;QAClB,IAAI,CAAC,uBAAwB,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;KACrD;IAED,MAAM,iBAAiB;QACrB,IAAI,CAAC,YAAY,GAAG,MAAM,iBAAiB,CACzC,IAAI,CAAC,GAAI,EACT,IAAI,CAAC,UAAU,EACf,IAAI,CAAC,QAAQ,EACb,IAAI,CAAC,uBAAwB,CAAC,MAAM,EACpC,IAAI,CAAC,YAAY,EACjB,IAAI,CAAC,aAAa,EAClB,IAAI,CAAC,YAAY,EACjB,IAAI,CAAC,mBAAmB,CACzB,CAAC;KACH;IAED,MAAM,mBAAmB;QACvB,IAAI,CAAC,uBAAuB,GAAG,IAAI,eAAe,EAAE,CAAC;QACrD,IAAI,CAAC,YAAY,GAAG,MAAM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,CAAC,IAAI,CAAC,GAAG,MAAA,IAAI,CAAC,YAAY,0CAAE,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;SACxD;QAED,OAAO,KAAK,CAAC;KACd;;;;;;","names":[],"sources":["src/components/aico-news-list/aico-news-list.css?tag=aico-news-list&encapsulation=scoped","src/components/aico-news-list/aico-news-list.tsx"],"sourcesContent":["","import { Component, Event, EventEmitter, Host, Prop, State, h } from '@stencil/core';\nimport { fetchNewsArticles } from '../../utils/utils';\nimport { NewsResponse } from '../../model/NewsResponse';\nimport { AicoApiRequestInfo } from '../../model/AicoApiRequestInfo';\nimport { Article } from '../../model/Article';\n\n@Component({\n tag: 'aico-news-list',\n styleUrl: 'aico-news-list.css',\n scoped: true,\n})\nexport class AicoNewsList {\n @State() newsResponse?: NewsResponse;\n\n @State() pageNumber = 1;\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 * Channel names used to filter the results.\n */\n @Prop() newsChannels: string[] = [];\n\n /**\n * Sellers used to filter the results.\n */\n @Prop() newsSellerIds: string[] = [];\n\n /**\n * Brands used to filter the results.\n */\n @Prop() newsBrandIds: string[] = [];\n\n /**\n * Language locales used to filter the results.\n */\n @Prop() newsLanguageLocales: string[] = [];\n\n /**\n * The page size. Prefer this number to be even.\n */\n @Prop() pageSize: number = 16;\n\n /**\n * The text used by the next button in the pagination component.\n */\n @Prop() nextButtonText: string = 'Next';\n\n /**\n * The text used by the previous button in the pagination component.\n */\n @Prop() previousButtonText: string = 'Previous';\n\n /**\n * Event emitted when a user clicks an article.\n *\n * The handler receives the entire Article entity.\n */\n @Event() articleClick?: EventEmitter<Article>;\n\n private api?: AicoApiRequestInfo;\n private newsListFetchController?: AbortController;\n\n connectedCallback() {\n this.newsListFetchController = new AbortController();\n this.pageNumber = 1;\n\n this.api = { baseApi: this.aicoUrl, bearerToken: this.aicoBearerToken };\n }\n\n disconnectedCallback() {\n this.newsListFetchController!.abort('disconnected');\n }\n\n async componentWillLoad(): Promise<void> {\n this.newsResponse = await fetchNewsArticles(\n this.api!,\n this.pageNumber,\n this.pageSize,\n this.newsListFetchController!.signal,\n this.newsChannels,\n this.newsSellerIds,\n this.newsBrandIds,\n this.newsLanguageLocales,\n );\n }\n\n async componentWillUpdate(): Promise<void> {\n this.newsListFetchController = new AbortController();\n this.newsResponse = await fetchNewsArticles(\n this.api!,\n this.pageNumber,\n this.pageSize,\n this.newsListFetchController.signal,\n this.newsChannels,\n this.newsSellerIds,\n this.newsBrandIds,\n this.newsLanguageLocales,\n );\n }\n\n render() {\n return (\n <Host>\n <div class=\"row row-cols-1 row-cols-sm-2 row-cols-lg-4 g-4 mb-4\">\n {this.newsResponse?.data.map(article => (\n <div class=\"col\">\n <aico-news-list-item\n article={article}\n onArticleClick={e => {\n this.articleClick?.emit(e.detail);\n }}\n />\n </div>\n ))}\n </div>\n <nav class=\"w-100\" aria-label=\"News navigation\">\n <ul class=\"pagination justify-content-center\">\n <li\n class={`page-item page-link user-select-none d-flex align-items-center ${!this.newsResponse?.links.prev ? 'disabled' : ''}`}\n style={{ cursor: 'pointer' }}\n onClick={() => {\n if (this.pageNumber > 1) {\n this.pageNumber -= 1;\n }\n\n return false;\n }}\n >\n <svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"currentColor\" class=\"bi bi-chevron-left me-1 fs-4\" style={{ width: '1em', height: '1em' }} viewBox=\"0 0 16 16\">\n <path fill-rule=\"evenodd\" d=\"M11.354 1.646a.5.5 0 0 1 0 .708L5.707 8l5.647 5.646a.5.5 0 0 1-.708.708l-6-6a.5.5 0 0 1 0-.708l6-6a.5.5 0 0 1 .708 0\" />\n </svg>\n {this.previousButtonText}\n </li>\n {this.getViewablePages().map(page => (\n <li\n class={`page-item page-link user-select-none ${page === '...' ? 'disabled' : Number(page) === this.pageNumber ? 'active' : ''}`}\n style={{ cursor: 'pointer' }}\n onClick={() => {\n if (page !== '...') {\n this.pageNumber = Number(page);\n }\n return false;\n }}\n >\n {page}\n </li>\n ))}\n <li\n class={`page-item page-link user-select-none d-flex align-items-center ${!this.newsResponse?.links.next ? 'disabled' : ''}`}\n style={{ cursor: 'pointer' }}\n onClick={() => {\n if (this.newsResponse?.meta.page.lastPage && this.pageNumber < this.newsResponse?.meta.page.lastPage) {\n this.pageNumber += 1;\n }\n }}\n >\n {this.nextButtonText}\n <svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"currentColor\" class=\"bi bi-chevron-right ms-1 fs-4\" style={{ width: '1em', height: '1em' }} viewBox=\"0 0 16 16\">\n <path fill-rule=\"evenodd\" d=\"M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708\" />\n </svg>\n </li>\n </ul>\n </nav>\n </Host>\n );\n }\n\n private getViewablePages(lookAhead: number = 2) {\n const pages: string[] = [];\n if (this.pageNumber - lookAhead >= 2) {\n pages.push('1');\n }\n\n if (this.pageNumber - lookAhead > 2) {\n pages.push('...');\n }\n\n for (let i = this.pageNumber - lookAhead; i < this.pageNumber; i += 1) {\n if (i >= 1) {\n pages.push(`${i}`);\n }\n }\n\n pages.push(`${this.pageNumber}`);\n for (let i = this.pageNumber + 1; i <= this.pageNumber + lookAhead; i += 1) {\n if (i <= (this.newsResponse?.meta.page.lastPage ?? 0)) {\n pages.push(`${i}`);\n }\n }\n\n if (this.pageNumber + lookAhead < (this.newsResponse?.meta.page.lastPage ?? 0) - 1) {\n pages.push('...');\n }\n\n if (this.pageNumber + lookAhead <= (this.newsResponse?.meta.page.lastPage ?? 0) - 1) {\n pages.push(`${this.newsResponse?.meta.page.lastPage}`);\n }\n\n return pages;\n }\n}\n"],"version":3}
@@ -1,46 +0,0 @@
1
- import { r as registerInstance, h } from './index-4621a8ba.js';
2
-
3
- const aicoNoContentCss = ".sc-aico-no-content-h{display:block}";
4
-
5
- const AicoNoContent = class {
6
- constructor(hostRef) {
7
- registerInstance(this, hostRef);
8
- }
9
- render() {
10
- return (h("div", null, h("span", null, "The content cannot be rendered because it is either malformed or not supported.")));
11
- }
12
- };
13
- AicoNoContent.style = aicoNoContentCss;
14
-
15
- const aicoTitleContentCss = ".sc-aico-title-content-h{display:block}";
16
-
17
- const AicoTitleContent = class {
18
- constructor(hostRef) {
19
- registerInstance(this, hostRef);
20
- this.content = undefined;
21
- this.locale = 'de';
22
- }
23
- render() {
24
- var _a, _b;
25
- if (!this.content.size || this.content.translations.length === 0) {
26
- return h("aico-no-content", null);
27
- }
28
- const translation = (_a = this.content.translations.find(translation => translation.locale === this.locale)) !== null && _a !== void 0 ? _a : null;
29
- const CustomTag = this.content.size;
30
- const defaultColor = 'black';
31
- const styles = {
32
- color: this.content.titleColor ? this.content.titleColor : defaultColor,
33
- };
34
- if (this.content.hasUnderscore) {
35
- styles['text-decoration-line'] = 'underline';
36
- styles['text-decoration-color'] = (_b = this.content.underscoreColor) !== null && _b !== void 0 ? _b : defaultColor;
37
- styles['text-decoration-thickness'] = '3px';
38
- }
39
- return (h(CustomTag, null, h("span", { style: styles }, translation === null || translation === void 0 ? void 0 : translation.title)));
40
- }
41
- };
42
- AicoTitleContent.style = aicoTitleContentCss;
43
-
44
- export { AicoNoContent as aico_no_content, AicoTitleContent as aico_title_content };
45
-
46
- //# sourceMappingURL=aico-no-content_2.entry.js.map
@@ -1 +0,0 @@
1
- {"file":"aico-no-content.aico-title-content.entry.js","mappings":";;AAAA,MAAM,gBAAgB,GAAG,sCAAsC;;MCOlD,aAAa;;;;IACxB,MAAM;QACJ,QACE,eACE,kGAA4F,CACxF,EACN;KACH;;;;ACdH,MAAM,mBAAmB,GAAG,yCAAyC;;MCQxD,gBAAgB;;;;sBAGF,IAAI;;IAE7B,MAAM;;QACJ,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,IAAI,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,MAAM,KAAK,CAAC,EAAE;YAChE,OAAO,0BAAmB,CAAC;SAC5B;QAED,MAAM,WAAW,GAAG,MAAA,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,IAAI,CAAC,WAAW,IAAI,WAAW,CAAC,MAAM,KAAK,IAAI,CAAC,MAAM,CAAC,mCAAI,IAAI,CAAC;QAC9G,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC;QAEpC,MAAM,YAAY,GAAG,OAAO,CAAC;QAC7B,MAAM,MAAM,GAA8B;YACxC,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,GAAG,YAAY;SACxE,CAAC;QAEF,IAAI,IAAI,CAAC,OAAO,CAAC,aAAa,EAAE;YAC9B,MAAM,CAAC,sBAAsB,CAAC,GAAG,WAAW,CAAC;YAC7C,MAAM,CAAC,uBAAuB,CAAC,GAAG,MAAA,IAAI,CAAC,OAAO,CAAC,eAAe,mCAAI,YAAY,CAAC;YAC/E,MAAM,CAAC,2BAA2B,CAAC,GAAG,KAAK,CAAC;SAC7C;QAED,QACE,EAAC,SAAS,QACR,YAAM,KAAK,EAAE,MAAM,IAAG,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,KAAK,CAAQ,CACtC,EACZ;KACH;;;;;;","names":[],"sources":["src/components/content/aico-no-content/aico-no-content.css?tag=aico-no-content&encapsulation=scoped","src/components/content/aico-no-content/aico-no-content.tsx","src/components/content/aico-title-content/aico-title-content.css?tag=aico-title-content&encapsulation=scoped","src/components/content/aico-title-content/aico-title-content.tsx"],"sourcesContent":[":host {\n display: block;\n}\n","import { Component, h } from '@stencil/core';\n\n@Component({\n tag: 'aico-no-content',\n styleUrl: 'aico-no-content.css',\n scoped: true,\n})\nexport class AicoNoContent {\n render() {\n return (\n <div>\n <span>The content cannot be rendered because it is either malformed or not supported.</span>\n </div>\n );\n }\n}\n",":host {\n display: block;\n}\n","import { Component, Prop, h } from '@stencil/core';\nimport { TitleContent } from '../../../model/article/content/TitleContent';\n\n@Component({\n tag: 'aico-title-content',\n styleUrl: 'aico-title-content.css',\n scoped: true,\n})\nexport class AicoTitleContent {\n @Prop() content!: TitleContent;\n\n @Prop() locale: string = 'de';\n\n render() {\n if (!this.content.size || this.content.translations.length === 0) {\n return <aico-no-content />;\n }\n\n const translation = this.content.translations.find(translation => translation.locale === this.locale) ?? null;\n const CustomTag = this.content.size;\n\n const defaultColor = 'black';\n const styles: { [key: string]: string } = {\n color: this.content.titleColor ? this.content.titleColor : defaultColor,\n };\n\n if (this.content.hasUnderscore) {\n styles['text-decoration-line'] = 'underline';\n styles['text-decoration-color'] = this.content.underscoreColor ?? defaultColor;\n styles['text-decoration-thickness'] = '3px';\n }\n\n return (\n <CustomTag>\n <span style={styles}>{translation?.title}</span>\n </CustomTag>\n );\n }\n}\n"],"version":3}
@@ -1,60 +0,0 @@
1
- import { r as registerInstance, c as createEvent, h } from './index-4621a8ba.js';
2
- import { c as fetchSpecialNewsArticles } from './utils-f81eb958.js';
3
- import { j as jquery } from './slick-d11cf173.js';
4
-
5
- const aicoSpecialNewsCarouselCss = ".slick-slide.sc-aico-special-news-carousel>div.sc-aico-special-news-carousel{height:100% !important}";
6
-
7
- const AicoSpecialNewsCarousel = class {
8
- constructor(hostRef) {
9
- registerInstance(this, hostRef);
10
- this.articleClicked = createEvent(this, "articleClicked", 7);
11
- this.newsResponse = undefined;
12
- this.aicoUrl = undefined;
13
- this.aicoBearerToken = undefined;
14
- this.newsChannels = [];
15
- this.newsSellerIds = [];
16
- this.newsBrandIds = [];
17
- this.newsLanguageLocales = [];
18
- this.numberOfArticles = 6;
19
- }
20
- connectedCallback() {
21
- this.newsListFetchController = new AbortController();
22
- this.api = { baseApi: this.aicoUrl, bearerToken: this.aicoBearerToken };
23
- }
24
- disconnectedCallback() {
25
- this.newsListFetchController.abort('disconnected');
26
- }
27
- async componentWillLoad() {
28
- this.newsResponse = await fetchSpecialNewsArticles(this.api, 1, this.numberOfArticles, this.newsListFetchController.signal, this.newsChannels, this.newsSellerIds, this.newsBrandIds, this.newsLanguageLocales);
29
- }
30
- async componentWillUpdate() {
31
- this.newsListFetchController = new AbortController();
32
- this.newsResponse = await fetchSpecialNewsArticles(this.api, 1, this.numberOfArticles, this.newsListFetchController.signal, this.newsChannels, this.newsSellerIds, this.newsBrandIds, this.newsLanguageLocales);
33
- }
34
- componentDidLoad() {
35
- jquery('.carousel').slick({
36
- autoplay: true,
37
- autoplaySpeed: 6000,
38
- dots: true,
39
- arrows: false,
40
- pauseOnDotsHover: true,
41
- });
42
- }
43
- render() {
44
- return (h("div", { class: "carousel" }, this.newsResponse.data.map(article => {
45
- var _a;
46
- const focusX = article.attributes.focusXPercentage ? `${article.attributes.focusXPercentage}%` : 'center';
47
- const focusY = article.attributes.focusYPercentage ? `${article.attributes.focusYPercentage}%` : 'center';
48
- return (h("div", { class: "carousel-item card border-0" }, h("div", { class: "card-body" }, h("h5", { class: "card-title text-center text-uppercase" }, h("a", { class: "text-reset text-decoration-none", href: "#", onClick: e => {
49
- var _a;
50
- e.preventDefault();
51
- (_a = this.articleClicked) === null || _a === void 0 ? void 0 : _a.emit(article);
52
- } }, article.attributes.name))), h("div", { class: "ratio ratio-16x9 mx-auto", style: { 'max-width': '50%' } }, h("img", { class: "card-img-bottom object-fit-cover", style: { 'object-position': `${focusX} ${focusY}`, 'min-height': '15rem' }, alt: "News Picture", "data-lazy": (_a = article.attributes.optimizedImage) !== null && _a !== void 0 ? _a : article.attributes.image }))));
53
- })));
54
- }
55
- };
56
- AicoSpecialNewsCarousel.style = aicoSpecialNewsCarouselCss;
57
-
58
- export { AicoSpecialNewsCarousel as aico_special_news_carousel };
59
-
60
- //# sourceMappingURL=aico-special-news-carousel.entry.js.map
@@ -1 +0,0 @@
1
- {"file":"aico-special-news-carousel.entry.js","mappings":";;;;AAAA,MAAM,0BAA0B,GAAG,sGAAsG;;MCc5H,uBAAuB;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AAY,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO;;YACjC,MAAM,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,gBAAgB,GAAG,GAAG,OAAO,CAAC,UAAU,CAAC,gBAAgB,GAAG,GAAG,QAAQ,CAAC;YAC1G,MAAM,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,gBAAgB,GAAG,GAAG,OAAO,CAAC,UAAU,CAAC,gBAAgB,GAAG,GAAG,QAAQ,CAAC;YAC1G,QACE,WAAK,KAAK,EAAC,6BAA6B,IACtC,WAAK,KAAK,EAAC,WAAW,IACpB,UAAI,KAAK,EAAC,uCAAuC,IAC/C,SACE,KAAK,EAAC,iCAAiC,EACvC,IAAI,EAAC,GAAG,EACR,OAAO,EAAE,CAAC;;oBACR,CAAC,CAAC,cAAc,EAAE,CAAC;oBACnB,MAAA,IAAI,CAAC,cAAc,0CAAE,IAAI,CAAC,OAAO,CAAC,CAAC;iBACpC,IAEA,OAAO,CAAC,UAAU,CAAC,IAAI,CACtB,CACD,CACD,EACN,WAAK,KAAK,EAAC,0BAA0B,EAAC,KAAK,EAAE,EAAE,WAAW,EAAE,KAAK,EAAE,IACjE,WACE,KAAK,EAAC,kCAAkC,EACxC,KAAK,EAAE,EAAE,iBAAiB,EAAE,GAAG,MAAM,IAAI,MAAM,EAAE,EAAE,YAAY,EAAE,OAAO,EAAE,EAC1E,GAAG,EAAC,cAAc,eACP,MAAA,OAAO,CAAC,UAAU,CAAC,cAAc,mCAAI,OAAO,CAAC,UAAU,CAAC,KAAK,GACxE,CACE,CACF,EACN;SACH,CAAC,CACE,EACN;KACH;;;;;;","names":["$"],"sources":["src/components/aico-special-news-carousel/aico-special-news-carousel.css?tag=aico-special-news-carousel&encapsulation=scoped","src/components/aico-special-news-carousel/aico-special-news-carousel.tsx"],"sourcesContent":[".slick-slide > div {\n height: 100% !important;\n}\n","import { Component, Event, EventEmitter, Prop, State, h } from '@stencil/core';\nimport type { NewsResponse } from '../../model/NewsResponse';\nimport type { AicoApiRequestInfo } from '../../model/AicoApiRequestInfo';\nimport type { Article } from '../../model/Article';\nimport { fetchSpecialNewsArticles } from '../../utils/utils';\n\nimport $ from 'jquery';\nimport 'slick-carousel';\n\n@Component({\n tag: 'aico-special-news-carousel',\n styleUrl: 'aico-special-news-carousel.css',\n scoped: true,\n})\nexport class AicoSpecialNewsCarousel {\n @State() newsResponse!: NewsResponse;\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 * Channel names used to filter the results.\n */\n @Prop() newsChannels: string[] = [];\n\n /**\n * Sellers used to filter the results.\n */\n @Prop() newsSellerIds: string[] = [];\n\n /**\n * Brands used to filter the results.\n */\n @Prop() newsBrandIds: string[] = [];\n\n /**\n * Language locales used to filter the results.\n */\n @Prop() newsLanguageLocales: string[] = [];\n\n /**\n * The number of articles shown in the carousel. Prefer this number to be small.\n */\n @Prop() numberOfArticles: number = 6;\n\n /**\n * Event emitted when a user clicks an article title.\n *\n * The handler receives the entire Article entity.\n */\n @Event() articleClicked?: EventEmitter<Article>;\n\n private api?: AicoApiRequestInfo;\n private newsListFetchController?: AbortController;\n\n connectedCallback() {\n this.newsListFetchController = new AbortController();\n this.api = { baseApi: this.aicoUrl, bearerToken: this.aicoBearerToken };\n }\n\n disconnectedCallback() {\n this.newsListFetchController!.abort('disconnected');\n }\n\n async componentWillLoad(): Promise<void> {\n this.newsResponse = await fetchSpecialNewsArticles(\n this.api!,\n 1,\n this.numberOfArticles,\n this.newsListFetchController!.signal,\n this.newsChannels,\n this.newsSellerIds,\n this.newsBrandIds,\n this.newsLanguageLocales,\n );\n }\n\n async componentWillUpdate(): Promise<void> {\n this.newsListFetchController = new AbortController();\n this.newsResponse = await fetchSpecialNewsArticles(\n this.api!,\n 1,\n this.numberOfArticles,\n this.newsListFetchController.signal,\n this.newsChannels,\n this.newsSellerIds,\n this.newsBrandIds,\n this.newsLanguageLocales,\n );\n }\n\n componentDidLoad() {\n $('.carousel').slick({\n autoplay: true,\n autoplaySpeed: 6000,\n dots: true,\n arrows: false,\n pauseOnDotsHover: true,\n });\n }\n\n render() {\n return (\n <div class=\"carousel\">\n {this.newsResponse.data.map(article => {\n const focusX = article.attributes.focusXPercentage ? `${article.attributes.focusXPercentage}%` : 'center';\n const focusY = article.attributes.focusYPercentage ? `${article.attributes.focusYPercentage}%` : 'center';\n return (\n <div class=\"carousel-item card border-0\">\n <div class=\"card-body\">\n <h5 class=\"card-title text-center text-uppercase\">\n <a\n class=\"text-reset text-decoration-none\"\n href=\"#\"\n onClick={e => {\n e.preventDefault();\n this.articleClicked?.emit(article);\n }}\n >\n {article.attributes.name}\n </a>\n </h5>\n </div>\n <div class=\"ratio ratio-16x9 mx-auto\" style={{ 'max-width': '50%' }}>\n <img\n class=\"card-img-bottom object-fit-cover\"\n style={{ 'object-position': `${focusX} ${focusY}`, 'min-height': '15rem' }}\n alt=\"News Picture\"\n data-lazy={article.attributes.optimizedImage ?? article.attributes.image}\n />\n </div>\n </div>\n );\n })}\n </div>\n );\n }\n}\n"],"version":3}