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
|
|
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
|
|
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
|
|
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,
|
|
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
|
@@ -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
|
};
|