@san-siva/blogkit 1.1.20 → 1.1.21

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.
Files changed (55) hide show
  1. package/dist/cjs/dynamicComponents/BlogDynamic.js +31 -181
  2. package/dist/cjs/dynamicComponents/BlogDynamic.js.map +1 -1
  3. package/dist/cjs/dynamicComponents/BlogSectionDynamic.js +11 -2
  4. package/dist/cjs/dynamicComponents/BlogSectionDynamic.js.map +1 -1
  5. package/dist/cjs/hooks/useCategoryTitles.js +104 -0
  6. package/dist/cjs/hooks/useCategoryTitles.js.map +1 -0
  7. package/dist/cjs/hooks/useSectionObserver.js +89 -0
  8. package/dist/cjs/hooks/useSectionObserver.js.map +1 -0
  9. package/dist/cjs/index.css +1 -1
  10. package/dist/cjs/index.css.map +1 -1
  11. package/dist/cjs/staticComponents/TocNodeStatic.js +16 -0
  12. package/dist/cjs/staticComponents/TocNodeStatic.js.map +1 -0
  13. package/dist/cjs/styles/Blog.module.scss.js +1 -1
  14. package/dist/cjs/styles/Callout.module.scss.js +1 -1
  15. package/dist/cjs/styles/TocNode.module.scss.js +8 -0
  16. package/dist/cjs/styles/TocNode.module.scss.js.map +1 -0
  17. package/dist/esm/dynamicComponents/BlogDynamic.js +32 -182
  18. package/dist/esm/dynamicComponents/BlogDynamic.js.map +1 -1
  19. package/dist/esm/dynamicComponents/BlogSectionDynamic.js +12 -3
  20. package/dist/esm/dynamicComponents/BlogSectionDynamic.js.map +1 -1
  21. package/dist/esm/hooks/useCategoryTitles.js +102 -0
  22. package/dist/esm/hooks/useCategoryTitles.js.map +1 -0
  23. package/dist/esm/hooks/useSectionObserver.js +87 -0
  24. package/dist/esm/hooks/useSectionObserver.js.map +1 -0
  25. package/dist/esm/index.css +1 -1
  26. package/dist/esm/index.css.map +1 -1
  27. package/dist/esm/staticComponents/TocNodeStatic.js +12 -0
  28. package/dist/esm/staticComponents/TocNodeStatic.js.map +1 -0
  29. package/dist/esm/styles/Blog.module.scss.js +1 -1
  30. package/dist/esm/styles/Callout.module.scss.js +1 -1
  31. package/dist/esm/styles/TocNode.module.scss.js +4 -0
  32. package/dist/esm/styles/TocNode.module.scss.js.map +1 -0
  33. package/dist/types/dynamicComponents/BlogDynamic.d.ts +1 -1
  34. package/dist/types/dynamicComponents/BlogDynamic.d.ts.map +1 -1
  35. package/dist/types/dynamicComponents/BlogSectionDynamic.d.ts.map +1 -1
  36. package/dist/types/hooks/useCategoryTitles.d.ts +22 -0
  37. package/dist/types/hooks/useCategoryTitles.d.ts.map +1 -0
  38. package/dist/types/hooks/useSectionObserver.d.ts +11 -0
  39. package/dist/types/hooks/useSectionObserver.d.ts.map +1 -0
  40. package/dist/types/staticComponents/TocNodeStatic.d.ts +16 -0
  41. package/dist/types/staticComponents/TocNodeStatic.d.ts.map +1 -0
  42. package/package.json +5 -3
  43. package/src/dynamicComponents/BlogDynamic.tsx +42 -253
  44. package/src/dynamicComponents/BlogSectionDynamic.tsx +16 -2
  45. package/src/hooks/useCategoryTitles.ts +148 -0
  46. package/src/hooks/useSectionObserver.ts +102 -0
  47. package/src/staticComponents/TocNodeStatic.tsx +52 -0
  48. package/src/styles/Blog.module.scss +0 -30
  49. package/src/styles/Blog.module.scss.d.ts +0 -4
  50. package/src/styles/BlogLink.module.scss +1 -1
  51. package/src/styles/BlogSection.module.scss +36 -13
  52. package/src/styles/CodeBlock.module.scss +2 -2
  53. package/src/styles/Table.module.scss +1 -1
  54. package/src/styles/TocNode.module.scss +49 -0
  55. package/src/styles/TocNode.module.scss.d.ts +11 -0
@@ -0,0 +1,12 @@
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
2
+ import styles from '../styles/TocNode.module.scss.js';
3
+
4
+ const TocNode = ({ node, index, visibleTitle, onClick }) => (jsxs("div", { children: [jsx("p", { "data-idx": index, "data-id": node.id, className: [
5
+ styles['toc-node__title'],
6
+ node.id === visibleTitle ? styles['toc-node__title--active'] : '',
7
+ node.depth === 1 ? styles['toc-node__title--sub'] : '',
8
+ node.depth === 2 ? styles['toc-node__title--sub-sub'] : '',
9
+ ].join(' '), onClick: onClick, children: node.title }), node.children.length > 0 && (jsx("div", { className: `${styles['toc-node__children']} ${styles[`toc-node__children--${node.depth === 0 ? 'sub' : 'sub-sub'}`]}`, children: node.children.map((child, i) => (jsx(TocNode, { node: child, index: i, visibleTitle: visibleTitle, onClick: onClick }, child.id))) }))] }));
10
+
11
+ export { TocNode as default };
12
+ //# sourceMappingURL=TocNodeStatic.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TocNodeStatic.js","sources":["../../../src/staticComponents/TocNodeStatic.tsx"],"sourcesContent":["import type { MouseEvent } from 'react';\n\nimport styles from '../styles/TocNode.module.scss';\n\nexport interface TocNode {\n\tid: string;\n\ttitle: string;\n\tdepth: number;\n\tchildren: TocNode[];\n}\n\ninterface TocNodeProperties {\n\tnode: TocNode;\n\tindex: number;\n\tvisibleTitle: string | null;\n\tonClick: (e: MouseEvent<HTMLParagraphElement>) => void;\n}\n\nconst TocNode = ({ node, index, visibleTitle, onClick }: TocNodeProperties) => (\n\t<div>\n\t\t<p\n\t\t\tdata-idx={index}\n\t\t\tdata-id={node.id}\n\t\t\tclassName={[\n\t\t\t\tstyles['toc-node__title'],\n\t\t\t\tnode.id === visibleTitle ? styles['toc-node__title--active'] : '',\n\t\t\t\tnode.depth === 1 ? styles['toc-node__title--sub'] : '',\n\t\t\t\tnode.depth === 2 ? styles['toc-node__title--sub-sub'] : '',\n\t\t\t].join(' ')}\n\t\t\tonClick={onClick}\n\t\t>\n\t\t\t{node.title}\n\t\t</p>\n\t\t{node.children.length > 0 && (\n\t\t\t<div\n\t\t\t\tclassName={`${styles['toc-node__children']} ${styles[`toc-node__children--${node.depth === 0 ? 'sub' : 'sub-sub'}`]}`}\n\t\t\t>\n\t\t\t\t{node.children.map((child, i) => (\n\t\t\t\t\t<TocNode\n\t\t\t\t\t\tkey={child.id}\n\t\t\t\t\t\tnode={child}\n\t\t\t\t\t\tindex={i}\n\t\t\t\t\t\tvisibleTitle={visibleTitle}\n\t\t\t\t\t\tonClick={onClick}\n\t\t\t\t\t/>\n\t\t\t\t))}\n\t\t\t</div>\n\t\t)}\n\t</div>\n);\n\nexport default TocNode;\n"],"names":["_jsxs","_jsx"],"mappings":";;;AAkBA,MAAM,OAAO,GAAG,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,YAAY,EAAE,OAAO,EAAqB,MACzEA,IAAA,CAAA,KAAA,EAAA,EAAA,QAAA,EAAA,CACCC,GAAA,CAAA,GAAA,EAAA,EAAA,UAAA,EACW,KAAK,EAAA,SAAA,EACN,IAAI,CAAC,EAAE,EAChB,SAAS,EAAE;gBACV,MAAM,CAAC,iBAAiB,CAAC;AACzB,gBAAA,IAAI,CAAC,EAAE,KAAK,YAAY,GAAG,MAAM,CAAC,yBAAyB,CAAC,GAAG,EAAE;AACjE,gBAAA,IAAI,CAAC,KAAK,KAAK,CAAC,GAAG,MAAM,CAAC,sBAAsB,CAAC,GAAG,EAAE;AACtD,gBAAA,IAAI,CAAC,KAAK,KAAK,CAAC,GAAG,MAAM,CAAC,0BAA0B,CAAC,GAAG,EAAE;aAC1D,CAAC,IAAI,CAAC,GAAG,CAAC,EACX,OAAO,EAAE,OAAO,EAAA,QAAA,EAEf,IAAI,CAAC,KAAK,EAAA,CACR,EACH,IAAI,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,KACxBA,GAAA,CAAA,KAAA,EAAA,EACC,SAAS,EAAE,CAAA,EAAG,MAAM,CAAC,oBAAoB,CAAC,IAAI,MAAM,CAAC,uBAAuB,IAAI,CAAC,KAAK,KAAK,CAAC,GAAG,KAAK,GAAG,SAAS,CAAA,CAAE,CAAC,EAAE,EAAA,QAAA,EAEpH,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,CAAC,MAC3BA,GAAA,CAAC,OAAO,EAAA,EAEP,IAAI,EAAE,KAAK,EACX,KAAK,EAAE,CAAC,EACR,YAAY,EAAE,YAAY,EAC1B,OAAO,EAAE,OAAO,IAJX,KAAK,CAAC,EAAE,CAKZ,CACF,CAAC,EAAA,CACG,CACN,CAAA,EAAA,CACI;;;;"}
@@ -1,4 +1,4 @@
1
- var styles = {"margin-bottom--3":"Blog-module_margin-bottom--3__ir35O","category__header":"Blog-module_category__header__F1K0V","blog":"Blog-module_blog__Lpv6Z","blog__content":"Blog-module_blog__content__RMDiY","blog__sidebar":"Blog-module_blog__sidebar__uSu3l","category__title":"Blog-module_category__title__960db","category__title--active":"Blog-module_category__title--active__nvGys","category__title--sub":"Blog-module_category__title--sub__zrfE5"};
1
+ var styles = {"margin-bottom--3":"Blog-module_margin-bottom--3__ir35O","category__header":"Blog-module_category__header__F1K0V","blog":"Blog-module_blog__Lpv6Z","blog__content":"Blog-module_blog__content__RMDiY","blog__sidebar":"Blog-module_blog__sidebar__uSu3l"};
2
2
 
