lm-web-controls 1.2.65 → 1.2.67

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.
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- import{__awaiter as e,__generator as t,__spreadArray as n}from"../../_virtual/_tslib.js";import a,{useState as i,useRef as o,useEffect as r}from"react";import c from"moment";function l(l){var s=this,m=l.data,d=l.icon,u=l.title,g=l.nestedUrl,v=l.fetchMore,h=l.autoFetchCount,b=void 0===h?2:h,f=m.items,p=m.pagingInfo,E=i(""),N=E[0],w=E[1],y=i("grid"),I=y[0],M=y[1],O=i(f),P=O[0],C=O[1],k=i(p),x=k[0],Y=k[1],B=i(!1),S=B[0],j=B[1],A=i(0),D=A[0],L=A[1],T=o(null),G=i(!1),V=G[0],_=G[1];function z(){return e(this,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return!x.hasNextPage||S?[2]:(j(!0),[4,v(x.currentPage+1)]);case 1:return e=t.sent(),C((function(t){return n(n([],t,!0),e.items,!0)})),Y(e.pagingInfo),j(!1),L((function(e){return e+1})),[2]}}))}))}return r((function(){var a=navigator.userAgent;["Googlebot","Bingbot","Yahoo","DuckDuckBot","Baiduspider","YandexBot"].some((function(e){return a.includes(e)}))&&(_(!0),e(s,void 0,void 0,(function(){var e,a,i;return t(this,(function(t){switch(t.label){case 0:e=x.currentPage,a=n([],f,!0),t.label=1;case 1:return x.hasNextPage?[4,v(e+1)]:[3,3];case 2:return i=t.sent(),a=n(n([],a,!0),i.items,!0),e++,i.pagingInfo.hasNextPage?[3,1]:[3,3];case 3:return C(a),[2]}}))})))}),[]),r((function(){"undefined"!=typeof window&&w(window.location.origin)}),[]),r((function(){if(N){var e=P.map((function(e){var t,n;return{"@context":"https://schema.org","@type":"Article",headline:e.title,image:[e.featuredImage],author:{"@type":"Person",name:(null===(t=e.author)||void 0===t?void 0:t.name)||"Admin"},datePublished:c(e.publishedOn).toISOString(),dateModified:c(e.publishedOn).toISOString(),mainEntityOfPage:{"@type":"WebPage","@id":"".concat(N).concat(g?"/".concat(g):"","/post/").concat(e.slug)},publisher:{"@type":"Organization",name:(null===(n=e.author)||void 0===n?void 0:n.name)||"Admin"},description:e.previewContent}}));if(!V){var t=document.getElementById("blog-list-json-ld-schema");t&&document.head.removeChild(t);var n=document.createElement("script");return n.type="application/ld+json",n.id="blog-list-json-ld-schema",n.innerHTML=JSON.stringify(e),document.head.appendChild(n),function(){document.head.contains(n)&&document.head.removeChild(n)}}}}),[N,P,V]),r((function(){if(T.current&&!(D>=b)){var e=new IntersectionObserver((function(e){e[0].isIntersecting&&D<b&&!S&&z()}),{threshold:1});return e.observe(T.current),function(){return e.disconnect()}}}),[x,D,S,b]),a.createElement("section",{className:"blog-list-main-container"},a.createElement("div",{className:"blog-list-top-container"},u&&a.createElement("h2",{className:"blog-list-main-title"},u),a.createElement("div",{className:"blog-list-icons-container"},d.grid&&a.createElement("div",{className:"blog-list-icon ".concat("grid"===I?"active":""),onClick:function(){return M("grid")},title:"Grid View"},d.grid),d.list&&a.createElement("div",{className:"blog-list-icon ".concat("list"===I?"active":""),onClick:function(){return M("list")},title:"List View"},d.list))),a.createElement("div",{className:"".concat("grid"===I?"blogs-grid-view":"blogs-list-view")},P.map((function(e){var t,n,i;return a.createElement("div",{key:e.slug,className:"".concat("grid"===I?"blog-item-grid":"blog-item-list")},a.createElement("a",{href:"".concat(g?"/".concat(g):"","/post/").concat(e.slug)},a.createElement("img",{src:e.featuredImage,alt:e.title,className:"".concat("grid"===I?"blog-item-grid-image":"blog-item-list-image")})),a.createElement("div",{className:"blog-details"},a.createElement("a",{href:"".concat(g?"/".concat(g):"","/post/").concat(e.slug)},a.createElement("h3",{className:"blog-item-title"},e.title)),a.createElement("div",{className:"blog-item-avatar-main-container"},a.createElement("div",{className:"blog-item-avatar"},(null===(t=e.author)||void 0===t?void 0:t.name)?null===(n=e.author)||void 0===n?void 0:n.name[0]:""),a.createElement("div",{className:"blog-item-author-container"},a.createElement("h3",{className:"blog-item-author-name"},(null===(i=e.author)||void 0===i?void 0:i.name)||""),a.createElement("div",{className:"blog-item-date-read"},"On ".concat(c(e.publishedOn).format("ddd, MMM DD, YYYY"),", ").concat(e.readTime?"".concat(e.readTime," Min read"):"3 Min read")))),a.createElement("p",{className:"blog-item-preview-content"},e.previewContent),a.createElement("a",{className:"blog-item-read-more-container",href:"".concat(g?"/".concat(g):"","/post/").concat(e.slug)},a.createElement("p",null,"Read More"),d.link?d.link:null)))}))),x.hasNextPage&&D>=b&&a.createElement("div",{className:"blog-list-load-more-container"},a.createElement("button",{onClick:z,className:"blog-list-load-more-button"},S?"Loading...":"Load More")),D<b&&a.createElement("div",{ref:T,style:{height:"1px",visibility:"hidden"}}))}export{l as BlogList};
2
+ import{__awaiter as e,__generator as t,__spreadArray as n}from"../../_virtual/_tslib.js";import a,{useState as i,useRef as o,useEffect as c}from"react";import r from"moment";function l(l){var s=this,m=l.data,d=l.icon,u=l.title,g=l.nestedUrl,v=l.category,h=l.fetchMore,b=l.autoFetchCount,f=void 0===b?2:b,p=m.items,E=m.pagingInfo,N=i(""),y=N[0],w=N[1],I=i("grid"),M=I[0],O=I[1],P=i(p),C=P[0],k=P[1],x=i(E),Y=x[0],B=x[1],S=i(!1),j=S[0],A=S[1],D=i(0),L=D[0],T=D[1],G=o(null),V=i(!1),_=V[0],z=V[1];function F(){return e(this,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return!Y.hasNextPage||j?[2]:(A(!0),[4,h(Y.currentPage+1)]);case 1:return e=t.sent(),k((function(t){return n(n([],t,!0),e.items,!0)})),B(e.pagingInfo),A(!1),T((function(e){return e+1})),[2]}}))}))}return c((function(){var a=navigator.userAgent;["Googlebot","Bingbot","Yahoo","DuckDuckBot","Baiduspider","YandexBot"].some((function(e){return a.includes(e)}))&&(z(!0),e(s,void 0,void 0,(function(){var e,a,i;return t(this,(function(t){switch(t.label){case 0:e=Y.currentPage,a=n([],p,!0),t.label=1;case 1:return Y.hasNextPage?[4,h(e+1)]:[3,3];case 2:return i=t.sent(),a=n(n([],a,!0),i.items,!0),e++,i.pagingInfo.hasNextPage?[3,1]:[3,3];case 3:return k(a),[2]}}))})))}),[]),c((function(){"undefined"!=typeof window&&w(window.location.origin)}),[]),c((function(){if(y){var e=C.map((function(e){var t,n;return{"@context":"https://schema.org","@type":"Article",headline:e.title,image:[e.featuredImage],author:{"@type":"Person",name:(null===(t=e.author)||void 0===t?void 0:t.name)||"Admin"},datePublished:r(e.publishedOn).toISOString(),dateModified:r(e.publishedOn).toISOString(),mainEntityOfPage:{"@type":"WebPage","@id":"".concat(y).concat(g?"/".concat(g):"","/post").concat(v?"/".concat(e.category):"","/").concat(e.slug)},publisher:{"@type":"Organization",name:(null===(n=e.author)||void 0===n?void 0:n.name)||"Admin"},description:e.previewContent}}));if(!_){var t=document.getElementById("blog-list-json-ld-schema");t&&document.head.removeChild(t);var n=document.createElement("script");return n.type="application/ld+json",n.id="blog-list-json-ld-schema",n.innerHTML=JSON.stringify(e),document.head.appendChild(n),function(){document.head.contains(n)&&document.head.removeChild(n)}}}}),[y,C,_]),c((function(){if(G.current&&!(L>=f)){var e=new IntersectionObserver((function(e){e[0].isIntersecting&&L<f&&!j&&F()}),{threshold:1});return e.observe(G.current),function(){return e.disconnect()}}}),[Y,L,j,f]),a.createElement("section",{className:"blog-list-main-container"},a.createElement("div",{className:"blog-list-top-container"},u&&a.createElement("h2",{className:"blog-list-main-title"},u),a.createElement("div",{className:"blog-list-icons-container"},d.grid&&a.createElement("div",{className:"blog-list-icon ".concat("grid"===M?"active":""),onClick:function(){return O("grid")},title:"Grid View"},d.grid),d.list&&a.createElement("div",{className:"blog-list-icon ".concat("list"===M?"active":""),onClick:function(){return O("list")},title:"List View"},d.list))),a.createElement("div",{className:"".concat("grid"===M?"blogs-grid-view":"blogs-list-view")},C.map((function(e){var t,n,i;return a.createElement("div",{key:e.slug,className:"".concat("grid"===M?"blog-item-grid":"blog-item-list")},a.createElement("a",{href:"".concat(g?"/".concat(g):"","/post").concat(v?"/".concat(e.category):"","/").concat(e.slug)},a.createElement("img",{src:e.featuredImage,alt:e.title,className:"".concat("grid"===M?"blog-item-grid-image":"blog-item-list-image")})),a.createElement("div",{className:"blog-details"},a.createElement("a",{href:"".concat(g?"/".concat(g):"","/post").concat(v?"/".concat(e.category):"","/").concat(e.slug)},a.createElement("h3",{className:"blog-item-title"},e.title)),a.createElement("div",{className:"blog-item-avatar-main-container"},a.createElement("div",{className:"blog-item-avatar"},(null===(t=e.author)||void 0===t?void 0:t.name)?null===(n=e.author)||void 0===n?void 0:n.name[0]:""),a.createElement("div",{className:"blog-item-author-container"},a.createElement("h3",{className:"blog-item-author-name"},(null===(i=e.author)||void 0===i?void 0:i.name)||""),a.createElement("div",{className:"blog-item-date-read"},"On ".concat(r(e.publishedOn).format("ddd, MMM DD, YYYY"),", ").concat(e.readTime?"".concat(e.readTime," Min read"):"3 Min read")))),a.createElement("p",{className:"blog-item-preview-content"},e.previewContent),a.createElement("a",{className:"blog-item-read-more-container",href:"".concat(g?"/".concat(g):"","/post").concat(v?"/".concat(e.category):"","/").concat(e.slug)},a.createElement("p",null,"Read More"),d.link?d.link:null)))}))),Y.hasNextPage&&L>=f&&a.createElement("div",{className:"blog-list-load-more-container"},a.createElement("button",{onClick:F,className:"blog-list-load-more-button"},j?"Loading...":"Load More")),L<f&&a.createElement("div",{ref:G,style:{height:"1px",visibility:"hidden"}}))}export{l as BlogList};
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- import{useState as e,useEffect as n}from"react";import t from"moment";function o(o){var i=o.blogs,a=o.nestedUrl,d=e(""),r=d[0],c=d[1];return n((function(){"undefined"!=typeof window&&c(window.location.origin)}),[]),n((function(){if(r){var e=i.map((function(e){return function(e){var n,o;return{"@context":"https://schema.org","@type":"Article",headline:e.title,image:[e.featuredImage],author:{"@type":"Person",name:(null===(n=e.author)||void 0===n?void 0:n.name)||"Admin"},datePublished:t(e.publishedOn).toISOString(),dateModified:t(e.publishedOn).toISOString(),mainEntityOfPage:{"@type":"WebPage","@id":"".concat(r).concat(a?"/".concat(a):"","/post/").concat(e.slug)},publisher:{"@type":"Organization",name:(null===(o=e.author)||void 0===o?void 0:o.name)||"Admin"},description:e.previewContent}}(e)})),n=document.getElementById("blog-json-ld-schema");n&&document.head.removeChild(n);var o=document.createElement("script");return o.type="application/ld+json",o.id="blog-json-ld-schema",o.innerHTML=JSON.stringify(e),document.head.appendChild(o),function(){document.head.contains(o)&&document.head.removeChild(o)}}}),[r,i]),null}export{o as BlogListJsonLD};
2
+ import{useState as e,useEffect as n}from"react";import t from"moment";function o(o){var i=o.blogs,a=o.nestedUrl,d=o.category,r=e(""),c=r[0],m=r[1];return n((function(){"undefined"!=typeof window&&m(window.location.origin)}),[]),n((function(){if(c){var e=i.map((function(e){return function(e){var n,o;return{"@context":"https://schema.org","@type":"Article",headline:e.title,image:[e.featuredImage],author:{"@type":"Person",name:(null===(n=e.author)||void 0===n?void 0:n.name)||"Admin"},datePublished:t(e.publishedOn).toISOString(),dateModified:t(e.publishedOn).toISOString(),mainEntityOfPage:{"@type":"WebPage","@id":"".concat(c).concat(a?"/".concat(a):"","/post").concat(d?"/".concat(e.category):"","/").concat(e.slug)},publisher:{"@type":"Organization",name:(null===(o=e.author)||void 0===o?void 0:o.name)||"Admin"},description:e.previewContent}}(e)})),n=document.getElementById("blog-json-ld-schema");n&&document.head.removeChild(n);var o=document.createElement("script");return o.type="application/ld+json",o.id="blog-json-ld-schema",o.innerHTML=JSON.stringify(e),document.head.appendChild(o),function(){document.head.contains(o)&&document.head.removeChild(o)}}}),[c,i]),null}export{o as BlogListJsonLD};
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- import e from"react";import a from"moment";function t(t){var n,r,l,c,o=t.featured,m=t.icon,d=t.nestedUrl;return e.createElement("section",{className:"featured-blog-main-container"},e.createElement("div",{className:"featured-blog-image-container"},e.createElement("img",{src:o.featuredImage,alt:o.title,className:"featured-blog-image"}),e.createElement("span",{className:"post-category"},(null===(n=null==o?void 0:o.categoryInfo)||void 0===n?void 0:n.name)||"General")),e.createElement("div",{className:"featured-blog-data-container"},e.createElement("a",{href:"".concat(d?"/".concat(d):"","/post/").concat(o.slug),className:"featured-blog-title-link"},e.createElement("h2",{className:"featured-blog-title"},o.title)),e.createElement("div",{className:"featured-blog-avatar-main-container"},e.createElement("div",{className:"featured-blog-avatar"},(null===(r=o.author)||void 0===r?void 0:r.name)?null===(l=o.author)||void 0===l?void 0:l.name[0]:""),e.createElement("div",{className:"featured-blog-author-container"},e.createElement("h3",{className:"featured-blog-author-name"},(null===(c=o.author)||void 0===c?void 0:c.name)||""),e.createElement("div",{className:"featured-blog-date-read"},"On ".concat(a(o.publishedOn).format("ddd, MMM DD, YYYY"),", ").concat(o.readTime?"".concat(o.readTime," Min read"):"3 Min read")))),e.createElement("p",{className:"featured-blog-preview-content"},o.previewContent),e.createElement("a",{className:"read-more-container",href:"".concat(d?"/".concat(d):"","/post/").concat(o.slug)},e.createElement("p",null,"Read More"),m||null)))}export{t as FeaturedBlog};
2
+ import e from"react";import a from"moment";function t(t){var n,c,r,o,l=t.featured,m=t.icon,d=t.nestedUrl,i=t.category;return e.createElement("section",{className:"featured-blog-main-container"},e.createElement("div",{className:"featured-blog-image-container"},e.createElement("img",{src:l.featuredImage,alt:l.title,className:"featured-blog-image"}),e.createElement("span",{className:"post-category"},(null===(n=null==l?void 0:l.categoryInfo)||void 0===n?void 0:n.name)||"General")),e.createElement("div",{className:"featured-blog-data-container"},e.createElement("a",{href:"".concat(d?"/".concat(d):"","/post").concat(i?"/".concat(l.category):"","/").concat(l.slug),className:"featured-blog-title-link"},e.createElement("h2",{className:"featured-blog-title"},l.title)),e.createElement("div",{className:"featured-blog-avatar-main-container"},e.createElement("div",{className:"featured-blog-avatar"},(null===(c=l.author)||void 0===c?void 0:c.name)?null===(r=l.author)||void 0===r?void 0:r.name[0]:""),e.createElement("div",{className:"featured-blog-author-container"},e.createElement("h3",{className:"featured-blog-author-name"},(null===(o=l.author)||void 0===o?void 0:o.name)||""),e.createElement("div",{className:"featured-blog-date-read"},"On ".concat(a(l.publishedOn).format("ddd, MMM DD, YYYY"),", ").concat(l.readTime?"".concat(l.readTime," Min read"):"3 Min read")))),e.createElement("p",{className:"featured-blog-preview-content"},l.previewContent),e.createElement("a",{className:"read-more-container",href:"".concat(d?"/".concat(d):"","/post").concat(i?"/".concat(l.category):"","/").concat(l.slug)},e.createElement("p",null,"Read More"),m||null)))}export{t as FeaturedBlog};
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- import e from"react";function t(t){var a=t.relatedPosts,l=t.title,s=t.nestedUrl;return a.length?e.createElement("div",{className:"related-posts-main-container"},e.createElement("h2",{className:"related-posts-title"},l||"Related Posts"),e.createElement("div",{className:"related-posts"},a.map((function(t,a){return e.createElement("a",{key:a,className:"related-post-item",href:"".concat(s?"/".concat(s):"","/post/").concat(t.slug)},e.createElement("img",{src:t.featuredImage,alt:t.title,className:"related-post-item-image"}),e.createElement("h3",{className:"related-post-item-title"},t.title))})))):null}export{t as RelatedPosts};
2
+ import e from"react";function t(t){var a=t.relatedPosts,l=t.title,c=t.nestedUrl,r=t.category;return a.length?e.createElement("div",{className:"related-posts-main-container"},e.createElement("h2",{className:"related-posts-title"},l||"Related Posts"),e.createElement("div",{className:"related-posts"},a.map((function(t,a){return e.createElement("a",{key:a,className:"related-post-item",href:"".concat(c?"/".concat(c):"","/post").concat(r?"/".concat(t.category):"","/").concat(t.slug)},e.createElement("img",{src:t.featuredImage,alt:t.title,className:"related-post-item-image"}),e.createElement("h3",{className:"related-post-item-title"},t.title))})))):null}export{t as RelatedPosts};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lm-web-controls",
3
- "version": "1.2.65",
3
+ "version": "1.2.67",
4
4
  "description": "leadmetrics-lm-web-controls",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.es.js",
@@ -116,6 +116,7 @@ declare module "lm-web-controls" {
116
116
  type BlogListJsonLDSchemaProps = {
117
117
  blogs: PostModel[];
118
118
  nestedUrl?: string;
119
+ category?: string;
119
120
  };
120
121
 
121
122
  type PostJsonLDSchemaProps = {
@@ -131,12 +132,14 @@ declare module "lm-web-controls" {
131
132
  featured: PostModel;
132
133
  icon: ReactNode;
133
134
  nestedUrl?: string;
135
+ category?: string;
134
136
  };
135
137
 
136
138
  type RelatedPostProps = {
137
139
  relatedPosts: PostModel[];
138
140
  title?: string;
139
141
  nestedUrl?: string;
142
+ category?: string;
140
143
  };
141
144
 
142
145
  type FAQItem = {
@@ -201,6 +204,7 @@ declare module "lm-web-controls" {
201
204
  };
202
205
  title?: string;
203
206
  nestedUrl?: string;
207
+ category?: string;
204
208
  fetchMore: (currentPage: number) => Promise<SearchResult<PostModel>>;
205
209
  autoFetchCount?: number;
206
210
  };