lm-web-controls 1.2.42 → 1.2.44

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 e,{useState as t,useEffect as a}from"react";import i from"moment";function n(n){var l=n.blogs,o=n.icon,c=n.title,r=n.nestedUrl,m=t(""),s=m[0],d=m[1],g=t("grid"),u=g[0],v=g[1],p=function(e){v(e)};a((function(){"undefined"!=typeof window&&d(window.location.origin)}),[]);var b=l.map((function(e){return function(e){var t,a;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:i(e.publishedOn).toISOString(),dateModified:i(e.publishedOn).toISOString(),mainEntityOfPage:{"@type":"WebPage","@id":"".concat(s).concat(r?"/".concat(r):"","/post/").concat(e.slug)},publisher:{"@type":"Organization",name:(null===(a=e.author)||void 0===a?void 0:a.name)||"Admin"},description:e.previewContent}}(e)}));return e.createElement("section",{className:"blog-list-main-container"},e.createElement("div",{className:"blog-list-top-container"},c&&e.createElement("h2",{className:"blog-list-main-title"},c),e.createElement("div",{className:"blog-list-icons-container"},o.grid&&e.createElement("div",{className:"blog-list-icon ".concat("grid"===u?"active":""),onClick:function(){return p("grid")},title:"Grid View"},o.grid),o.list&&e.createElement("div",{className:"blog-list-icon ".concat("list"===u?"active":""),onClick:function(){return p("list")},title:"List View"},o.list))),e.createElement("div",{className:"".concat("grid"===u?"blogs-grid-view":"blogs-list-view")},l.map((function(t){var a,n,l;return e.createElement("div",{key:t.slug,className:"".concat("grid"===u?"blog-item-grid":"blog-item-list")},e.createElement("a",{href:"".concat(r?"/".concat(r):"","/post/").concat(t.slug)},e.createElement("img",{src:t.featuredImage,alt:t.title,className:"".concat("grid"===u?"blog-item-grid-image":"blog-item-list-image")})),e.createElement("div",{className:"blog-details"},e.createElement("a",{href:"".concat(r?"/".concat(r):"","/post/").concat(t.slug)},e.createElement("h3",{className:"blog-item-title"},t.title)),e.createElement("div",{className:"blog-item-avatar-main-container"},e.createElement("div",{className:"blog-item-avatar"},(null===(a=t.author)||void 0===a?void 0:a.name)?null===(n=t.author)||void 0===n?void 0:n.name[0]:""),e.createElement("div",{className:"blog-item-author-container"},e.createElement("h3",{className:"blog-item-author-name"},(null===(l=t.author)||void 0===l?void 0:l.name)||""),e.createElement("div",{className:"blog-item-date-read"},"On ".concat(i(t.publishedOn).format("ddd, MMM DD, YYYY"),", ").concat(t.readTime?"".concat(t.readTime," Min read"):"3 Min read")))),e.createElement("p",{className:"blog-item-preview-content"},t.previewContent),e.createElement("a",{className:"blog-item-read-more-container",href:"".concat(r?"/".concat(r):"","/post/").concat(t.slug)},e.createElement("p",null,"Read More"),o.link?o.link:null)))}))),s&&e.createElement("script",{type:"application/ld+json",dangerouslySetInnerHTML:{__html:JSON.stringify(b)}}))}export{n as BlogList};
2
+ import e,{useState as t,useEffect as a}from"react";import n from"moment";function i(i){var o=i.blogs,l=i.icon,c=i.title,r=i.nestedUrl,m=t(""),d=m[0],s=m[1],g=t("grid"),u=g[0],v=g[1];return a((function(){"undefined"!=typeof window&&s(window.location.origin)}),[]),a((function(){if(d){var e=o.map((function(e){return function(e){var t,a;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:n(e.publishedOn).toISOString(),dateModified:n(e.publishedOn).toISOString(),mainEntityOfPage:{"@type":"WebPage","@id":"".concat(d).concat(r?"/".concat(r):"","/post/").concat(e.slug)},publisher:{"@type":"Organization",name:(null===(a=e.author)||void 0===a?void 0:a.name)||"Admin"},description:e.previewContent}}(e)})),t=document.getElementById("blog-json-ld-schema");t&&document.head.removeChild(t);var a=document.createElement("script");return a.type="application/ld+json",a.id="blog-json-ld-schema",a.innerHTML=JSON.stringify(e),document.head.appendChild(a),function(){document.head.contains(a)&&document.head.removeChild(a)}}}),[d,o]),e.createElement("section",{className:"blog-list-main-container"},e.createElement("div",{className:"blog-list-top-container"},c&&e.createElement("h2",{className:"blog-list-main-title"},c),e.createElement("div",{className:"blog-list-icons-container"},l.grid&&e.createElement("div",{className:"blog-list-icon ".concat("grid"===u?"active":""),onClick:function(){return v("grid")},title:"Grid View"},l.grid),l.list&&e.createElement("div",{className:"blog-list-icon ".concat("list"===u?"active":""),onClick:function(){return v("list")},title:"List View"},l.list))),e.createElement("div",{className:"".concat("grid"===u?"blogs-grid-view":"blogs-list-view")},o.map((function(t){var a,i,o;return e.createElement("div",{key:t.slug,className:"".concat("grid"===u?"blog-item-grid":"blog-item-list")},e.createElement("a",{href:"".concat(r?"/".concat(r):"","/post/").concat(t.slug)},e.createElement("img",{src:t.featuredImage,alt:t.title,className:"".concat("grid"===u?"blog-item-grid-image":"blog-item-list-image")})),e.createElement("div",{className:"blog-details"},e.createElement("a",{href:"".concat(r?"/".concat(r):"","/post/").concat(t.slug)},e.createElement("h3",{className:"blog-item-title"},t.title)),e.createElement("div",{className:"blog-item-avatar-main-container"},e.createElement("div",{className:"blog-item-avatar"},(null===(a=t.author)||void 0===a?void 0:a.name)?null===(i=t.author)||void 0===i?void 0:i.name[0]:""),e.createElement("div",{className:"blog-item-author-container"},e.createElement("h3",{className:"blog-item-author-name"},(null===(o=t.author)||void 0===o?void 0:o.name)||""),e.createElement("div",{className:"blog-item-date-read"},"On ".concat(n(t.publishedOn).format("ddd, MMM DD, YYYY"),", ").concat(t.readTime?"".concat(t.readTime," Min read"):"3 Min read")))),e.createElement("p",{className:"blog-item-preview-content"},t.previewContent),e.createElement("a",{className:"blog-item-read-more-container",href:"".concat(r?"/".concat(r):"","/post/").concat(t.slug)},e.createElement("p",null,"Read More"),l.link?l.link:null)))}))))}export{i as BlogList};
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- import e,{useState as t}from"react";var n=function(n){var a=n.question,r=n.answer,c=n.icon,i=t(!1),s=i[0],o=i[1];return e.createElement("div",{className:"faq-item",onClick:function(){return o(!s)}},e.createElement("div",{className:"faq-question-container"},e.createElement("h3",{className:"faq-question"},a),e.createElement("img",{src:c,alt:"Toggle icon",className:"faq-icon ".concat(s?"rotate":"")})),e.createElement("div",{className:"faq-answer ".concat(s?"open":"closed")},e.createElement("p",null,r)))};function a(t){var a=t.faq,r=t.title,c=void 0===r?"Frequently Asked Questions":r,i=t.icon,s=void 0===i?"../../images/accordion.png":i,o=t.addSchema,l=void 0===o||o,m=Array.isArray(a)?a:a.items;if(!m.length)return null;var u={"@context":"https://schema.org","@type":"FAQPage",mainEntity:m.map((function(e){return{"@type":"Question",name:e.question,acceptedAnswer:{"@type":"Answer",text:e.answer}}}))};return e.createElement(e.Fragment,null,e.createElement("div",{className:"faq-main-container"},e.createElement("h2",{className:"faq-title"},c),e.createElement("div",{className:"faq-inner-container"},m.map((function(t,a){return t.question?e.createElement(n,{key:a,question:t.question,answer:t.answer,icon:s}):null})))),l&&e.createElement("script",{type:"application/ld+json",dangerouslySetInnerHTML:{__html:JSON.stringify(u)},id:"faq-schema"}))}export{a as Faq};
2
+ import e,{useEffect as n,useState as t}from"react";var a=function(n){var a=n.question,r=n.answer,c=n.icon,i=t(!1),o=i[0],s=i[1];return e.createElement("div",{className:"faq-item",onClick:function(){return s(!o)}},e.createElement("div",{className:"faq-question-container"},e.createElement("h3",{className:"faq-question"},a),e.createElement("img",{src:c,alt:"Toggle icon",className:"faq-icon ".concat(o?"rotate":"")})),e.createElement("div",{className:"faq-answer ".concat(o?"open":"closed")},e.createElement("p",null,r)))};function r(t){var r=t.faq,c=t.title,i=void 0===c?"Frequently Asked Questions":c,o=t.icon,s=void 0===o?"../../images/accordion.png":o,m=t.addSchema,l=void 0===m||m,u=Array.isArray(r)?r:r.items;if(!u.length)return null;var d={"@context":"https://schema.org","@type":"FAQPage",mainEntity:u.map((function(e){return{"@type":"Question",name:e.question,acceptedAnswer:{"@type":"Answer",text:e.answer}}}))};return n((function(){if(l){var e=document.getElementById("faq-json-ld-schema");e&&document.head.removeChild(e);var n=document.createElement("script");return n.type="application/ld+json",n.id="faq-json-ld-schema",n.innerHTML=JSON.stringify(d),document.head.appendChild(n),function(){document.head.contains(n)&&document.head.removeChild(n)}}}),[r,l]),e.createElement(e.Fragment,null,e.createElement("div",{className:"faq-main-container"},e.createElement("h2",{className:"faq-title"},i),e.createElement("div",{className:"faq-inner-container"},u.map((function(n,t){return n.question?e.createElement(a,{key:t,question:n.question,answer:n.answer,icon:s}):null})))))}export{r as Faq};
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- import t from"react";function e(e){var n=e.faq,r=Array.isArray(n)?n:n.items;if(!r.length)return null;var a={"@context":"https://schema.org","@type":"FAQPage",mainEntity:r.map((function(t){return{"@type":"Question",name:t.question,acceptedAnswer:{"@type":"Answer",text:t.answer}}}))};return t.createElement("script",{type:"application/ld+json",dangerouslySetInnerHTML:{__html:JSON.stringify(a)},id:"faq-schema"})}export{e as FaqSchema};
2
+ import{useEffect as e}from"react";function t(t){var n=t.faq,a=Array.isArray(n)?n:n.items;return e((function(){if(a.length){var e={"@context":"https://schema.org","@type":"FAQPage",mainEntity:a.map((function(e){return{"@type":"Question",name:e.question,acceptedAnswer:{"@type":"Answer",text:e.answer}}}))},t=document.getElementById("faq-json-ld-schema");t&&document.head.removeChild(t);var n=document.createElement("script");return n.type="application/ld+json",n.id="faq-json-ld-schema",n.innerHTML=JSON.stringify(e),document.head.appendChild(n),function(){document.head.contains(n)&&document.head.removeChild(n)}}}),[a]),null}export{t as FaqSchema};
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ import{useEffect as e}from"react";function d(d){var s=d.schema;return e((function(){var e={"@context":"https://schema.org","@type":"Organization",url:s.url,logo:s.logo,name:s.name,description:s.description,email:s.email,telephone:s.telephone,address:{"@type":"PostalAddress",streetAddress:s.address.streetAddress,addressLocality:s.address.addressLocality,addressCountry:s.address.addressCountry,addressRegion:s.address.addressRegion,postalCode:s.address.postalCode}},d=document.createElement("script");return d.type="application/ld+json",d.id="organization-json-ld-schema",d.innerHTML=JSON.stringify(e),document.head.appendChild(d),function(){document.head.removeChild(d)}}),[]),null}export{d as OrganizationJsonLD};
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- import e,{useState as t,useEffect as a}from"react";import n from"moment";function o(o){var i,r,l,m,c,s,d=o.post,p=t(""),u=p[0],v=p[1];a((function(){"undefined"!=typeof window&&v(window.location.href)}),[]);var h={"@context":"https://schema.org","@type":"Article",headline:d.title,image:[d.featuredImage],author:{"@type":"Person",name:(null===(i=d.author)||void 0===i?void 0:i.name)||"Admin"},datePublished:n(d.publishedOn).toISOString(),dateModified:n(d.publishedOn).toISOString(),mainEntityOfPage:{"@type":"WebPage","@id":u||""},publisher:{"@type":"Organization",name:(null===(r=d.author)||void 0===r?void 0:r.name)||"Admin"},description:d.previewContent,articleBody:d.content.replace(/<[^>]+>/g,"")};return e.createElement("section",{className:"post-main-container"},e.createElement("h2",{className:"post-title"},d.title),e.createElement("div",{className:"post-avatar-main-container"},e.createElement("div",{className:"post-avatar"},(null===(l=d.author)||void 0===l?void 0:l.name)?null===(m=d.author)||void 0===m?void 0:m.name[0]:""),e.createElement("div",{className:"post-author-container"},e.createElement("h3",{className:"post-author-name"},(null===(c=d.author)||void 0===c?void 0:c.name)||""),e.createElement("div",{className:"post-date-read"},"On ".concat(n(d.publishedOn).format("ddd, MMM DD, YYYY"),", ").concat(d.readTime?"".concat(d.readTime," Min read"):"3 Min read")))),e.createElement("div",{className:"post-image-container"},e.createElement("img",{src:d.featuredImage,alt:d.title,className:"post-image"}),e.createElement("span",{className:"post-category"},(null===(s=null==d?void 0:d.categoryInfo)||void 0===s?void 0:s.name)||"General")),e.createElement("span",{dangerouslySetInnerHTML:{__html:d.content},className:"post-content",id:"post-content"}),u&&e.createElement("script",{type:"application/ld+json",dangerouslySetInnerHTML:{__html:JSON.stringify(h)}}))}export{o as Post};
2
+ import e,{useState as t,useEffect as a}from"react";import n from"moment";function o(o){var i,r,d,m,c=o.post,l=t(""),s=l[0],p=l[1];return a((function(){"undefined"!=typeof window&&p(window.location.href)}),[]),a((function(){var e,t;if(s){var a={"@context":"https://schema.org","@type":"Article",headline:c.title,image:[c.featuredImage],author:{"@type":"Person",name:(null===(e=c.author)||void 0===e?void 0:e.name)||"Admin"},datePublished:n(c.publishedOn).toISOString(),dateModified:n(c.publishedOn).toISOString(),mainEntityOfPage:{"@type":"WebPage","@id":s},publisher:{"@type":"Organization",name:(null===(t=c.author)||void 0===t?void 0:t.name)||"Admin"},description:c.previewContent,articleBody:c.content.replace(/<[^>]+>/g,"")},o=document.getElementById("post-json-ld-schema");o&&document.head.removeChild(o);var i=document.createElement("script");return i.type="application/ld+json",i.id="post-json-ld-schema",i.innerHTML=JSON.stringify(a),document.head.appendChild(i),function(){document.head.contains(i)&&document.head.removeChild(i)}}}),[s,c]),e.createElement("section",{className:"post-main-container"},e.createElement("h2",{className:"post-title"},c.title),e.createElement("div",{className:"post-avatar-main-container"},e.createElement("div",{className:"post-avatar"},(null===(i=c.author)||void 0===i?void 0:i.name)?null===(r=c.author)||void 0===r?void 0:r.name[0]:""),e.createElement("div",{className:"post-author-container"},e.createElement("h3",{className:"post-author-name"},(null===(d=c.author)||void 0===d?void 0:d.name)||""),e.createElement("div",{className:"post-date-read"},"On ".concat(n(c.publishedOn).format("ddd, MMM DD, YYYY"),", ").concat(c.readTime?"".concat(c.readTime," Min read"):"3 Min read")))),e.createElement("div",{className:"post-image-container"},e.createElement("img",{src:c.featuredImage,alt:c.title,className:"post-image"}),e.createElement("span",{className:"post-category"},(null===(m=null==c?void 0:c.categoryInfo)||void 0===m?void 0:m.name)||"General")),e.createElement("span",{dangerouslySetInnerHTML:{__html:c.content},className:"post-content",id:"post-content"}))}export{o as Post};
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- export{Copyright}from"./controls/copyright/index.js";export{Email}from"./controls/email/index.js";export{INSTA_MEDIA_TYPES,InstaFeed}from"./controls/instaFeed/index.js";export{Map}from"./controls/map/index.js";export{Phone}from"./controls/phone/index.js";export{BackToTop}from"./controls/backToTop/index.js";export{CopyrightWithUTM}from"./controls/copyrightWithUTM/index.js";export{SocialShare}from"./controls/socialShare/index.js";export{ReadingProgressBar}from"./controls/readingProgressBar/index.js";export{TableOfContents}from"./controls/tableOfContents/index.js";export{Faq}from"./controls/faq/index.js";export{FaqSchema}from"./controls/faqSchema/index.js";export{FeaturedBlog}from"./controls/featuredBlog/index.js";export{Post}from"./controls/post/index.js";export{RelatedPosts}from"./controls/relatedPosts/index.js";export{BlogList}from"./controls/blogList/index.js";export{ModalForm}from"./controls/modalForm/index.js";export{BreadCrumbJsonLD}from"./controls/breadCrumbSchema/index.js";
1
+ export{Copyright}from"./controls/copyright/index.js";export{Email}from"./controls/email/index.js";export{INSTA_MEDIA_TYPES,InstaFeed}from"./controls/instaFeed/index.js";export{Map}from"./controls/map/index.js";export{Phone}from"./controls/phone/index.js";export{BackToTop}from"./controls/backToTop/index.js";export{CopyrightWithUTM}from"./controls/copyrightWithUTM/index.js";export{SocialShare}from"./controls/socialShare/index.js";export{ReadingProgressBar}from"./controls/readingProgressBar/index.js";export{TableOfContents}from"./controls/tableOfContents/index.js";export{Faq}from"./controls/faq/index.js";export{FaqSchema}from"./controls/faqSchema/index.js";export{FeaturedBlog}from"./controls/featuredBlog/index.js";export{Post}from"./controls/post/index.js";export{RelatedPosts}from"./controls/relatedPosts/index.js";export{BlogList}from"./controls/blogList/index.js";export{ModalForm}from"./controls/modalForm/index.js";export{BreadCrumbJsonLD}from"./controls/breadCrumbSchema/index.js";export{OrganizationJsonLD}from"./controls/organizationSchema/index.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lm-web-controls",
3
- "version": "1.2.42",
3
+ "version": "1.2.44",
4
4
  "description": "leadmetrics-lm-web-controls",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.es.js",
@@ -96,6 +96,24 @@ declare module "lm-web-controls" {
96
96
  slug: string;
97
97
  };
98
98
 
99
+ type OrganizationSchemaProps = {
100
+ schema: {
101
+ url: string;
102
+ logo: string;
103
+ name: string;
104
+ description: string;
105
+ email: string;
106
+ telephone: string;
107
+ address: {
108
+ streetAddress: string;
109
+ addressLocality: string;
110
+ addressCountry: string;
111
+ addressRegion: string;
112
+ postalCode: string;
113
+ };
114
+ };
115
+ };
116
+
99
117
  export const Email: React.FC<EmailProps>;
100
118
  export const Copyright: React.FC<CopyrightProps>;
101
119
  export const Phone: React.FC<PhoneProps>;
@@ -114,6 +132,7 @@ declare module "lm-web-controls" {
114
132
  export const BlogList: React.FC<BlogListProps>;
115
133
  export const ModalForm: React.FC<ModalFormProps>;
116
134
  export const BreadCrumbJsonLD: React.FC;
135
+ export const OrganizationJsonLD: React.FC<OrganizationSchemaProps>;
117
136
 
118
137
  export const INSTA_MEDIA_TYPES: {
119
138
  readonly IMAGE: 1;