3
3
  export { styles as default };
4
4
  //# sourceMappingURL=Blog.module.scss.js.map
@@ -1,4 +1,4 @@
1
- var styles = {"margin-top":"Callout-module_margin-top__dS2UF","padding-top":"Callout-module_padding-top__aJrE4","margin-top--1":"Callout-module_margin-top--1__eBfEL","padding-top--1":"Callout-module_padding-top--1__rrL2e","margin-top--2":"Callout-module_margin-top--2__Ej-fE","padding-top--2":"Callout-module_padding-top--2__NtBHH","margin-top--3":"Callout-module_margin-top--3__AsHPR","padding-top--3":"Callout-module_padding-top--3__CjXpH","margin-top--4":"Callout-module_margin-top--4__3ji03","padding-top--4":"Callout-module_padding-top--4__BdcKb","margin-top--5":"Callout-module_margin-top--5__j3Qds","padding-top--5":"Callout-module_padding-top--5__TWT9C","margin-top--6":"Callout-module_margin-top--6__GQFRt","padding-top--6":"Callout-module_padding-top--6__4bYvI","margin-top--7":"Callout-module_margin-top--7__ArvNz","padding-top--7":"Callout-module_padding-top--7__PnU3M","margin-top--8":"Callout-module_margin-top--8__DvN7J","padding-top--8":"Callout-module_padding-top--8__qunY9","margin-top--9":"Callout-module_margin-top--9__mSjxY","padding-top--9":"Callout-module_padding-top--9__N4Z2b","margin-top--10":"Callout-module_margin-top--10__bJrtu","padding-top--10":"Callout-module_padding-top--10__JBw3e","margin-top--11":"Callout-module_margin-top--11__vnKG4","padding-top--11":"Callout-module_padding-top--11__w1mSs","margin-top--12":"Callout-module_margin-top--12__XM8gt","padding-top--12":"Callout-module_padding-top--12__iuEYZ","margin-bottom":"Callout-module_margin-bottom__UlOKu","padding-bottom":"Callout-module_padding-bottom__-XwJQ","margin-bottom--1":"Callout-module_margin-bottom--1__LxnVH","padding-bottom--1":"Callout-module_padding-bottom--1__MfyXw","margin-bottom--2":"Callout-module_margin-bottom--2__nelQj","padding-bottom--2":"Callout-module_padding-bottom--2__9MX1j","margin-bottom--3":"Callout-module_margin-bottom--3__VfA8y","padding-bottom--3":"Callout-module_padding-bottom--3__FRllS","margin-bottom--4":"Callout-module_margin-bottom--4__-j-tS","padding-bottom--4":"Callout-module_padding-bottom--4__sJzsQ","margin-bottom--5":"Callout-module_margin-bottom--5__0hYDy","padding-bottom--5":"Callout-module_padding-bottom--5__c4BQo","margin-bottom--6":"Callout-module_margin-bottom--6__8Ny2B","padding-bottom--6":"Callout-module_padding-bottom--6__wNeJk","margin-bottom--7":"Callout-module_margin-bottom--7__0dYmE","padding-bottom--7":"Callout-module_padding-bottom--7__FueIs","margin-bottom--8":"Callout-module_margin-bottom--8__r93zU","padding-bottom--8":"Callout-module_padding-bottom--8__APcyf","margin-bottom--9":"Callout-module_margin-bottom--9__f6KUQ","padding-bottom--9":"Callout-module_padding-bottom--9__KVgqO","margin-bottom--10":"Callout-module_margin-bottom--10__DgHw9","padding-bottom--10":"Callout-module_padding-bottom--10__VeWlT","margin-bottom--11":"Callout-module_margin-bottom--11__MR5kg","padding-bottom--11":"Callout-module_padding-bottom--11__w-dVG","margin-bottom--12":"Callout-module_margin-bottom--12__65MMr","padding-bottom--12":"Callout-module_padding-bottom--12__6FT1T","margin-left":"Callout-module_margin-left__mb1jm","padding-left":"Callout-module_padding-left__cgzip","margin-left--1":"Callout-module_margin-left--1__DWFsG","padding-left--1":"Callout-module_padding-left--1__3nWMz","margin-left--2":"Callout-module_margin-left--2__ByTNO","padding-left--2":"Callout-module_padding-left--2__9-PLw","margin-left--3":"Callout-module_margin-left--3__0Iz7m","padding-left--3":"Callout-module_padding-left--3__FQgJY","margin-left--4":"Callout-module_margin-left--4__cmAQ4","padding-left--4":"Callout-module_padding-left--4__pW9OV","margin-left--5":"Callout-module_margin-left--5__qD5bN","padding-left--5":"Callout-module_padding-left--5__FaZO8","margin-left--6":"Callout-module_margin-left--6__h-dBW","padding-left--6":"Callout-module_padding-left--6__RT6JH","margin-left--7":"Callout-module_margin-left--7__9wZFI","padding-left--7":"Callout-module_padding-left--7__-31-c","margin-left--8":"Callout-module_margin-left--8__bbcki","padding-left--8":"Callout-module_padding-left--8__f3ctw","margin-left--9":"Callout-module_margin-left--9__0xlWQ","padding-left--9":"Callout-module_padding-left--9__QsNKP","margin-left--10":"Callout-module_margin-left--10__RfTZc","padding-left--10":"Callout-module_padding-left--10__2CqOz","margin-left--11":"Callout-module_margin-left--11__KWNFX","padding-left--11":"Callout-module_padding-left--11__qf3JJ","margin-left--12":"Callout-module_margin-left--12__-0GWw","padding-left--12":"Callout-module_padding-left--12__vNYbn","margin-right":"Callout-module_margin-right__CN33J","padding-right":"Callout-module_padding-right__Cn14a","margin-right--1":"Callout-module_margin-right--1__GAGZO","padding-right--1":"Callout-module_padding-right--1__qh8gH","margin-right--2":"Callout-module_margin-right--2__MjxOE","padding-right--2":"Callout-module_padding-right--2__CDawi","margin-right--3":"Callout-module_margin-right--3__w3PO-","padding-right--3":"Callout-module_padding-right--3__bOIL3","margin-right--4":"Callout-module_margin-right--4__wjZRG","padding-right--4":"Callout-module_padding-right--4__DNn-A","margin-right--5":"Callout-module_margin-right--5__JUYoz","padding-right--5":"Callout-module_padding-right--5__V1t3c","margin-right--6":"Callout-module_margin-right--6__UXR9-","padding-right--6":"Callout-module_padding-right--6__pVwQj","margin-right--7":"Callout-module_margin-right--7__ZwUec","padding-right--7":"Callout-module_padding-right--7__EHY0p","margin-right--8":"Callout-module_margin-right--8__k9asQ","padding-right--8":"Callout-module_padding-right--8__1Nqrm","margin-right--9":"Callout-module_margin-right--9__J8sMZ","padding-right--9":"Callout-module_padding-right--9__QYnAq","margin-right--10":"Callout-module_margin-right--10__CZ3Im","padding-right--10":"Callout-module_padding-right--10__Ji-ow","margin-right--11":"Callout-module_margin-right--11__xNfCV","padding-right--11":"Callout-module_padding-right--11__epPSq","margin-right--12":"Callout-module_margin-right--12__s30AM","padding-right--12":"Callout-module_padding-right--12__lLgou","error":"Callout-module_error__UeboU","font--primary":"Callout-module_font--primary__Ayv9J","font--secondary":"Callout-module_font--secondary__mBXUH","font--code":"Callout-module_font--code__fG36F","font-weight--400":"Callout-module_font-weight--400__VYsxM","font-weight--500":"Callout-module_font-weight--500__zXuRq","font-weight--600":"Callout-module_font-weight--600__fJDVt","font-weight--700":"Callout-module_font-weight--700__3kQTh","font-weight--800":"Callout-module_font-weight--800__5POjB","font-size--h1":"Callout-module_font-size--h1__9fzEM","font-size--h2":"Callout-module_font-size--h2__EowCg","font-size--h3":"Callout-module_font-size--h3__8EcUJ","font-size--h4":"Callout-module_font-size--h4__ferQ7","font-size--h5":"Callout-module_font-size--h5__43lHF","font-size--h6":"Callout-module_font-size--h6__GpBej","font-size--big":"Callout-module_font-size--big__-BXjA","font-size--button":"Callout-module_font-size--button__9KupW","font-size--p":"Callout-module_font-size--p__RJTna","font-size--small":"Callout-module_font-size--small__YEsJl","line-height--large":"Callout-module_line-height--large__OStzV","line-height--normal":"Callout-module_line-height--normal__p5UA7","line-height--small":"Callout-module_line-height--small__2kXv9","line-height--very-small":"Callout-module_line-height--very-small__AS59u","text-align--center":"Callout-module_text-align--center__5JXeQ","category__header":"Callout-module_category__header__Edg04","a--highlighted":"Callout-module_a--highlighted__JmfE5","grecaptcha-badge":"Callout-module_grecaptcha-badge__7vWF5","container":"Callout-module_container__FV7VM","container--contents-centered":"Callout-module_container--contents-centered__zx2lp","container--no-padding":"Callout-module_container--no-padding__wI9Pc","page":"Callout-module_page__2bQ0P","page--contents-max-width":"Callout-module_page--contents-max-width__4p2pL","page--no-extra-padding":"Callout-module_page--no-extra-padding__lGzpM","page--no-max-width":"Callout-module_page--no-max-width__cF1qn","hr":"Callout-module_hr__iz4ZP","li--disabled":"Callout-module_li--disabled__09IJ1","block":"Callout-module_block__cdSSP","callout":"Callout-module_callout__kEgS8","callout__icon":"Callout-module_callout__icon__z-ZHp","callout--info":"Callout-module_callout--info__zpyMT","callout--info__icon":"Callout-module_callout--info__icon__hHBbh","callout--warning":"Callout-module_callout--warning__QhFli","callout--error":"Callout-module_callout--error__-HDOj","callout--success":"Callout-module_callout--success__f1lTK","callout__wrapper":"Callout-module_callout__wrapper__jooXm","loading_animation":"Callout-module_loading_animation__9m516","MoveInTop":"Callout-module_MoveInTop__fio2m","fadeInDown":"Callout-module_fadeInDown__webmy","fadeUp":"Callout-module_fadeUp__uXBP6"};
1
+ var styles = {"margin-top":"Callout-module_margin-top__dS2UF","padding-top":"Callout-module_padding-top__aJrE4","margin-top--1":"Callout-module_margin-top--1__eBfEL","padding-top--1":"Callout-module_padding-top--1__rrL2e","margin-top--2":"Callout-module_margin-top--2__Ej-fE","padding-top--2":"Callout-module_padding-top--2__NtBHH","margin-top--3":"Callout-module_margin-top--3__AsHPR","padding-top--3":"Callout-module_padding-top--3__CjXpH","margin-top--4":"Callout-module_margin-top--4__3ji03","padding-top--4":"Callout-module_padding-top--4__BdcKb","margin-top--5":"Callout-module_margin-top--5__j3Qds","padding-top--5":"Callout-module_padding-top--5__TWT9C","margin-top--6":"Callout-module_margin-top--6__GQFRt","padding-top--6":"Callout-module_padding-top--6__4bYvI","margin-top--7":"Callout-module_margin-top--7__ArvNz","padding-top--7":"Callout-module_padding-top--7__PnU3M","margin-top--8":"Callout-module_margin-top--8__DvN7J","padding-top--8":"Callout-module_padding-top--8__qunY9","margin-top--9":"Callout-module_margin-top--9__mSjxY","padding-top--9":"Callout-module_padding-top--9__N4Z2b","margin-top--10":"Callout-module_margin-top--10__bJrtu","padding-top--10":"Callout-module_padding-top--10__JBw3e","margin-top--11":"Callout-module_margin-top--11__vnKG4","padding-top--11":"Callout-module_padding-top--11__w1mSs","margin-top--12":"Callout-module_margin-top--12__XM8gt","padding-top--12":"Callout-module_padding-top--12__iuEYZ","margin-bottom":"Callout-module_margin-bottom__UlOKu","padding-bottom":"Callout-module_padding-bottom__-XwJQ","margin-bottom--1":"Callout-module_margin-bottom--1__LxnVH","padding-bottom--1":"Callout-module_padding-bottom--1__MfyXw","margin-bottom--2":"Callout-module_margin-bottom--2__nelQj","padding-bottom--2":"Callout-module_padding-bottom--2__9MX1j","margin-bottom--3":"Callout-module_margin-bottom--3__VfA8y","padding-bottom--3":"Callout-module_padding-bottom--3__FRllS","margin-bottom--4":"Callout-module_margin-bottom--4__-j-tS","padding-bottom--4":"Callout-module_padding-bottom--4__sJzsQ","margin-bottom--5":"Callout-module_margin-bottom--5__0hYDy","padding-bottom--5":"Callout-module_padding-bottom--5__c4BQo","margin-bottom--6":"Callout-module_margin-bottom--6__8Ny2B","padding-bottom--6":"Callout-module_padding-bottom--6__wNeJk","margin-bottom--7":"Callout-module_margin-bottom--7__0dYmE","padding-bottom--7":"Callout-module_padding-bottom--7__FueIs","margin-bottom--8":"Callout-module_margin-bottom--8__r93zU","padding-bottom--8":"Callout-module_padding-bottom--8__APcyf","margin-bottom--9":"Callout-module_margin-bottom--9__f6KUQ","padding-bottom--9":"Callout-module_padding-bottom--9__KVgqO","margin-bottom--10":"Callout-module_margin-bottom--10__DgHw9","padding-bottom--10":"Callout-module_padding-bottom--10__VeWlT","margin-bottom--11":"Callout-module_margin-bottom--11__MR5kg","padding-bottom--11":"Callout-module_padding-bottom--11__w-dVG","margin-bottom--12":"Callout-module_margin-bottom--12__65MMr","padding-bottom--12":"Callout-module_padding-bottom--12__6FT1T","margin-left":"Callout-module_margin-left__mb1jm","padding-left":"Callout-module_padding-left__cgzip","margin-left--1":"Callout-module_margin-left--1__DWFsG","padding-left--1":"Callout-module_padding-left--1__3nWMz","margin-left--2":"Callout-module_margin-left--2__ByTNO","padding-left--2":"Callout-module_padding-left--2__9-PLw","margin-left--3":"Callout-module_margin-left--3__0Iz7m","padding-left--3":"Callout-module_padding-left--3__FQgJY","margin-left--4":"Callout-module_margin-left--4__cmAQ4","padding-left--4":"Callout-module_padding-left--4__pW9OV","margin-left--5":"Callout-module_margin-left--5__qD5bN","padding-left--5":"Callout-module_padding-left--5__FaZO8","margin-left--6":"Callout-module_margin-left--6__h-dBW","padding-left--6":"Callout-module_padding-left--6__RT6JH","margin-left--7":"Callout-module_margin-left--7__9wZFI","padding-left--7":"Callout-module_padding-left--7__-31-c","margin-left--8":"Callout-module_margin-left--8__bbcki","padding-left--8":"Callout-module_padding-left--8__f3ctw","margin-left--9":"Callout-module_margin-left--9__0xlWQ","padding-left--9":"Callout-module_padding-left--9__QsNKP","margin-left--10":"Callout-module_margin-left--10__RfTZc","padding-left--10":"Callout-module_padding-left--10__2CqOz","margin-left--11":"Callout-module_margin-left--11__KWNFX","padding-left--11":"Callout-module_padding-left--11__qf3JJ","margin-left--12":"Callout-module_margin-left--12__-0GWw","padding-left--12":"Callout-module_padding-left--12__vNYbn","margin-right":"Callout-module_margin-right__CN33J","padding-right":"Callout-module_padding-right__Cn14a","margin-right--1":"Callout-module_margin-right--1__GAGZO","padding-right--1":"Callout-module_padding-right--1__qh8gH","margin-right--2":"Callout-module_margin-right--2__MjxOE","padding-right--2":"Callout-module_padding-right--2__CDawi","margin-right--3":"Callout-module_margin-right--3__w3PO-","padding-right--3":"Callout-module_padding-right--3__bOIL3","margin-right--4":"Callout-module_margin-right--4__wjZRG","padding-right--4":"Callout-module_padding-right--4__DNn-A","margin-right--5":"Callout-module_margin-right--5__JUYoz","padding-right--5":"Callout-module_padding-right--5__V1t3c","margin-right--6":"Callout-module_margin-right--6__UXR9-","padding-right--6":"Callout-module_padding-right--6__pVwQj","margin-right--7":"Callout-module_margin-right--7__ZwUec","padding-right--7":"Callout-module_padding-right--7__EHY0p","margin-right--8":"Callout-module_margin-right--8__k9asQ","padding-right--8":"Callout-module_padding-right--8__1Nqrm","margin-right--9":"Callout-module_margin-right--9__J8sMZ","padding-right--9":"Callout-module_padding-right--9__QYnAq","margin-right--10":"Callout-module_margin-right--10__CZ3Im","padding-right--10":"Callout-module_padding-right--10__Ji-ow","margin-right--11":"Callout-module_margin-right--11__xNfCV","padding-right--11":"Callout-module_padding-right--11__epPSq","margin-right--12":"Callout-module_margin-right--12__s30AM","padding-right--12":"Callout-module_padding-right--12__lLgou","error":"Callout-module_error__UeboU","font--primary":"Callout-module_font--primary__Ayv9J","font--secondary":"Callout-module_font--secondary__mBXUH","font--code":"Callout-module_font--code__fG36F","font-weight--400":"Callout-module_font-weight--400__VYsxM","font-weight--500":"Callout-module_font-weight--500__zXuRq","font-weight--600":"Callout-module_font-weight--600__fJDVt","font-weight--700":"Callout-module_font-weight--700__3kQTh","font-weight--800":"Callout-module_font-weight--800__5POjB","font-size--h1":"Callout-module_font-size--h1__9fzEM","font-size--h2":"Callout-module_font-size--h2__EowCg","font-size--h3":"Callout-module_font-size--h3__8EcUJ","font-size--h4":"Callout-module_font-size--h4__ferQ7","font-size--h5":"Callout-module_font-size--h5__43lHF","font-size--h6":"Callout-module_font-size--h6__GpBej","font-size--big":"Callout-module_font-size--big__-BXjA","font-size--button":"Callout-module_font-size--button__9KupW","font-size--p":"Callout-module_font-size--p__RJTna","font-size--small":"Callout-module_font-size--small__YEsJl","font-size--very-small":"Callout-module_font-size--very-small__gac5b","font-size--tiny":"Callout-module_font-size--tiny__-Bd4M","font-size--micro":"Callout-module_font-size--micro__ajNCO","line-height--large":"Callout-module_line-height--large__OStzV","line-height--normal":"Callout-module_line-height--normal__p5UA7","line-height--small":"Callout-module_line-height--small__2kXv9","line-height--very-small":"Callout-module_line-height--very-small__AS59u","text-align--center":"Callout-module_text-align--center__5JXeQ","category__header":"Callout-module_category__header__Edg04","a--highlighted":"Callout-module_a--highlighted__JmfE5","grecaptcha-badge":"Callout-module_grecaptcha-badge__7vWF5","container":"Callout-module_container__FV7VM","container--contents-centered":"Callout-module_container--contents-centered__zx2lp","container--no-padding":"Callout-module_container--no-padding__wI9Pc","page":"Callout-module_page__2bQ0P","page--contents-max-width":"Callout-module_page--contents-max-width__4p2pL","page--no-extra-padding":"Callout-module_page--no-extra-padding__lGzpM","page--no-max-width":"Callout-module_page--no-max-width__cF1qn","hr":"Callout-module_hr__iz4ZP","li--disabled":"Callout-module_li--disabled__09IJ1","block":"Callout-module_block__cdSSP","callout":"Callout-module_callout__kEgS8","callout__icon":"Callout-module_callout__icon__z-ZHp","callout--info":"Callout-module_callout--info__zpyMT","callout--info__icon":"Callout-module_callout--info__icon__hHBbh","callout--warning":"Callout-module_callout--warning__QhFli","callout--error":"Callout-module_callout--error__-HDOj","callout--success":"Callout-module_callout--success__f1lTK","callout__wrapper":"Callout-module_callout__wrapper__jooXm","loading_animation":"Callout-module_loading_animation__9m516","MoveInTop":"Callout-module_MoveInTop__fio2m","fadeInDown":"Callout-module_fadeInDown__webmy","fadeUp":"Callout-module_fadeUp__uXBP6"};
2
2
 
