lm-web-controls 1.1.60 → 1.1.62

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.
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ import e,{useState as t,useEffect as n}from"react";import"../../styles/style.css";function r(r){var o=r.containerClassName,c=t([]),i=c[0],a=c[1],l=t(null),u=l[0],s=l[1];n((function(){var e=Array.from(document.querySelectorAll("h1, h2, h3, h4, h5, h6")),t=e.map((function(e){return{id:e.id||e.innerText.replace(/\s+/g,"-").toLowerCase(),text:e.innerText,level:parseInt(e.tagName.substring(1))}}));a(t),e.forEach((function(e,n){e.id||(e.id=t[n].id)}))}),[]),n((function(){var e=new IntersectionObserver((function(e){e.forEach((function(e){e.isIntersecting&&s(e.target.id)}))}),{rootMargin:"-50% 0px -50% 0px",threshold:1});return i.forEach((function(t){var n=t.id,r=document.getElementById(n);r&&e.observe(r)})),function(){return e.disconnect()}}),[i]);return e.createElement("nav",{className:o||"toc-container"},e.createElement("ul",null,i.map((function(t){return e.createElement("li",{key:t.id,className:"toc-item toc-level-".concat(t.level," ").concat(u===t.id?"active":"")},e.createElement("button",{onClick:function(){return function(e){var t;null===(t=document.getElementById(e))||void 0===t||t.scrollIntoView({behavior:"smooth"})}(t.id)}},t.text))}))))}export{r as TableOfContents};
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- export{Copyright}from"./blocks/copyright/index.js";export{Email}from"./blocks/email/index.js";export{INSTA_MEDIA_TYPES,InstaFeed}from"./blocks/instaFeed/index.js";export{Map}from"./blocks/map/index.js";export{Phone}from"./blocks/phone/index.js";export{BackToTop}from"./blocks/backToTop/index.js";export{CopyrightWithUTM}from"./blocks/copyrightWithUTM/index.js";export{SocialShare}from"./blocks/socialShare/index.js";export{ReadingProgressBar}from"./blocks/readingProgressBar/index.js";
1
+ export{Copyright}from"./blocks/copyright/index.js";export{Email}from"./blocks/email/index.js";export{INSTA_MEDIA_TYPES,InstaFeed}from"./blocks/instaFeed/index.js";export{Map}from"./blocks/map/index.js";export{Phone}from"./blocks/phone/index.js";export{BackToTop}from"./blocks/backToTop/index.js";export{CopyrightWithUTM}from"./blocks/copyrightWithUTM/index.js";export{SocialShare}from"./blocks/socialShare/index.js";export{ReadingProgressBar}from"./blocks/readingProgressBar/index.js";export{TableOfContents}from"./blocks/tableOfContents/index.js";
@@ -1 +1 @@
1
- .lm-slider{width:100%}.lm-back-to-top{align-items:center;display:flex;justify-content:center;position:fixed;transition-duration:.2s}.lm-back-to-top-svg{width:50%}.lm-hide-scroll-btn{transform:translateY(6rem)}.left-margin-xs{margin-left:5px}.progress-bar-container{background-color:transparent;height:5px;left:0;position:fixed;top:0;width:100%;z-index:1000}.progress-bar{height:100%;transform-origin:left;transition:width .2s ease-out}
1
+ .lm-slider{width:100%}.lm-back-to-top{align-items:center;display:flex;justify-content:center;position:fixed;transition-duration:.2s}.lm-back-to-top-svg{width:50%}.lm-hide-scroll-btn{transform:translateY(6rem)}.left-margin-xs{margin-left:5px}.reading-progress-bar-container{background-color:transparent;height:5px;left:0;position:fixed;top:0;width:100%;z-index:1000}.reading-progress-bar{height:100%;transform-origin:left;transition:width .2s ease-out}.toc-container{background:#f4f4f4;border-radius:4px;max-width:200px;padding:1rem;position:fixed;right:2%;top:10%}.toc-item{margin-bottom:.5rem}.toc-item button{all:unset;color:#545454;cursor:pointer}.toc-item.active button{color:#0a0a0a;font-weight:700}.toc-level-2{margin-left:10px}.toc-level-3{margin-left:15px}.toc-level-4{margin-left:20px}.toc-level-5{margin-left:25px}.toc-level-6{margin-left:30px}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lm-web-controls",
3
- "version": "1.1.60",
3
+ "version": "1.1.62",
4
4
  "description": "leadmetrics-lm-web-controls",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.es.js",
@@ -52,6 +52,10 @@ declare module "lm-web-controls" {
52
52
  backgroundColor: string;
53
53
  };
54
54
 
55
+ type TOCProps = {
56
+ containerClassName?: string;
57
+ };
58
+
55
59
  export const Email: React.FC<EmailProps>;
56
60
  export const Copyright: React.FC<CopyrightProps>;
57
61
  export const Phone: React.FC<PhoneProps>;
@@ -61,6 +65,7 @@ declare module "lm-web-controls" {
61
65
  export const CopyrightWithUTM: React.FC<CopyrightWithUTMProps>;
62
66
  export const SocialShare: React.FC<SocialShareButtonProps>;
63
67
  export const ReadingProgressBar: React.FC<ReadingProgressBarProps>;
68
+ export const TableOfContents: React.FC<TOCProps>;
64
69
 
65
70
  export const INSTA_MEDIA_TYPES: {
66
71
  readonly IMAGE: 1;