@everymatrix/blog-article-details
Advanced tools
Comparing version 1.16.1 to 1.17.0
@@ -1,1 +0,1 @@ | ||
import{p as e,b as t}from"./p-68e0210a.js";(()=>{const t=import.meta.url,s={};return""!==t&&(s.resourcesUrl=new URL(".",t).href),e(s)})().then((e=>t([["p-f2e32398",[[1,"blog-article-details",{cmsEndpoint:[513,"cms-endpoint"],language:[513],userRoles:[513,"user-roles"],cmsEnv:[513,"cms-env"],clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],showPublishingDate:[516,"show-publishing-date"],showImage:[516,"show-image"],showTitle:[516,"show-title"],showContent:[516,"show-content"],postMessageEvent:[513,"post-message-event"],postId:[514,"post-id"],postSlug:[513,"post-slug"],intlDateTimeFormat:[1,"intl-date-time-format"],hasErrors:[32],limitStylingAppends:[32],isLoading:[32],bannerMatrixReady:[32],device:[32]},[[8,"BannerMatrixReady","handleBannerReady"]]]]]],e))); | ||
import{p as t,b as e}from"./p-68e0210a.js";(()=>{const e=import.meta.url,s={};return""!==e&&(s.resourcesUrl=new URL(".",e).href),t(s)})().then((t=>e([["p-82230cc2",[[1,"blog-article-details",{cmsEndpoint:[513,"cms-endpoint"],language:[513],userRoles:[513,"user-roles"],cmsEnv:[513,"cms-env"],clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],showPublishingDate:[516,"show-publishing-date"],showImage:[516,"show-image"],showTitle:[516,"show-title"],showContent:[516,"show-content"],postMessageEvent:[513,"post-message-event"],postId:[514,"post-id"],postSlug:[513,"post-slug"],postCustomPath:[513,"post-custom-path"],intlDateTimeFormat:[1,"intl-date-time-format"],hasErrors:[32],limitStylingAppends:[32],isLoading:[32],bannerMatrixReady:[32],device:[32]},[[8,"BannerMatrixReady","handleBannerReady"]]]]]],t))); |
@@ -184,11 +184,14 @@ 'use strict'; | ||
getBlogArticleDetails() { | ||
if (!this.postId && !this.postSlug) { | ||
if (!this.postId && !this.postSlug && !this.postCustomPath) { | ||
this.hasErrors = true; | ||
throw new Error('postId or postSlug parameter has to be provided!'); | ||
throw new Error('postId, postSlug or postCustomPath parameter has to be provided!'); | ||
} | ||
this.isLoading = true; | ||
let url = new URL(`${this.cmsEndpoint}/${this.language}/blog-posts/${this.postSlug || this.postId}`); | ||
let url = new URL(`${this.cmsEndpoint}/${this.language}/blog-posts/${this.postCustomPath ? '' : this.postSlug || this.postId}`); | ||
url.searchParams.append('env', this.cmsEnv); | ||
url.searchParams.append('userRoles', this.userRoles); | ||
url.searchParams.append('device', getDevicePlatform()); | ||
if (this.postCustomPath) { | ||
url.searchParams.append('customURL', this.postCustomPath); | ||
} | ||
fetch(url.href) | ||
@@ -203,3 +206,20 @@ .then((res) => { | ||
.then((blogContent) => { | ||
this.blogData = blogContent; | ||
if (blogContent.count > 1 && this.postCustomPath) { | ||
let difference = new Date(blogContent.items[0].publishingDate); | ||
let indexOfLatestPublished; | ||
for (let i = 1; i < blogContent.items.length; i++) { | ||
const givenDate = new Date(blogContent.items[i].publishingDate); | ||
if (difference < givenDate) { | ||
difference = givenDate; | ||
indexOfLatestPublished = i; | ||
} | ||
} | ||
this.blogData = blogContent.items[indexOfLatestPublished]; | ||
} | ||
else if (this.postCustomPath) { | ||
this.blogData = blogContent.items[0]; | ||
} | ||
else { | ||
this.blogData = blogContent; | ||
} | ||
this.isLoading = false; | ||
@@ -206,0 +226,0 @@ }) |
@@ -18,3 +18,3 @@ 'use strict'; | ||
patchBrowser().then(options => { | ||
return index.bootstrapLazy([["blog-article-details.cjs",[[1,"blog-article-details",{"cmsEndpoint":[513,"cms-endpoint"],"language":[513],"userRoles":[513,"user-roles"],"cmsEnv":[513,"cms-env"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"showPublishingDate":[516,"show-publishing-date"],"showImage":[516,"show-image"],"showTitle":[516,"show-title"],"showContent":[516,"show-content"],"postMessageEvent":[513,"post-message-event"],"postId":[514,"post-id"],"postSlug":[513,"post-slug"],"intlDateTimeFormat":[1,"intl-date-time-format"],"hasErrors":[32],"limitStylingAppends":[32],"isLoading":[32],"bannerMatrixReady":[32],"device":[32]},[[8,"BannerMatrixReady","handleBannerReady"]]]]]], options); | ||
return index.bootstrapLazy([["blog-article-details.cjs",[[1,"blog-article-details",{"cmsEndpoint":[513,"cms-endpoint"],"language":[513],"userRoles":[513,"user-roles"],"cmsEnv":[513,"cms-env"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"showPublishingDate":[516,"show-publishing-date"],"showImage":[516,"show-image"],"showTitle":[516,"show-title"],"showContent":[516,"show-content"],"postMessageEvent":[513,"post-message-event"],"postId":[514,"post-id"],"postSlug":[513,"post-slug"],"postCustomPath":[513,"post-custom-path"],"intlDateTimeFormat":[1,"intl-date-time-format"],"hasErrors":[32],"limitStylingAppends":[32],"isLoading":[32],"bannerMatrixReady":[32],"device":[32]},[[8,"BannerMatrixReady","handleBannerReady"]]]]]], options); | ||
}); |
@@ -17,3 +17,3 @@ 'use strict'; | ||
return patchEsm().then(() => { | ||
return index.bootstrapLazy([["blog-article-details.cjs",[[1,"blog-article-details",{"cmsEndpoint":[513,"cms-endpoint"],"language":[513],"userRoles":[513,"user-roles"],"cmsEnv":[513,"cms-env"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"showPublishingDate":[516,"show-publishing-date"],"showImage":[516,"show-image"],"showTitle":[516,"show-title"],"showContent":[516,"show-content"],"postMessageEvent":[513,"post-message-event"],"postId":[514,"post-id"],"postSlug":[513,"post-slug"],"intlDateTimeFormat":[1,"intl-date-time-format"],"hasErrors":[32],"limitStylingAppends":[32],"isLoading":[32],"bannerMatrixReady":[32],"device":[32]},[[8,"BannerMatrixReady","handleBannerReady"]]]]]], options); | ||
return index.bootstrapLazy([["blog-article-details.cjs",[[1,"blog-article-details",{"cmsEndpoint":[513,"cms-endpoint"],"language":[513],"userRoles":[513,"user-roles"],"cmsEnv":[513,"cms-env"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"showPublishingDate":[516,"show-publishing-date"],"showImage":[516,"show-image"],"showTitle":[516,"show-title"],"showContent":[516,"show-content"],"postMessageEvent":[513,"post-message-event"],"postId":[514,"post-id"],"postSlug":[513,"post-slug"],"postCustomPath":[513,"post-custom-path"],"intlDateTimeFormat":[1,"intl-date-time-format"],"hasErrors":[32],"limitStylingAppends":[32],"isLoading":[32],"bannerMatrixReady":[32],"device":[32]},[[8,"BannerMatrixReady","handleBannerReady"]]]]]], options); | ||
}); | ||
@@ -20,0 +20,0 @@ }; |
@@ -114,11 +114,14 @@ import { Component, Prop, State, Watch, h, Listen } from '@stencil/core'; | ||
getBlogArticleDetails() { | ||
if (!this.postId && !this.postSlug) { | ||
if (!this.postId && !this.postSlug && !this.postCustomPath) { | ||
this.hasErrors = true; | ||
throw new Error('postId or postSlug parameter has to be provided!'); | ||
throw new Error('postId, postSlug or postCustomPath parameter has to be provided!'); | ||
} | ||
this.isLoading = true; | ||
let url = new URL(`${this.cmsEndpoint}/${this.language}/blog-posts/${this.postSlug || this.postId}`); | ||
let url = new URL(`${this.cmsEndpoint}/${this.language}/blog-posts/${this.postCustomPath ? '' : this.postSlug || this.postId}`); | ||
url.searchParams.append('env', this.cmsEnv); | ||
url.searchParams.append('userRoles', this.userRoles); | ||
url.searchParams.append('device', getDevicePlatform()); | ||
if (this.postCustomPath) { | ||
url.searchParams.append('customURL', this.postCustomPath); | ||
} | ||
fetch(url.href) | ||
@@ -133,3 +136,21 @@ .then((res) => { | ||
.then((blogContent) => { | ||
this.blogData = blogContent; | ||
if (blogContent.count > 1 && this.postCustomPath) { | ||
let difference = new Date(blogContent.items[0].publishingDate); | ||
let indexOfLatestPublished; | ||
for (let i = 1; i < blogContent.items.length; i++) { | ||
const givenDate = new Date(blogContent.items[i].publishingDate); | ||
if (difference < givenDate) { | ||
difference = givenDate; | ||
indexOfLatestPublished = i; | ||
} | ||
} | ||
this.blogData = blogContent.items[indexOfLatestPublished]; | ||
} | ||
else if (this.postCustomPath) { | ||
this.blogData = blogContent.items[0]; | ||
} | ||
else { | ||
this.blogData = blogContent; | ||
} | ||
; | ||
this.isLoading = false; | ||
@@ -420,2 +441,19 @@ }) | ||
}, | ||
"postCustomPath": { | ||
"type": "string", | ||
"mutable": false, | ||
"complexType": { | ||
"original": "string", | ||
"resolved": "string", | ||
"references": {} | ||
}, | ||
"required": false, | ||
"optional": false, | ||
"docs": { | ||
"tags": [], | ||
"text": "Custom Path of post" | ||
}, | ||
"attribute": "post-custom-path", | ||
"reflect": true | ||
}, | ||
"intlDateTimeFormat": { | ||
@@ -422,0 +460,0 @@ "type": "string", |
@@ -182,11 +182,14 @@ import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client'; | ||
getBlogArticleDetails() { | ||
if (!this.postId && !this.postSlug) { | ||
if (!this.postId && !this.postSlug && !this.postCustomPath) { | ||
this.hasErrors = true; | ||
throw new Error('postId or postSlug parameter has to be provided!'); | ||
throw new Error('postId, postSlug or postCustomPath parameter has to be provided!'); | ||
} | ||
this.isLoading = true; | ||
let url = new URL(`${this.cmsEndpoint}/${this.language}/blog-posts/${this.postSlug || this.postId}`); | ||
let url = new URL(`${this.cmsEndpoint}/${this.language}/blog-posts/${this.postCustomPath ? '' : this.postSlug || this.postId}`); | ||
url.searchParams.append('env', this.cmsEnv); | ||
url.searchParams.append('userRoles', this.userRoles); | ||
url.searchParams.append('device', getDevicePlatform()); | ||
if (this.postCustomPath) { | ||
url.searchParams.append('customURL', this.postCustomPath); | ||
} | ||
fetch(url.href) | ||
@@ -201,3 +204,20 @@ .then((res) => { | ||
.then((blogContent) => { | ||
this.blogData = blogContent; | ||
if (blogContent.count > 1 && this.postCustomPath) { | ||
let difference = new Date(blogContent.items[0].publishingDate); | ||
let indexOfLatestPublished; | ||
for (let i = 1; i < blogContent.items.length; i++) { | ||
const givenDate = new Date(blogContent.items[i].publishingDate); | ||
if (difference < givenDate) { | ||
difference = givenDate; | ||
indexOfLatestPublished = i; | ||
} | ||
} | ||
this.blogData = blogContent.items[indexOfLatestPublished]; | ||
} | ||
else if (this.postCustomPath) { | ||
this.blogData = blogContent.items[0]; | ||
} | ||
else { | ||
this.blogData = blogContent; | ||
} | ||
this.isLoading = false; | ||
@@ -261,2 +281,3 @@ }) | ||
"postSlug": [513, "post-slug"], | ||
"postCustomPath": [513, "post-custom-path"], | ||
"intlDateTimeFormat": [1, "intl-date-time-format"], | ||
@@ -263,0 +284,0 @@ "hasErrors": [32], |
@@ -180,11 +180,14 @@ import { r as registerInstance, h } from './index-a6d43dfd.js'; | ||
getBlogArticleDetails() { | ||
if (!this.postId && !this.postSlug) { | ||
if (!this.postId && !this.postSlug && !this.postCustomPath) { | ||
this.hasErrors = true; | ||
throw new Error('postId or postSlug parameter has to be provided!'); | ||
throw new Error('postId, postSlug or postCustomPath parameter has to be provided!'); | ||
} | ||
this.isLoading = true; | ||
let url = new URL(`${this.cmsEndpoint}/${this.language}/blog-posts/${this.postSlug || this.postId}`); | ||
let url = new URL(`${this.cmsEndpoint}/${this.language}/blog-posts/${this.postCustomPath ? '' : this.postSlug || this.postId}`); | ||
url.searchParams.append('env', this.cmsEnv); | ||
url.searchParams.append('userRoles', this.userRoles); | ||
url.searchParams.append('device', getDevicePlatform()); | ||
if (this.postCustomPath) { | ||
url.searchParams.append('customURL', this.postCustomPath); | ||
} | ||
fetch(url.href) | ||
@@ -199,3 +202,20 @@ .then((res) => { | ||
.then((blogContent) => { | ||
this.blogData = blogContent; | ||
if (blogContent.count > 1 && this.postCustomPath) { | ||
let difference = new Date(blogContent.items[0].publishingDate); | ||
let indexOfLatestPublished; | ||
for (let i = 1; i < blogContent.items.length; i++) { | ||
const givenDate = new Date(blogContent.items[i].publishingDate); | ||
if (difference < givenDate) { | ||
difference = givenDate; | ||
indexOfLatestPublished = i; | ||
} | ||
} | ||
this.blogData = blogContent.items[indexOfLatestPublished]; | ||
} | ||
else if (this.postCustomPath) { | ||
this.blogData = blogContent.items[0]; | ||
} | ||
else { | ||
this.blogData = blogContent; | ||
} | ||
this.isLoading = false; | ||
@@ -202,0 +222,0 @@ }) |
@@ -16,3 +16,3 @@ import { p as promiseResolve, b as bootstrapLazy } from './index-a6d43dfd.js'; | ||
patchBrowser().then(options => { | ||
return bootstrapLazy([["blog-article-details",[[1,"blog-article-details",{"cmsEndpoint":[513,"cms-endpoint"],"language":[513],"userRoles":[513,"user-roles"],"cmsEnv":[513,"cms-env"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"showPublishingDate":[516,"show-publishing-date"],"showImage":[516,"show-image"],"showTitle":[516,"show-title"],"showContent":[516,"show-content"],"postMessageEvent":[513,"post-message-event"],"postId":[514,"post-id"],"postSlug":[513,"post-slug"],"intlDateTimeFormat":[1,"intl-date-time-format"],"hasErrors":[32],"limitStylingAppends":[32],"isLoading":[32],"bannerMatrixReady":[32],"device":[32]},[[8,"BannerMatrixReady","handleBannerReady"]]]]]], options); | ||
return bootstrapLazy([["blog-article-details",[[1,"blog-article-details",{"cmsEndpoint":[513,"cms-endpoint"],"language":[513],"userRoles":[513,"user-roles"],"cmsEnv":[513,"cms-env"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"showPublishingDate":[516,"show-publishing-date"],"showImage":[516,"show-image"],"showTitle":[516,"show-title"],"showContent":[516,"show-content"],"postMessageEvent":[513,"post-message-event"],"postId":[514,"post-id"],"postSlug":[513,"post-slug"],"postCustomPath":[513,"post-custom-path"],"intlDateTimeFormat":[1,"intl-date-time-format"],"hasErrors":[32],"limitStylingAppends":[32],"isLoading":[32],"bannerMatrixReady":[32],"device":[32]},[[8,"BannerMatrixReady","handleBannerReady"]]]]]], options); | ||
}); |
@@ -13,3 +13,3 @@ import { p as promiseResolve, b as bootstrapLazy } from './index-a6d43dfd.js'; | ||
return patchEsm().then(() => { | ||
return bootstrapLazy([["blog-article-details",[[1,"blog-article-details",{"cmsEndpoint":[513,"cms-endpoint"],"language":[513],"userRoles":[513,"user-roles"],"cmsEnv":[513,"cms-env"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"showPublishingDate":[516,"show-publishing-date"],"showImage":[516,"show-image"],"showTitle":[516,"show-title"],"showContent":[516,"show-content"],"postMessageEvent":[513,"post-message-event"],"postId":[514,"post-id"],"postSlug":[513,"post-slug"],"intlDateTimeFormat":[1,"intl-date-time-format"],"hasErrors":[32],"limitStylingAppends":[32],"isLoading":[32],"bannerMatrixReady":[32],"device":[32]},[[8,"BannerMatrixReady","handleBannerReady"]]]]]], options); | ||
return bootstrapLazy([["blog-article-details",[[1,"blog-article-details",{"cmsEndpoint":[513,"cms-endpoint"],"language":[513],"userRoles":[513,"user-roles"],"cmsEnv":[513,"cms-env"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"showPublishingDate":[516,"show-publishing-date"],"showImage":[516,"show-image"],"showTitle":[516,"show-title"],"showContent":[516,"show-content"],"postMessageEvent":[513,"post-message-event"],"postId":[514,"post-id"],"postSlug":[513,"post-slug"],"postCustomPath":[513,"post-custom-path"],"intlDateTimeFormat":[1,"intl-date-time-format"],"hasErrors":[32],"limitStylingAppends":[32],"isLoading":[32],"bannerMatrixReady":[32],"device":[32]},[[8,"BannerMatrixReady","handleBannerReady"]]]]]], options); | ||
}); | ||
@@ -16,0 +16,0 @@ }; |
@@ -35,2 +35,6 @@ /* eslint-disable */ | ||
/** | ||
* Custom Path of post | ||
*/ | ||
"postCustomPath": string; | ||
/** | ||
* Showing post ID parameter | ||
@@ -107,2 +111,6 @@ */ | ||
/** | ||
* Custom Path of post | ||
*/ | ||
"postCustomPath"?: string; | ||
/** | ||
* Showing post ID parameter | ||
@@ -109,0 +117,0 @@ */ |
@@ -55,2 +55,6 @@ export declare class BlogArticleDetails { | ||
/** | ||
* Custom Path of post | ||
*/ | ||
postCustomPath: string; | ||
/** | ||
* Intl date format | ||
@@ -57,0 +61,0 @@ */ |
{ | ||
"name": "@everymatrix/blog-article-details", | ||
"version": "1.16.1", | ||
"version": "1.17.0", | ||
"main": "./dist/index.cjs.js", | ||
@@ -5,0 +5,0 @@ "module": "./dist/index.js", |
364202
6449