3
3
  export { styles as default };
4
4
  //# sourceMappingURL=Callout.module.scss.js.map
@@ -0,0 +1,4 @@
1
+ var styles = {"margin-top":"TocNode-module_margin-top__Ogv5T","padding-top":"TocNode-module_padding-top__AHpKG","margin-top--1":"TocNode-module_margin-top--1__zvFhv","padding-top--1":"TocNode-module_padding-top--1__T8fjh","margin-top--2":"TocNode-module_margin-top--2__34-Iu","padding-top--2":"TocNode-module_padding-top--2__okSvN","margin-top--3":"TocNode-module_margin-top--3__ts-Vt","padding-top--3":"TocNode-module_padding-top--3__XvFL1","margin-top--4":"TocNode-module_margin-top--4__Qc-Vm","padding-top--4":"TocNode-module_padding-top--4__vzNK5","margin-top--5":"TocNode-module_margin-top--5__tpxvM","padding-top--5":"TocNode-module_padding-top--5__hcaJt","margin-top--6":"TocNode-module_margin-top--6__WfaH9","padding-top--6":"TocNode-module_padding-top--6__7gEmf","margin-top--7":"TocNode-module_margin-top--7__c-y05","padding-top--7":"TocNode-module_padding-top--7__aiwiA","margin-top--8":"TocNode-module_margin-top--8__jvaE-","padding-top--8":"TocNode-module_padding-top--8__-BGju","margin-top--9":"TocNode-module_margin-top--9__8OGbw","padding-top--9":"TocNode-module_padding-top--9__nkx4w","margin-top--10":"TocNode-module_margin-top--10__68k9M","padding-top--10":"TocNode-module_padding-top--10__muZvK","margin-top--11":"TocNode-module_margin-top--11__e-A20","padding-top--11":"TocNode-module_padding-top--11__1ucXq","margin-top--12":"TocNode-module_margin-top--12__dGFhY","padding-top--12":"TocNode-module_padding-top--12__UsCRU","margin-bottom":"TocNode-module_margin-bottom__fW9cE","padding-bottom":"TocNode-module_padding-bottom__StTIt","margin-bottom--1":"TocNode-module_margin-bottom--1__d-Q31","padding-bottom--1":"TocNode-module_padding-bottom--1__xfvm7","margin-bottom--2":"TocNode-module_margin-bottom--2__jDlTD","padding-bottom--2":"TocNode-module_padding-bottom--2__o3V2P","margin-bottom--3":"TocNode-module_margin-bottom--3__9DnaF","padding-bottom--3":"TocNode-module_padding-bottom--3__hxcdg","margin-bottom--4":"TocNode-module_margin-bottom--4__WnEIP","padding-bottom--4":"TocNode-module_padding-bottom--4__4zSJn","margin-bottom--5":"TocNode-module_margin-bottom--5__wL9Ne","padding-bottom--5":"TocNode-module_padding-bottom--5__IqYG-","margin-bottom--6":"TocNode-module_margin-bottom--6__eNOG6","padding-bottom--6":"TocNode-module_padding-bottom--6__YdvI7","margin-bottom--7":"TocNode-module_margin-bottom--7__KUFUK","padding-bottom--7":"TocNode-module_padding-bottom--7__ygSn0","margin-bottom--8":"TocNode-module_margin-bottom--8__nOVRB","padding-bottom--8":"TocNode-module_padding-bottom--8__6hyLl","margin-bottom--9":"TocNode-module_margin-bottom--9__fynWq","padding-bottom--9":"TocNode-module_padding-bottom--9__UlUEw","margin-bottom--10":"TocNode-module_margin-bottom--10__sHzWe","padding-bottom--10":"TocNode-module_padding-bottom--10__9uEpk","margin-bottom--11":"TocNode-module_margin-bottom--11__NoGHl","padding-bottom--11":"TocNode-module_padding-bottom--11__no9vn","margin-bottom--12":"TocNode-module_margin-bottom--12__kUG-q","padding-bottom--12":"TocNode-module_padding-bottom--12__keScA","margin-left":"TocNode-module_margin-left__YD4P0","padding-left":"TocNode-module_padding-left__loWvi","margin-left--1":"TocNode-module_margin-left--1__duWm2","padding-left--1":"TocNode-module_padding-left--1__x26oI","margin-left--2":"TocNode-module_margin-left--2__wW8Xa","padding-left--2":"TocNode-module_padding-left--2__1BSaF","margin-left--3":"TocNode-module_margin-left--3__lGdyT","padding-left--3":"TocNode-module_padding-left--3__M5TMw","margin-left--4":"TocNode-module_margin-left--4__552IN","padding-left--4":"TocNode-module_padding-left--4__euIHe","margin-left--5":"TocNode-module_margin-left--5__ayByu","padding-left--5":"TocNode-module_padding-left--5__41-1-","margin-left--6":"TocNode-module_margin-left--6__YBrdy","padding-left--6":"TocNode-module_padding-left--6__Pz0p8","margin-left--7":"TocNode-module_margin-left--7__Q-P0g","padding-left--7":"TocNode-module_padding-left--7__nh7i0","margin-left--8":"TocNode-module_margin-left--8__eMsG4","padding-left--8":"TocNode-module_padding-left--8__1qDxM","margin-left--9":"TocNode-module_margin-left--9__KLfnP","padding-left--9":"TocNode-module_padding-left--9__HWx3U","margin-left--10":"TocNode-module_margin-left--10__GBbx0","padding-left--10":"TocNode-module_padding-left--10__anfGM","margin-left--11":"TocNode-module_margin-left--11__yEs0u","padding-left--11":"TocNode-module_padding-left--11__J2WMr","margin-left--12":"TocNode-module_margin-left--12__iwhve","padding-left--12":"TocNode-module_padding-left--12__t-jiz","margin-right":"TocNode-module_margin-right__AMvH2","padding-right":"TocNode-module_padding-right__rpAMU","margin-right--1":"TocNode-module_margin-right--1__9hjSa","padding-right--1":"TocNode-module_padding-right--1__q8--P","margin-right--2":"TocNode-module_margin-right--2__-h7kr","padding-right--2":"TocNode-module_padding-right--2__i3vFY","margin-right--3":"TocNode-module_margin-right--3__bpvh3","padding-right--3":"TocNode-module_padding-right--3__A4NMh","margin-right--4":"TocNode-module_margin-right--4__5vBFO","padding-right--4":"TocNode-module_padding-right--4__KNRf3","margin-right--5":"TocNode-module_margin-right--5__8F2Pd","padding-right--5":"TocNode-module_padding-right--5__ADNNU","margin-right--6":"TocNode-module_margin-right--6__haTIR","padding-right--6":"TocNode-module_padding-right--6__hNIcu","margin-right--7":"TocNode-module_margin-right--7__ZBZX4","padding-right--7":"TocNode-module_padding-right--7__jE-yV","margin-right--8":"TocNode-module_margin-right--8__SZ1BE","padding-right--8":"TocNode-module_padding-right--8__QQm5i","margin-right--9":"TocNode-module_margin-right--9__1KJco","padding-right--9":"TocNode-module_padding-right--9__bMQlW","margin-right--10":"TocNode-module_margin-right--10__FcLVR","padding-right--10":"TocNode-module_padding-right--10__4A6qb","margin-right--11":"TocNode-module_margin-right--11__e155j","padding-right--11":"TocNode-module_padding-right--11__5-u8k","margin-right--12":"TocNode-module_margin-right--12__mZVKB","padding-right--12":"TocNode-module_padding-right--12__kuqDY","error":"TocNode-module_error__Hlb6m","font--primary":"TocNode-module_font--primary__CRk4V","font--secondary":"TocNode-module_font--secondary__UejbC","font--code":"TocNode-module_font--code__ucfwq","font-weight--400":"TocNode-module_font-weight--400__xzAZM","font-weight--500":"TocNode-module_font-weight--500__AfToc","font-weight--600":"TocNode-module_font-weight--600__nvn7K","font-weight--700":"TocNode-module_font-weight--700__ywq6K","font-weight--800":"TocNode-module_font-weight--800__U9UHi","font-size--h1":"TocNode-module_font-size--h1__SQvb5","font-size--h2":"TocNode-module_font-size--h2__hDaTr","font-size--h3":"TocNode-module_font-size--h3__3ov1v","font-size--h4":"TocNode-module_font-size--h4__nXGe7","font-size--h5":"TocNode-module_font-size--h5__hby4y","font-size--h6":"TocNode-module_font-size--h6__nXkt-","font-size--big":"TocNode-module_font-size--big__F7gRB","font-size--button":"TocNode-module_font-size--button__Gy7ry","font-size--p":"TocNode-module_font-size--p__i89-8","font-size--small":"TocNode-module_font-size--small__nM821","font-size--very-small":"TocNode-module_font-size--very-small__vEgQm","font-size--tiny":"TocNode-module_font-size--tiny__Xrlk2","font-size--micro":"TocNode-module_font-size--micro__g12V-","line-height--large":"TocNode-module_line-height--large__iFblE","line-height--normal":"TocNode-module_line-height--normal__cGgk8","line-height--small":"TocNode-module_line-height--small__v1-tQ","line-height--very-small":"TocNode-module_line-height--very-small__guFgk","text-align--center":"TocNode-module_text-align--center__UiMbU","category__header":"TocNode-module_category__header__TxLQX","a--highlighted":"TocNode-module_a--highlighted__KpPUK","grecaptcha-badge":"TocNode-module_grecaptcha-badge__MtOmc","container":"TocNode-module_container__lJX0X","container--contents-centered":"TocNode-module_container--contents-centered__SyXK5","container--no-padding":"TocNode-module_container--no-padding__-GPQx","page":"TocNode-module_page__XmMOm","page--contents-max-width":"TocNode-module_page--contents-max-width__a9wqT","page--no-extra-padding":"TocNode-module_page--no-extra-padding__xtQbg","page--no-max-width":"TocNode-module_page--no-max-width__mifQf","hr":"TocNode-module_hr__9oSQb","li--disabled":"TocNode-module_li--disabled__S1DJ3","block":"TocNode-module_block__6-aLr","toc-node__title":"TocNode-module_toc-node__title__Fqq9L","fadeInDown":"TocNode-module_fadeInDown__3aHIH","toc-node__title--active":"TocNode-module_toc-node__title--active__8WI6n","toc-node__title--sub":"TocNode-module_toc-node__title--sub__YYK1i","toc-node__title--sub-sub":"TocNode-module_toc-node__title--sub-sub__sCOE9","toc-node__children--sub-sub":"TocNode-module_toc-node__children--sub-sub__5SLID","toc-node__children--sub":"TocNode-module_toc-node__children--sub__oovR3","loading_animation":"TocNode-module_loading_animation__7zt5j","MoveInTop":"TocNode-module_MoveInTop__KWNfL","fadeUp":"TocNode-module_fadeUp__9Aftz"};
2
+
3
+ export { styles as default };
4
+ //# sourceMappingURL=TocNode.module.scss.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TocNode.module.scss.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
@@ -7,7 +7,7 @@ interface BlogProperties {
7
7
  }
