lm-web-controls 1.2.2 → 1.2.3

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 l,{useRef as t,useEffect as e}from"react";import"../../styles/style.css";function o(o){var n=o.className,c=t(null);return e((function(){var l=function(){var l,t;0===window.scrollY?null===(l=null==c?void 0:c.current)||void 0===l||l.classList.add("lm-hide-scroll-btn"):null===(t=null==c?void 0:c.current)||void 0===t||t.classList.remove("lm-hide-scroll-btn")};return window.addEventListener("scroll",l),function(){window.removeEventListener("scroll",l)}}),[]),l.createElement("button",{onClick:function(){window.scroll({top:0,behavior:"smooth"})},ref:c,tabIndex:-1,className:"lm-back-to-top lm-hide-scroll-btn ".concat(n)},l.createElement("svg",{className:"lm-back-to-top-svg",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 448 512"},l.createElement("path",{d:"M34.9 289.5l-22.2-22.2c-9.4-9.4-9.4-24.6 0-33.9L207 39c9.4-9.4 24.6-9.4 33.9 0l194.3 194.3c9.4 9.4 9.4 24.6 0 33.9L413 289.4c-9.5 9.5-25 9.3-34.3-.4L264 168.6V456c0 13.3-10.7 24-24 24h-32c-13.3 0-24-10.7-24-24V168.6L69.2 289.1c-9.3 9.8-24.8 10-34.3 .4z"})))}export{o as BackToTop};
2
+ import l,{useRef as t,useEffect as e}from"react";function n(n){var o=n.className,c=t(null);return e((function(){var l=function(){var l,t;0===window.scrollY?null===(l=null==c?void 0:c.current)||void 0===l||l.classList.add("lm-hide-scroll-btn"):null===(t=null==c?void 0:c.current)||void 0===t||t.classList.remove("lm-hide-scroll-btn")};return window.addEventListener("scroll",l),function(){window.removeEventListener("scroll",l)}}),[]),l.createElement("button",{onClick:function(){window.scroll({top:0,behavior:"smooth"})},ref:c,tabIndex:-1,className:"lm-back-to-top lm-hide-scroll-btn ".concat(o)},l.createElement("svg",{className:"lm-back-to-top-svg",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 448 512"},l.createElement("path",{d:"M34.9 289.5l-22.2-22.2c-9.4-9.4-9.4-24.6 0-33.9L207 39c9.4-9.4 24.6-9.4 33.9 0l194.3 194.3c9.4 9.4 9.4 24.6 0 33.9L413 289.4c-9.5 9.5-25 9.3-34.3-.4L264 168.6V456c0 13.3-10.7 24-24 24h-32c-13.3 0-24-10.7-24-24V168.6L69.2 289.1c-9.3 9.8-24.8 10-34.3 .4z"})))}export{n as BackToTop};
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- import e,{useState as t,useEffect as a}from"react";import"../../styles/style.css";function r(r){var n=r.name,o=r.className,i=r.source,m=r.medium,c=t(""),s=c[0],l=c[1];return a((function(){if("undefined"!=typeof window){var e=new URL(window.location.href).hostname,t="https://leadmetrics.ai?utm_source=".concat(e,"&utm_medium=").concat(m,"&utm_content=page");l(t)}}),[i]),e.createElement("span",{className:o},"Copyright © ",(new Date).getFullYear()," ",n,", Digital Marketing with AI Powered by",e.createElement("a",{href:s,target:"_blank",rel:"noopener noreferrer",className:"left-margin-xs"},"Leadmetrics"))}export{r as CopyrightWithUTM};
2
+ import e,{useState as t,useEffect as a}from"react";function r(r){var n=r.name,o=r.className,i=r.source,m=r.medium,c=t(""),s=c[0],l=c[1];return a((function(){if("undefined"!=typeof window){var e=new URL(window.location.href).hostname,t="https://leadmetrics.ai?utm_source=".concat(e,"&utm_medium=").concat(m,"&utm_content=page");l(t)}}),[i]),e.createElement("span",{className:o},"Copyright © ",(new Date).getFullYear()," ",n,", Digital Marketing with AI Powered by",e.createElement("a",{href:s,target:"_blank",rel:"noopener noreferrer",className:"left-margin-xs"},"Leadmetrics"))}export{r as CopyrightWithUTM};
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- import{__awaiter as e,__generator as t}from"../../_virtual/_tslib.js";import n,{useState as a,useEffect as r}from"react";import"../../styles/style.css";var s=function(e){var t=e.question,r=e.answer,s=e.icon,i=a(!1),c=i[0],o=i[1];return n.createElement("div",{className:"faq-item",onClick:function(){return o(!c)}},n.createElement("div",{className:"faq-question-container"},n.createElement("h3",{className:"faq-question"},t),n.createElement("img",{src:s,alt:"Toggle icon",className:"faq-icon ".concat(c?"rotate":"")})),n.createElement("div",{className:"faq-answer ".concat(c?"open":"closed")},n.createElement("p",null,r)))};function i(i){var c=this,o=i.faqSlug,l=i.title,u=void 0===l?"Frequently Asked Questions":l,m=i.icon,f=void 0===m?"../../images/accordion.png":m,q=a([]),d=q[0],v=q[1];return r((function(){o&&e(c,void 0,void 0,(function(){var e,n,a,r;return t(this,(function(t){switch(t.label){case 0:return t.trys.push([0,3,,4]),[4,fetch("https://client-api.leadmetrics.ai/api/client/v1/faqs/".concat(o),{headers:{"Api-Key":process.env.NEXT_PUBLIC_API_KEY||""}})];case 1:if(!(e=t.sent()).ok)throw new Error("Failed to fetch FAQs");return[4,e.json()];case 2:return n=t.sent(),a=n.items.map((function(e){return{question:e.question,answer:e.answer||"No answer provided.",icon:f}})),v(a),[3,4];case 3:return r=t.sent(),console.error(r),[3,4];case 4:return[2]}}))}))}),[o,f]),n.createElement("div",{className:"faq-main-container"},n.createElement("h2",{className:"faq-title"},u),n.createElement("div",{className:"faq-inner-container"},d.map((function(e,t){return n.createElement(s,{key:t,question:e.question,answer:e.answer,icon:e.icon})}))))}export{i as Faq};
2
+ import{__awaiter as e,__generator as n}from"../../_virtual/_tslib.js";import t,{useState as a,useEffect as r}from"react";var i=function(e){var n=e.question,r=e.answer,i=e.icon,c=a(!1),s=c[0],o=c[1];return t.createElement("div",{className:"faq-item",onClick:function(){return o(!s)}},t.createElement("div",{className:"faq-question-container"},t.createElement("h3",{className:"faq-question"},n),t.createElement("img",{src:i,alt:"Toggle icon",className:"faq-icon ".concat(s?"rotate":"")})),t.createElement("div",{className:"faq-answer ".concat(s?"open":"closed")},t.createElement("p",null,r)))};function c(c){var s=this,o=c.faqSlug,l=c.title,u=void 0===l?"Frequently Asked Questions":l,m=c.icon,f=void 0===m?"../../images/accordion.png":m,q=a([]),d=q[0],v=q[1];return r((function(){o&&e(s,void 0,void 0,(function(){var e,t,a,r;return n(this,(function(n){switch(n.label){case 0:return n.trys.push([0,3,,4]),[4,fetch("https://client-api.leadmetrics.ai/api/client/v1/faqs/".concat(o),{headers:{"Api-Key":process.env.NEXT_PUBLIC_API_KEY||""}})];case 1:if(!(e=n.sent()).ok)throw new Error("Failed to fetch FAQs");return[4,e.json()];case 2:return t=n.sent(),a=t.items.map((function(e){return{question:e.question,answer:e.answer||"No answer provided.",icon:f}})),v(a),[3,4];case 3:return r=n.sent(),console.error(r),[3,4];case 4:return[2]}}))}))}),[o,f]),t.createElement("div",{className:"faq-main-container"},t.createElement("h2",{className:"faq-title"},u),t.createElement("div",{className:"faq-inner-container"},d.map((function(e,n){return t.createElement(i,{key:n,question:e.question,answer:e.answer,icon:e.icon})}))))}export{c as Faq};
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- import{__assign as e}from"../../_virtual/_tslib.js";import t,{useState as i,useEffect as s}from"react";import o from"react-slick";import"slick-carousel/slick/slick.css";import"slick-carousel/slick/slick-theme.css";import"../../styles/style.css";var n={IMAGE:1,VIDEO:2,CAROUSEL_ALBUM:4};function r(r){var a=r.apiKey,c=r.mediaTypes,l=r.className,m=i(null),d=m[0],p=m[1],u=i("Loading feeds..."),f=u[0],h=u[1];return s((function(){var e="https://graph.instagram.com/me/media?fields=id,caption,media_type,media_url,timestamp&access_token=".concat(a);fetch(e).then((function(e){return e.json()})).then((function(e){var t=[];e.data.forEach((function(e,i){var s,o;s=e.media_type,((o=c)&n.IMAGE&&"IMAGE"===s||o&n.VIDEO&&"VIDEO"===s||o&n.CAROUSEL_ALBUM&&"CAROUSEL_ALBUM"===s)&&t.push(e)})),p(t)})).catch((function(e){h("Something went wrong!"),console.error(e)}))}),[]),t.createElement(t.Fragment,null,d?t.createElement(o,e({},{dots:!0,infinite:!0,autoplay:!0,speed:2e3,slidesToShow:6,slidesToScroll:1,responsive:[{breakpoint:1024,settings:{slidesToShow:3,slidesToScroll:3,infinite:!0,dots:!0}},{breakpoint:600,settings:{slidesToShow:2,slidesToScroll:2,infinite:!0,dots:!0}},{breakpoint:480,settings:{slidesToShow:2,slidesToScroll:2,infinite:!0,dots:!0}}]},{className:"".concat(l," lm-slider")}),null==d?void 0:d.map((function(e,i){return t.createElement("div",{key:crypto.randomUUID()},t.createElement("img",{src:e.media_url,alt:"image-".concat(i)}))}))):t.createElement("h3",{className:"text-center"},f))}export{n as INSTA_MEDIA_TYPES,r as InstaFeed};
2
+ import{__assign as e}from"../../_virtual/_tslib.js";import t,{useState as i,useEffect as s}from"react";import o from"react-slick";import"slick-carousel/slick/slick.css";import"slick-carousel/slick/slick-theme.css";var n={IMAGE:1,VIDEO:2,CAROUSEL_ALBUM:4};function r(r){var a=r.apiKey,c=r.mediaTypes,l=r.className,m=i(null),d=m[0],p=m[1],u=i("Loading feeds..."),f=u[0],h=u[1];return s((function(){var e="https://graph.instagram.com/me/media?fields=id,caption,media_type,media_url,timestamp&access_token=".concat(a);fetch(e).then((function(e){return e.json()})).then((function(e){var t=[];e.data.forEach((function(e,i){var s,o;s=e.media_type,((o=c)&n.IMAGE&&"IMAGE"===s||o&n.VIDEO&&"VIDEO"===s||o&n.CAROUSEL_ALBUM&&"CAROUSEL_ALBUM"===s)&&t.push(e)})),p(t)})).catch((function(e){h("Something went wrong!"),console.error(e)}))}),[]),t.createElement(t.Fragment,null,d?t.createElement(o,e({},{dots:!0,infinite:!0,autoplay:!0,speed:2e3,slidesToShow:6,slidesToScroll:1,responsive:[{breakpoint:1024,settings:{slidesToShow:3,slidesToScroll:3,infinite:!0,dots:!0}},{breakpoint:600,settings:{slidesToShow:2,slidesToScroll:2,infinite:!0,dots:!0}},{breakpoint:480,settings:{slidesToShow:2,slidesToScroll:2,infinite:!0,dots:!0}}]},{className:"".concat(l," lm-slider")}),null==d?void 0:d.map((function(e,i){return t.createElement("div",{key:crypto.randomUUID()},t.createElement("img",{src:e.media_url,alt:"image-".concat(i)}))}))):t.createElement("h3",{className:"text-center"},f))}export{n as INSTA_MEDIA_TYPES,r as InstaFeed};
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- import r from"react";import{useReadingProgress as e}from"../../hooks/useReadingProgress.js";import"../../styles/style.css";function o(o){var s=o.backgroundColor,a=e();return r.createElement("div",{className:"reading-progress-bar-container"},r.createElement("div",{className:"reading-progress-bar",style:{width:"".concat(a,"%"),backgroundColor:s,borderRadius:a>99?"0px":"0px 5px 5px 0px"}}))}export{o as ReadingProgressBar};
2
+ import r from"react";import{useReadingProgress as e}from"../../hooks/useReadingProgress.js";function o(o){var a=o.backgroundColor,s=e();return r.createElement("div",{className:"reading-progress-bar-container"},r.createElement("div",{className:"reading-progress-bar",style:{width:"".concat(s,"%"),backgroundColor:a,borderRadius:s>99?"0px":"0px 5px 5px 0px"}}))}export{o as ReadingProgressBar};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lm-web-controls",
3
- "version": "1.2.02",
3
+ "version": "1.2.03",
4
4
  "description": "leadmetrics-lm-web-controls",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.es.js",