lm-web-controls 1.2.7 → 1.2.9
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
|
|
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};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import e,{useState as t,useEffect as n}from"react";function r(r){var o=r.contentSelector,c=void 0===o?"#post-content":o,i=t([]),a=i[0],u=i[1],l=t(null),s=l[0],m=l[1];n((function(){var e=function(){var e=document.querySelector(c);if(e){var t=Array.from(e.querySelectorAll("h1, h2, h3, h4, h5, h6")).map((function(e){var t=e.id||e.innerText.replace(/[^\w\s-]/g,"").replace(/\s+/g,"-").toLowerCase();return e.id||(e.id=t),{id:t,text:e.innerText,level:parseInt(e.tagName.substring(1))}}));u(t)}};e();var t=new MutationObserver(e);return t.observe(document.querySelector(c),{childList:!0,subtree:!0}),function(){return t.disconnect()}}),[c]),n((function(){var e=new IntersectionObserver((function(e){e.forEach((function(e){e.isIntersecting&&m(e.target.id)}))}),{rootMargin:"-30% 0px -30% 0px",threshold:.5});return a.forEach((function(t){var n=t.id,r=document.getElementById(n);r&&e.observe(r)})),function(){return e.disconnect()}}),[a]);return
|
|
2
|
+
import e,{useState as t,useEffect as n}from"react";function r(r){var o=r.contentSelector,c=void 0===o?"#post-content":o,i=t([]),a=i[0],u=i[1],l=t(null),s=l[0],m=l[1];n((function(){var e=function(){var e=document.querySelector(c);if(e){var t=Array.from(e.querySelectorAll("h1, h2, h3, h4, h5, h6")).map((function(e){var t=e.id||e.innerText.replace(/[^\w\s-]/g,"").replace(/\s+/g,"-").toLowerCase();return e.id||(e.id=t),{id:t,text:e.innerText,level:parseInt(e.tagName.substring(1))}}));u(t)}};e();var t=new MutationObserver(e);return t.observe(document.querySelector(c),{childList:!0,subtree:!0}),function(){return t.disconnect()}}),[c]),n((function(){var e=new IntersectionObserver((function(e){e.forEach((function(e){e.isIntersecting&&m(e.target.id)}))}),{rootMargin:"-30% 0px -30% 0px",threshold:.5});return a.forEach((function(t){var n=t.id,r=document.getElementById(n);r&&e.observe(r)})),function(){return e.disconnect()}}),[a]);return a.length?e.createElement("nav",{className:"toc-main-container"},e.createElement("div",{className:"toc-title"},"Table of Contents"),a.map((function(t){return e.createElement("div",{key:t.id,className:"toc-item ".concat(s===t.id?"toc-active":"")},e.createElement("button",{className:"toc-item-button ".concat(s===t.id?"toc-item-button-active":""),onClick:function(){return function(e){var t;null===(t=document.getElementById(e))||void 0===t||t.scrollIntoView({behavior:"smooth",block:"center"})}(t.id)}},t.text))}))):null}export{r as TableOfContents};
|
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";
|
|
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";import"react";import"moment";
|
package/package.json
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
FaqProps,
|
|
4
|
+
FaqSchemaProps,
|
|
5
|
+
FeaturedBlogProps,
|
|
6
|
+
PostProps,
|
|
7
|
+
RelatedPostProps,
|
|
8
|
+
} from "../src";
|
|
3
9
|
declare module "lm-web-controls" {
|
|
4
10
|
type EmailProps = {
|
|
5
11
|
value: string;
|
|
@@ -94,6 +100,10 @@ declare module "lm-web-controls" {
|
|
|
94
100
|
export const ReadingProgressBar: React.FC<ReadingProgressBarProps>;
|
|
95
101
|
export const TableOfContents: React.FC<TOCProps>;
|
|
96
102
|
export const Faq: React.FC<FaqProps>;
|
|
103
|
+
export const FaqSchema: React.FC<FaqSchemaProps>;
|
|
104
|
+
export const FeaturedBlog: React.FC<FeaturedBlogProps>;
|
|
105
|
+
export const Post: React.FC<PostProps>;
|
|
106
|
+
export const RelatedPosts: React.FC<RelatedPostProps>;
|
|
97
107
|
|
|
98
108
|
export const INSTA_MEDIA_TYPES: {
|
|
99
109
|
readonly IMAGE: 1;
|