8
8
  export interface ForwardedReference {
9
9
  parentRef: HTMLDivElement;
10
- childRefs: HTMLDivElement[];
10
+ childRefs: ForwardedReference[];
11
11
  }
12
12
  declare const Blog: ({ children, title, jsonLd, }: BlogProperties) => import("react/jsx-runtime").JSX.Element;
13
13
  export default Blog;
@@ -1 +1 @@
1
- {"version":3,"file":"BlogDynamic.d.ts","sourceRoot":"","sources":["../../../src/dynamicComponents/BlogDynamic.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAc,SAAS,EAAiB,MAAM,OAAO,CAAC;AAClE,OAAO,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAKrD,UAAU,cAAc;IACvB,QAAQ,EAAE,SAAS,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,WAAW,CAAC,KAAK,CAAC,CAAC;CAC5B;AAED,MAAM,WAAW,kBAAkB;IAClC,SAAS,EAAE,cAAc,CAAC;IAC1B,SAAS,EAAE,cAAc,EAAE,CAAC;CAC5B;AAgBD,QAAA,MAAM,IAAI,GAAI,8BAIX,cAAc,4CA+QhB,CAAC;AAEF,eAAe,IAAI,CAAC"}
1
+ {"version":3,"file":"BlogDynamic.d.ts","sourceRoot":"","sources":["../../../src/dynamicComponents/BlogDynamic.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,SAAS,EAAiB,MAAM,OAAO,CAAC;AACtD,OAAO,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AASrD,UAAU,cAAc;IACvB,QAAQ,EAAE,SAAS,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,WAAW,CAAC,KAAK,CAAC,CAAC;CAC5B;AAED,MAAM,WAAW,kBAAkB;IAClC,SAAS,EAAE,cAAc,CAAC;IAC1B,SAAS,EAAE,kBAAkB,EAAE,CAAC;CAChC;AAoBD,QAAA,MAAM,IAAI,GAAI,8BAIX,cAAc,4CAuDhB,CAAC;AAEF,eAAe,IAAI,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"BlogSectionDynamic.d.ts","sourceRoot":"","sources":["../../../src/dynamicComponents/BlogSectionDynamic.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAItD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAGxD,UAAU,cAAc;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAC/B;AAED,QAAA,MAAM,WAAW,+FAkEhB,CAAC;AAIF,eAAe,WAAW,CAAC"}
1
+ {"version":3,"file":"BlogSectionDynamic.d.ts","sourceRoot":"","sources":["../../../src/dynamicComponents/BlogSectionDynamic.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAItD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAGxD,UAAU,cAAc;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAC/B;AAED,QAAA,MAAM,WAAW,+FA+EhB,CAAC;AAIF,eAAe,WAAW,CAAC"}
@@ -0,0 +1,22 @@
1
+ import type { Dispatch, SetStateAction } from 'react';
2
+ import type { ForwardedReference } from '../dynamicComponents/BlogDynamic';
3
+ export interface SectionReferenceValue {
4
+ el: HTMLElement;
5
+ title: string;
6
+ depth: number;
7
+ }
8
+ export interface CategoryTitleValue extends SectionReferenceValue {
9
+ lastUpdatedAt: number;
10
+ }
11
+ export type CategoryTitle = Map<string, CategoryTitleValue>;
12
+ interface Options {
13
+ visibleTitle: string | null;
14
+ setVisibleTitle: Dispatch<SetStateAction<string | null>>;
15
+ setShowTOC: Dispatch<SetStateAction<boolean>>;
16
+ }
17
+ export declare function useCategoryTitles({ visibleTitle, setVisibleTitle, setShowTOC, }: Options): {
18
+ categoryTitles: CategoryTitle;
19
+ handleSectionReference: (element: ForwardedReference) => void;
20
+ };
21
+ export {};
22
+ //# sourceMappingURL=useCategoryTitles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useCategoryTitles.d.ts","sourceRoot":"","sources":["../../../src/hooks/useCategoryTitles.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAEtD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AAE3E,MAAM,WAAW,qBAAqB;IACrC,EAAE,EAAE,WAAW,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,kBAAmB,SAAQ,qBAAqB;IAChE,aAAa,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,MAAM,aAAa,GAAG,GAAG,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAC;AAI5D,UAAU,OAAO;IAChB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,eAAe,EAAE,QAAQ,CAAC,cAAc,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC;IACzD,UAAU,EAAE,QAAQ,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC;CAC9C;AAED,wBAAgB,iBAAiB,CAAC,EACjC,YAAY,EACZ,eAAe,EACf,UAAU,GACV,EAAE,OAAO;;sCAkGE,kBAAkB;EAiB7B"}
@@ -0,0 +1,11 @@
1
+ import type { Dispatch, MouseEvent, SetStateAction } from 'react';
2
+ import type { CategoryTitle } from './useCategoryTitles';
3
+ interface Options {
4
+ categoryTitles: CategoryTitle;
5
+ setVisibleTitle: Dispatch<SetStateAction<string | null>>;
6
+ }
7
+ export declare function useSectionObserver({ categoryTitles, setVisibleTitle }: Options): {
8
+ handleClickCategoryTitle: (event: MouseEvent<HTMLParagraphElement>) => void;
9
+ };
10
+ export {};
11
+ //# sourceMappingURL=useSectionObserver.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useSectionObserver.d.ts","sourceRoot":"","sources":["../../../src/hooks/useSectionObserver.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAGlE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAoBzD,UAAU,OAAO;IAChB,cAAc,EAAE,aAAa,CAAC;IAC9B,eAAe,EAAE,QAAQ,CAAC,cAAc,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC;CACzD;AAED,wBAAgB,kBAAkB,CAAC,EAAE,cAAc,EAAE,eAAe,EAAE,EAAE,OAAO;sCAqDrE,UAAU,CAAC,oBAAoB,CAAC;EAgBzC"}
@@ -0,0 +1,16 @@
1
+ import type { MouseEvent } from 'react';
2
+ export interface TocNode {
3
+ id: string;
4
+ title: string;
5
+ depth: number;
6
+ children: TocNode[];
7
+ }
8
+ interface TocNodeProperties {
9
+ node: TocNode;
10
+ index: number;
11
+ visibleTitle: string | null;
12
+ onClick: (e: MouseEvent<HTMLParagraphElement>) => void;
13
+ }
14
+ declare const TocNode: ({ node, index, visibleTitle, onClick }: TocNodeProperties) => import("react/jsx-runtime").JSX.Element;
15
+ export default TocNode;
16
+ //# sourceMappingURL=TocNodeStatic.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TocNodeStatic.d.ts","sourceRoot":"","sources":["../../../src/staticComponents/TocNodeStatic.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAIxC,MAAM,WAAW,OAAO;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,OAAO,EAAE,CAAC;CACpB;AAED,UAAU,iBAAiB;IAC1B,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,OAAO,EAAE,CAAC,CAAC,EAAE,UAAU,CAAC,oBAAoB,CAAC,KAAK,IAAI,CAAC;CACvD;AAED,QAAA,MAAM,OAAO,GAAI,wCAAwC,iBAAiB,4CA+BzE,CAAC;AAEF,eAAe,OAAO,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@san-siva/blogkit",
3
- "version": "1.1.20",
3
+ "version": "1.1.21",
4
4
  "description": "A reusable blog component library for React/Next.js applications with code highlighting, diagrams, and rich content features",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -23,7 +23,9 @@
23
23
  ],
24
24
  "scripts": {
25
25
  "build": "rollup -c && tsc --emitDeclarationOnly --outDir dist/types && cp -r src/assets dist/",
26
- "dev": "rollup -c -w"
26
+ "dev": "rollup -c -w",
27
+ "lint": "tsc --noEmit",
28
+ "prepublishOnly": "npm ci && npm run lint && npm run build"
27
29
  },
28
30
  "keywords": [
29
31
  "blog",
@@ -38,7 +40,7 @@
38
40
  "author": "Santhosh Siva",
39
41
  "license": "MIT",
40
42
  "dependencies": {
41
- "@san-siva/stylekit": "^1.0.8",
43
+ "@san-siva/stylekit": "^1.0.11",
42
44
  "schema-dts": "^1.1.5"
43
45
  },
44
46
  "peerDependencies": {
@@ -4,18 +4,19 @@ import {
4
4
  Children,
5
5
  cloneElement,
6
6
  isValidElement,
7
- useCallback,
8
- useEffect,
9
- useRef,
10
7
  useState,
11
8
  } from 'react';
12
9
  import { useSpring, animated, config } from '@react-spring/web';
13
10
 
14
- import type { MouseEvent, ReactNode, RefAttributes } from 'react';
11
+ import type { ReactNode, RefAttributes } from 'react';
15
12
  import type { Thing, WithContext } from 'schema-dts';
16
13
 
17
14
  import styles from '../styles/Blog.module.scss';
18
- import lockScrollUpdates from '../utils/lockScrollUpdates';
15
+ import { useCategoryTitles } from '../hooks/useCategoryTitles';
16
+ import { useSectionObserver } from '../hooks/useSectionObserver';
17
+ import type { CategoryTitleValue } from '../hooks/useCategoryTitles';
18
+ import TocNodeStatic from '../staticComponents/TocNodeStatic';
19
+ import type { TocNode } from '../staticComponents/TocNodeStatic';
19
20
 
20
21
  interface BlogProperties {
21
22
  children: ReactNode;
@@ -25,244 +26,45 @@ interface BlogProperties {
25
26
 
26
27
  export interface ForwardedReference {
27
28
  parentRef: HTMLDivElement;
28
- childRefs: HTMLDivElement[];
29
+ childRefs: ForwardedReference[];
29
30
  }
30
31
 
31
- interface SectionReferenceValue {
32
- el: HTMLElement;
33
- title: string;
34
- isSubSection: boolean;
35
- }
36
-
37
- type SectionReference = Map<string, SectionReferenceValue>;
38
-
39
- interface CategoryTitleValue extends SectionReferenceValue {
40
- lastUpdatedAt: number;
41
- }
42
-
43
- type CategoryTitle = Map<string, CategoryTitleValue>;
32
+ const buildTocTree = (entries: [string, CategoryTitleValue][]): TocNode[] => {
33
+ const roots: TocNode[] = [];
34
+ const stack: TocNode[] = [];
35
+ for (const [id, { title, depth }] of entries) {
36
+ const node: TocNode = { id, title, depth, children: [] };
37
+ while (stack.length > 0 && stack[stack.length - 1].depth >= depth) {
38
+ stack.pop();
39
+ }
40
+ if (stack.length === 0) {
41
+ roots.push(node);
42
+ } else {
43
+ stack[stack.length - 1].children.push(node);
44
+ }
45
+ stack.push(node);
46
+ }
47
+ return roots;
48
+ };
44
49
 
45
50
  const Blog = ({
46
51
  children,
47
52
  title = 'In this article',
48
53
  jsonLd,
49
54
  }: BlogProperties) => {
50
- const sectionReferences = useRef<SectionReference>(new Map());
51
- const [categoryTitles, setCategoryTitles] = useState<CategoryTitle>(
52
- new Map()
53
- );
54
55
  const [visibleTitle, setVisibleTitle] = useState<string | null>(null);
55
56
  const [showTOC, setShowTOC] = useState(false);
56
57
 
57
- const updateTimerRef = useRef<ReturnType<typeof setTimeout> | null>(null);
58
- const showTOCTimerRef = useRef<ReturnType<typeof setTimeout> | null>(null);
59
- const isClickScrolling = useRef(false);
60
- const scrollEndHandlerRef = useRef<(() => void) | null>(null);
61
- const intersectionObserversRef = useRef<Map<string, IntersectionObserver>>(
62
- new Map()
63
- );
64
-
65
- const sortByDomPosition = useCallback(
66
- (
67
- [, a]: [string, SectionReferenceValue],
68
- [, b]: [string, SectionReferenceValue]
69
- ) => {
70
- const position = a.el.compareDocumentPosition(b.el);
71
- if (position & Node.DOCUMENT_POSITION_FOLLOWING) {
72
- return -1; // a comes before b
73
- } else if (position & Node.DOCUMENT_POSITION_PRECEDING) {
74
- return 1; // b comes before a
75
- }
76
- return 0;
77
- },
78
- []
79
- );
80
-
81
- const updateCategoryTitles = useCallback(() => {
82
- const now = Date.now();
83
- const newCategoryTitles = new Map<string, CategoryTitleValue>();
84
-
85
- // Sort sections by their DOM position to maintain correct order
86
- const sectionsArray = Array.from(sectionReferences.current.entries());
87
- sectionsArray.sort(sortByDomPosition);
88
-
89
- let firstSectionId: string | null = null;
90
- for (const [id, { title, el, isSubSection }] of sectionsArray) {
91
- if (!firstSectionId) {
92
- firstSectionId = id;
93
- }
94
- newCategoryTitles.set(id, {
95
- el,
96
- title,
97
- lastUpdatedAt: now,
98
- isSubSection,
99
- });
100
- }
101
-
102
- if (newCategoryTitles.size === 0) return;
103
-
104
- setCategoryTitles(newCategoryTitles);
105
- if (!showTOC) setShowTOC(true);
106
-
107
- if (visibleTitle) return;
108
- setVisibleTitle(firstSectionId);
109
- }, [visibleTitle, sortByDomPosition, showTOC, setShowTOC]);
110
-
111
- const debounceUpdateCategoryTitles = useCallback(() => {
112
- // Clear existing timer and set a new one to batch updates
113
- if (updateTimerRef.current) {
114
- clearTimeout(updateTimerRef.current);
115
- }
116
- updateTimerRef.current = setTimeout(() => {
117
- updateCategoryTitles();
118
- }, 200);
119
- }, [updateCategoryTitles]);
120
-
121
- useEffect(() => {
122
- for (const [id, { el }] of categoryTitles) {
123
- const observer = new IntersectionObserver(
124
- ([entry]) => {
125
- if (!entry.isIntersecting) return;
126
- if (isClickScrolling.current) return;
127
- if (document.body.scrollTop === 0) return;
128
- setVisibleTitle(visibleId => {
129
- if (visibleId === id && !entry.isIntersecting) return null;
130
- if (entry.isIntersecting) return id;
131
- return visibleId;
132
- });
133
- const url = new URL(window.location.href);
134
- url.searchParams.set('section', id);
135
- window.history.replaceState({}, '', url.toString());
136
- },
137
- { threshold: 0.1 }
138
- );
139
- intersectionObserversRef.current.set(id, observer);
140
- observer.observe(el as HTMLElement);
141
- }
142
- }, [categoryTitles.size]);
143
-
144
- useEffect(() => {
145
- return () => {
146
- if (updateTimerRef.current) {
147
- clearTimeout(updateTimerRef.current);
148
- }
149
- if (showTOCTimerRef.current) {
150
- clearTimeout(showTOCTimerRef.current);
151
- }
152
- if (scrollEndHandlerRef.current) {
153
- document.body.removeEventListener(
154
- 'scrollend',
155
- scrollEndHandlerRef.current
156
- );
157
- }
158
- if (intersectionObserversRef.current) {
159
- for (const observer of intersectionObserversRef.current.values()) {
160
- observer.disconnect();
161
- }
162
- }
163
- };
164
- }, []);
165
-
166
- const getSectionFromUrl = () => {
167
- const url = new URL(window.location.href);
168
- const section = url.searchParams.get('section');
169
- if (!section) return null;
170
- return section;
171
- };
172
-
173
- const updateUrl = (id: string) => {
174
- const url = new URL(window.location.href);
175
- url.searchParams.set('section', id);
176
- window.history.replaceState({}, '', url.toString());
177
- };
178
-
179
- const scrollIntoView = (element: HTMLElement) => {
180
- if (!element) return;
181
- const top =
182
- element.getBoundingClientRect().top + document.body.scrollTop - 100;
183
- document.body.scrollTo({ top, behavior: 'smooth' });
184
- };
185
-
186
- // On initial load, scroll to section specified in URL
187
- useEffect(() => {
188
- if (categoryTitles.size === 0) return;
189
- const section = getSectionFromUrl();
190
- if (!section) {
191
- return;
192
- }
193
- const entry = categoryTitles.get(section);
194
- if (!entry) {
195
- return;
196
- }
197
- scrollIntoView(entry.el);
198
- lockScrollUpdates(
199
- section,
200
- isClickScrolling,
201
- scrollEndHandlerRef,
202
- setVisibleTitle
203
- );
204
- }, [categoryTitles.size]);
205
-
206
- const handleSectionReference = useCallback(
207
- (element: ForwardedReference) => {
208
- if (!element) return;
209
- const { parentRef, childRefs } = element;
210
-
211
- // Add parent section reference
212
- if (parentRef) {
213
- const id = parentRef.dataset.id;
214
- const title = parentRef.dataset.title;
215
- if (id && title) {
216
- sectionReferences.current.set(id, {
217
- el: parentRef,
218
- title,
219
- isSubSection: false,
220
- });
221
- }
222
- }
223
-
224
- // Add child section references
225
- if (Array.isArray(childRefs)) {
226
- for (const childRef of childRefs) {
227
- if (!childRef) continue;
228
- const id = childRef.dataset.id;
229
- const title = childRef.dataset.title;
230
- if (id && title) {
231
- sectionReferences.current.set(id, {
232
- el: childRef,
233
- title,
234
- isSubSection: true,
235
- });
236
- }
237
- }
238
- }
239
-
240
- debounceUpdateCategoryTitles();
241
- },
242
- [debounceUpdateCategoryTitles]
243
- );
244
-
245
- const handleClickCategoryTitle = (
246
- error: MouseEvent<HTMLParagraphElement>
247
- ) => {
248
- const id = error.currentTarget.dataset.id;
249
- const index = error.currentTarget.dataset.idx;
250
- if (!id || !index) return;
251
-
252
- const { el } = categoryTitles.get(id) || {};
253
- if (!el) return;
254
-
255
- updateUrl(id);
256
-
257
- scrollIntoView(el);
58
+ const { categoryTitles, handleSectionReference } = useCategoryTitles({
59
+ visibleTitle,
60
+ setVisibleTitle,
61
+ setShowTOC,
62
+ });
258
63
 
259
- lockScrollUpdates(
260
- id,
261
- isClickScrolling,
262
- scrollEndHandlerRef,
263
- setVisibleTitle
264
- );
265
- };
64
+ const { handleClickCategoryTitle } = useSectionObserver({
65
+ categoryTitles,
66
+ setVisibleTitle,
67
+ });
266
68
 
267
69
  const sidebarStyle = useSpring({
268
70
  opacity: showTOC ? 1 : 0,
@@ -292,28 +94,15 @@ const Blog = ({
292
94
  >
293
95
  {title}
294
96
  </p>
295
- {[...categoryTitles].map(
296
- ([id, { title, isSubSection }], index, array) => {
297
- const isNextSectionSubSection = array[index + 1]?.[1]?.isSubSection;
298
- return (
299
- <p
300
- key={id}
301
- data-idx={index}
302
- data-id={id}
303
- className={`${styles['category__title']} ${
304
- id === visibleTitle ? styles['category__title--active'] : ''
305
- } ${isSubSection ? styles['category__title--sub'] : ''} ${
306
- isSubSection && !isNextSectionSubSection
307
- ? styles['margin-bottom-imp--2']
308
- : ''
309
- }`}
310
- onClick={handleClickCategoryTitle}
311
- >
312
- {title}
313
- </p>
314
- );
315
- }
316
- )}
97
+ {buildTocTree([...categoryTitles]).map((node, i) => (
98
+ <TocNodeStatic
99
+ key={node.id}
100
+ node={node}
101
+ index={i}
102
+ visibleTitle={visibleTitle}
103
+ onClick={handleClickCategoryTitle}
104
+ />
105
+ ))}
317
106
  </animated.div>
318
107
  </div>
319
108
  );
@@ -5,6 +5,7 @@ import {
5
5
  cloneElement,
6
6
  forwardRef,
7
7
  isValidElement,
8
+ useEffect,
8
9
  useImperativeHandle,
9
10
  useRef,
10
11
  } from 'react';
@@ -49,13 +50,26 @@ const BlogSection = forwardRef<ForwardedReference, BlogProperties>(
49
50
  return handle;
50
51
  });
51
52
 
53
+ // Re-register when title or category changes so the TOC reflects the updated heading
54
+ useEffect(() => {
55
+ if (typeof forwardedReference === 'function' && imperativeHandleRef.current) {
56
+ forwardedReference(imperativeHandleRef.current);
57
+ }
58
+ }, [title, category]); // eslint-disable-line react-hooks/exhaustive-deps
59
+
52
60
  const handleChildReferences = (element: ForwardedReference | null) => {
53
61
  if (!element) return;
54
62
  const { parentRef: subParentReference } = element;
55
63
  if (!subParentReference) return;
56
- childReferences.current.push(subParentReference);
57
64
 
58
- // Re-trigger parent ref callback with updated children
65
+ // Avoid registering the same child section twice
66
+ const alreadyRegistered = childReferences.current.some(
67
+ ref => ref.parentRef === subParentReference
68
+ );
69
+ if (!alreadyRegistered) {
70
+ childReferences.current.push(element);
71
+ }
72
+
59
73
  if (typeof forwardedReference === 'function' && imperativeHandleRef.current) {
60
74
  forwardedReference(imperativeHandleRef.current);
61
75
  }