@san-siva/blogkit 1.1.41 → 1.1.43
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.
- package/dist/cjs/components/Blog.js +2 -2
- package/dist/cjs/components/Blog.js.map +1 -1
- package/dist/cjs/components/MermaidViewport.js.map +1 -1
- package/dist/cjs/dynamicComponents/BlogDynamic.js +2 -2
- package/dist/cjs/dynamicComponents/BlogDynamic.js.map +1 -1
- package/dist/cjs/hooks/useCategoryTitles.js +8 -14
- package/dist/cjs/hooks/useCategoryTitles.js.map +1 -1
- package/dist/cjs/index.css +1 -1
- package/dist/cjs/index.css.map +1 -1
- package/dist/cjs/staticComponents/BlogStatic.js +2 -2
- package/dist/cjs/staticComponents/BlogStatic.js.map +1 -1
- package/dist/cjs/staticComponents/TocNodeStatic.js +1 -1
- package/dist/cjs/staticComponents/TocNodeStatic.js.map +1 -1
- package/dist/cjs/styles/Blog.module.scss.js +1 -1
- package/dist/esm/components/Blog.js +2 -2
- package/dist/esm/components/Blog.js.map +1 -1
- package/dist/esm/components/MermaidViewport.js.map +1 -1
- package/dist/esm/dynamicComponents/BlogDynamic.js +2 -2
- package/dist/esm/dynamicComponents/BlogDynamic.js.map +1 -1
- package/dist/esm/hooks/useCategoryTitles.js +8 -14
- package/dist/esm/hooks/useCategoryTitles.js.map +1 -1
- package/dist/esm/index.css +1 -1
- package/dist/esm/index.css.map +1 -1
- package/dist/esm/staticComponents/BlogStatic.js +2 -2
- package/dist/esm/staticComponents/BlogStatic.js.map +1 -1
- package/dist/esm/staticComponents/TocNodeStatic.js +1 -1
- package/dist/esm/staticComponents/TocNodeStatic.js.map +1 -1
- package/dist/esm/styles/Blog.module.scss.js +1 -1
- package/dist/types/components/Blog.d.ts +2 -1
- package/dist/types/components/Blog.d.ts.map +1 -1
- package/dist/types/components/BlogHeader.d.ts +1 -1
- package/dist/types/components/BlogHeader.d.ts.map +1 -1
- package/dist/types/components/BlogLink.d.ts +1 -1
- package/dist/types/components/BlogLink.d.ts.map +1 -1
- package/dist/types/components/Callout.d.ts +1 -1
- package/dist/types/components/Callout.d.ts.map +1 -1
- package/dist/types/components/CheckList.d.ts +1 -1
- package/dist/types/components/CheckList.d.ts.map +1 -1
- package/dist/types/components/CodeBlock.d.ts +1 -1
- package/dist/types/components/CodeBlock.d.ts.map +1 -1
- package/dist/types/components/Mermaid.d.ts +1 -1
- package/dist/types/components/Mermaid.d.ts.map +1 -1
- package/dist/types/components/MermaidControls.d.ts +1 -1
- package/dist/types/components/MermaidControls.d.ts.map +1 -1
- package/dist/types/components/MermaidViewport.d.ts +2 -2
- package/dist/types/components/MermaidViewport.d.ts.map +1 -1
- package/dist/types/components/Table.d.ts +1 -1
- package/dist/types/components/Table.d.ts.map +1 -1
- package/dist/types/dynamicComponents/BlogDynamic.d.ts +2 -1
- package/dist/types/dynamicComponents/BlogDynamic.d.ts.map +1 -1
- package/dist/types/dynamicComponents/BlogLinkDynamic.d.ts +1 -1
- package/dist/types/dynamicComponents/BlogLinkDynamic.d.ts.map +1 -1
- package/dist/types/dynamicComponents/CodeBlockDynamic.d.ts +1 -1
- package/dist/types/dynamicComponents/CodeBlockDynamic.d.ts.map +1 -1
- package/dist/types/dynamicComponents/MermaidDynamic.d.ts +1 -1
- package/dist/types/dynamicComponents/MermaidDynamic.d.ts.map +1 -1
- package/dist/types/hooks/useCategoryTitles.d.ts.map +1 -1
- package/dist/types/staticComponents/BlogHeaderStatic.d.ts +1 -1
- package/dist/types/staticComponents/BlogHeaderStatic.d.ts.map +1 -1
- package/dist/types/staticComponents/BlogLinkStatic.d.ts +1 -1
- package/dist/types/staticComponents/BlogLinkStatic.d.ts.map +1 -1
- package/dist/types/staticComponents/BlogSectionStatic.d.ts +1 -1
- package/dist/types/staticComponents/BlogSectionStatic.d.ts.map +1 -1
- package/dist/types/staticComponents/BlogStatic.d.ts +2 -1
- package/dist/types/staticComponents/BlogStatic.d.ts.map +1 -1
- package/dist/types/staticComponents/CalloutStatic.d.ts +1 -1
- package/dist/types/staticComponents/CalloutStatic.d.ts.map +1 -1
- package/dist/types/staticComponents/CheckListStatic.d.ts +1 -1
- package/dist/types/staticComponents/CheckListStatic.d.ts.map +1 -1
- package/dist/types/staticComponents/CodeBlockStatic.d.ts +1 -1
- package/dist/types/staticComponents/CodeBlockStatic.d.ts.map +1 -1
- package/dist/types/staticComponents/MermaidStatic.d.ts +1 -1
- package/dist/types/staticComponents/MermaidStatic.d.ts.map +1 -1
- package/dist/types/staticComponents/TableStatic.d.ts +1 -1
- package/dist/types/staticComponents/TableStatic.d.ts.map +1 -1
- package/dist/types/staticComponents/TocNodeStatic.d.ts +1 -1
- package/dist/types/staticComponents/TocNodeStatic.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/components/Blog.tsx +4 -3
- package/src/components/MermaidViewport.tsx +1 -1
- package/src/dynamicComponents/BlogDynamic.tsx +3 -1
- package/src/hooks/useCategoryTitles.ts +16 -18
- package/src/staticComponents/BlogStatic.tsx +4 -2
- package/src/staticComponents/TocNodeStatic.tsx +1 -1
- package/src/styles/Blog.module.scss +22 -4
- package/src/styles/Blog.module.scss.d.ts +1 -0
|
@@ -8,8 +8,8 @@ var react = require('react');
|
|
|
8
8
|
var BlogStatic = require('../staticComponents/BlogStatic.js');
|
|
9
9
|
|
|
10
10
|
const BlogDynamic = react.lazy(() => Promise.resolve().then(function () { return require('../dynamicComponents/BlogDynamic.js'); }));
|
|
11
|
-
const Blog = ({ children, title = 'In this article', jsonLd }) => {
|
|
12
|
-
return (jsxRuntime.jsx(react.Suspense, { fallback: jsxRuntime.jsx(BlogStatic.default, { jsonLd: jsonLd, children: children }), children: jsxRuntime.jsx(BlogDynamic, { title: title, jsonLd: jsonLd, children: children }) }));
|
|
11
|
+
const Blog = ({ children, title = 'In this article', jsonLd, increasedWidthMode = false }) => {
|
|
12
|
+
return (jsxRuntime.jsx(react.Suspense, { fallback: jsxRuntime.jsx(BlogStatic.default, { jsonLd: jsonLd, increasedWidthMode: increasedWidthMode, children: children }), children: jsxRuntime.jsx(BlogDynamic, { title: title, jsonLd: jsonLd, increasedWidthMode: increasedWidthMode, children: children }) }));
|
|
13
13
|
};
|
|
14
14
|
|
|
15
15
|
exports.default = Blog;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Blog.js","sources":["../../../src/components/Blog.tsx"],"sourcesContent":["'use client';\n\nimport { lazy, Suspense } from 'react';\nimport type { ReactNode } from 'react';\nimport type { Thing, WithContext } from 'schema-dts';\nimport BlogStatic from '../staticComponents/BlogStatic';\n\nconst BlogDynamic = lazy(() => import('../dynamicComponents/BlogDynamic'));\n\ninterface BlogProperties {\n\tchildren: ReactNode;\n\ttitle?: string;\n\tjsonLd?: WithContext<Thing>;\n}\n\nconst Blog = ({ children, title = 'In this article', jsonLd }: BlogProperties) => {\n\treturn (\n\t\t<Suspense fallback={<BlogStatic jsonLd={jsonLd}>{children}</BlogStatic>}>\n\t\t\t<BlogDynamic title={title} jsonLd={jsonLd}>{children}</BlogDynamic>\n\t\t</Suspense>\n\t);\n};\n\nexport default Blog;\n"],"names":["lazy","_jsx","Suspense","BlogStatic"],"mappings":";;;;;;;;AAOA,MAAM,WAAW,GAAGA,UAAI,CAAC,MAAM,oDAAO,qCAAkC,KAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"Blog.js","sources":["../../../src/components/Blog.tsx"],"sourcesContent":["'use client';\n\nimport { lazy, Suspense } from 'react';\nimport type { ReactNode } from 'react';\nimport type { Thing, WithContext } from 'schema-dts';\nimport BlogStatic from '../staticComponents/BlogStatic';\n\nconst BlogDynamic = lazy(() => import('../dynamicComponents/BlogDynamic'));\n\ninterface BlogProperties {\n\tchildren: ReactNode;\n\ttitle?: string;\n\tjsonLd?: WithContext<Thing>;\n\tincreasedWidthMode?: boolean;\n}\n\nconst Blog = ({ children, title = 'In this article', jsonLd, increasedWidthMode = false }: BlogProperties) => {\n\treturn (\n\t\t<Suspense fallback={<BlogStatic jsonLd={jsonLd} increasedWidthMode={increasedWidthMode}>{children}</BlogStatic>}>\n\t\t\t<BlogDynamic title={title} jsonLd={jsonLd} increasedWidthMode={increasedWidthMode}>{children}</BlogDynamic>\n\t\t</Suspense>\n\t);\n};\n\nexport default Blog;\n"],"names":["lazy","_jsx","Suspense","BlogStatic"],"mappings":";;;;;;;;AAOA,MAAM,WAAW,GAAGA,UAAI,CAAC,MAAM,oDAAO,qCAAkC,KAAC,CAAC;AAS1E,MAAM,IAAI,GAAG,CAAC,EAAE,QAAQ,EAAE,KAAK,GAAG,iBAAiB,EAAE,MAAM,EAAE,kBAAkB,GAAG,KAAK,EAAkB,KAAI;AAC5G,IAAA,QACCC,cAAA,CAACC,cAAQ,EAAA,EAAC,QAAQ,EAAED,cAAA,CAACE,kBAAU,EAAA,EAAC,MAAM,EAAE,MAAM,EAAE,kBAAkB,EAAE,kBAAkB,YAAG,QAAQ,EAAA,CAAc,EAAA,QAAA,EAC9GF,cAAA,CAAC,WAAW,EAAA,EAAC,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,kBAAkB,EAAE,kBAAkB,EAAA,QAAA,EAAG,QAAQ,EAAA,CAAe,EAAA,CACjG;AAEb;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MermaidViewport.js","sources":["../../../src/components/MermaidViewport.tsx"],"sourcesContent":["import { useEffect, useRef } from 'react';\n\nimport type { PanZoom } from '../hooks/usePanZoom';\n\ninterface MermaidViewportProps {\n\tclassName: string;\n\tdraggingClassName: string;\n\tpan: PanZoom;\n\tcontentRef: React.RefObject<HTMLDivElement>;\n\tcontentId?: string;\n\thidden?: boolean;\n}\n\nconst MermaidViewport = ({\n\tclassName,\n\tdraggingClassName,\n\tpan,\n\tcontentRef,\n\tcontentId,\n\thidden,\n}: MermaidViewportProps) => {\n\tconst viewportRef = useRef<HTMLDivElement>(null);\n\tconst { zoomAtPoint } = pan;\n\n\tuseEffect(() => {\n\t\tconst el = viewportRef.current;\n\t\tif (!el) return;\n\t\tconst onWheel = (e: WheelEvent) => {\n\t\t\tif (!e.ctrlKey) return;\n\t\t\te.preventDefault();\n\t\t\tconst rect = el.getBoundingClientRect();\n\t\t\tzoomAtPoint(e.deltaY, e.clientX - rect.left, e.clientY - rect.top);\n\t\t};\n\t\tel.addEventListener('wheel', onWheel, { passive: false });\n\t\treturn () => el.removeEventListener('wheel', onWheel);\n\t}, [zoomAtPoint]);\n\n\treturn (\n\t\t<div\n\t\t\tref={viewportRef}\n\t\t\tclassName={`${className} ${pan.isDragging ? draggingClassName : ''}`}\n\t\t\tstyle={hidden ? { display: 'none' } : undefined}\n\t\t\tonMouseDown={pan.onMouseDown}\n\t\t\tonMouseMove={pan.onMouseMove}\n\t\t\tonMouseUp={pan.onMouseUp}\n\t\t\tonMouseLeave={pan.onMouseUp}\n\t\t>\n\t\t\t<div\n\t\t\t\tstyle={{\n\t\t\t\t\ttransform: `translate(${pan.transform.x}px, ${pan.transform.y}px) scale(${pan.transform.scale})`,\n\t\t\t\t\ttransformOrigin: '0 0',\n\t\t\t\t\ttransition: pan.isDragging ? 'none' : 'transform 0.1s ease',\n\t\t\t\t}}\n\t\t\t>\n\t\t\t\t<div ref={contentRef} id={contentId} />\n\t\t\t</div>\n\t\t</div>\n\t);\n};\n\nexport default MermaidViewport;\n"],"names":["useRef","useEffect","_jsx"],"mappings":";;;;;;;AAaA,MAAM,eAAe,GAAG,CAAC,EACxB,SAAS,EACT,iBAAiB,EACjB,GAAG,EACH,UAAU,EACV,SAAS,EACT,MAAM,GACgB,KAAI;AAC1B,IAAA,MAAM,WAAW,GAAGA,YAAM,CAAiB,IAAI,CAAC;AAChD,IAAA,MAAM,EAAE,WAAW,EAAE,GAAG,GAAG;IAE3BC,eAAS,CAAC,MAAK;AACd,QAAA,MAAM,EAAE,GAAG,WAAW,CAAC,OAAO;AAC9B,QAAA,IAAI,CAAC,EAAE;YAAE;AACT,QAAA,MAAM,OAAO,GAAG,CAAC,CAAa,KAAI;YACjC,IA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AAC3D,aAAA,EAAA,QAAA,EAEDA,cAAA,CAAA,KAAA,EAAA,EAAK,GAAG,EAAE,UAAU,EAAE,EAAE,EAAE,SAAS,EAAA,CAAI,EAAA,CAClC,EAAA,CACD;AAER;;;;"}
|
|
1
|
+
{"version":3,"file":"MermaidViewport.js","sources":["../../../src/components/MermaidViewport.tsx"],"sourcesContent":["import { useEffect, useRef } from 'react';\n\nimport type { PanZoom } from '../hooks/usePanZoom';\n\ninterface MermaidViewportProps {\n\tclassName: string;\n\tdraggingClassName: string;\n\tpan: PanZoom;\n\tcontentRef: React.RefObject<HTMLDivElement | null>;\n\tcontentId?: string;\n\thidden?: boolean;\n}\n\nconst MermaidViewport = ({\n\tclassName,\n\tdraggingClassName,\n\tpan,\n\tcontentRef,\n\tcontentId,\n\thidden,\n}: MermaidViewportProps) => {\n\tconst viewportRef = useRef<HTMLDivElement>(null);\n\tconst { zoomAtPoint } = pan;\n\n\tuseEffect(() => {\n\t\tconst el = viewportRef.current;\n\t\tif (!el) return;\n\t\tconst onWheel = (e: WheelEvent) => {\n\t\t\tif (!e.ctrlKey) return;\n\t\t\te.preventDefault();\n\t\t\tconst rect = el.getBoundingClientRect();\n\t\t\tzoomAtPoint(e.deltaY, e.clientX - rect.left, e.clientY - rect.top);\n\t\t};\n\t\tel.addEventListener('wheel', onWheel, { passive: false });\n\t\treturn () => el.removeEventListener('wheel', onWheel);\n\t}, [zoomAtPoint]);\n\n\treturn (\n\t\t<div\n\t\t\tref={viewportRef}\n\t\t\tclassName={`${className} ${pan.isDragging ? draggingClassName : ''}`}\n\t\t\tstyle={hidden ? { display: 'none' } : undefined}\n\t\t\tonMouseDown={pan.onMouseDown}\n\t\t\tonMouseMove={pan.onMouseMove}\n\t\t\tonMouseUp={pan.onMouseUp}\n\t\t\tonMouseLeave={pan.onMouseUp}\n\t\t>\n\t\t\t<div\n\t\t\t\tstyle={{\n\t\t\t\t\ttransform: `translate(${pan.transform.x}px, ${pan.transform.y}px) scale(${pan.transform.scale})`,\n\t\t\t\t\ttransformOrigin: '0 0',\n\t\t\t\t\ttransition: pan.isDragging ? 'none' : 'transform 0.1s ease',\n\t\t\t\t}}\n\t\t\t>\n\t\t\t\t<div ref={contentRef} id={contentId} />\n\t\t\t</div>\n\t\t</div>\n\t);\n};\n\nexport default MermaidViewport;\n"],"names":["useRef","useEffect","_jsx"],"mappings":";;;;;;;AAaA,MAAM,eAAe,GAAG,CAAC,EACxB,SAAS,EACT,iBAAiB,EACjB,GAAG,EACH,UAAU,EACV,SAAS,EACT,MAAM,GACgB,KAAI;AAC1B,IAAA,MAAM,WAAW,GAAGA,YAAM,CAAiB,IAAI,CAAC;AAChD,IAAA,MAAM,EAAE,WAAW,EAAE,GAAG,GAAG;IAE3BC,eAAS,CAAC,MAAK;AACd,QAAA,MAAM,EAAE,GAAG,WAAW,CAAC,OAAO;AAC9B,QAAA,IAAI,CAAC,EAAE;YAAE;AACT,QAAA,MAAM,OAAO,GAAG,CAAC,CAAa,KAAI;YACjC,IAAI,CAAC,CAAC,CAAC,OAAO;gBAAE;YAChB,CAAC,CAAC,cAAc,EAAE;AAClB,YAAA,MAAM,IAAI,GAAG,EAAE,CAAC,qBAAqB,EAAE;YACvC,WAAW,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC;AACnE,QAAA,CAAC;AACD,QAAA,EAAE,CAAC,gBAAgB,CAAC,OAAO,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;QACzD,OAAO,MAAM,EAAE,CAAC,mBAAmB,CAAC,OAAO,EAAE,OAAO,CAAC;AACtD,IAAA,CAAC,EAAE,CAAC,WAAW,CAAC,CAAC;AAEjB,IAAA,QACCC,cAAA,CAAA,KAAA,EAAA,EACC,GAAG,EAAE,WAAW,EAChB,SAAS,EAAE,CAAA,EAAG,SAAS,CAAA,CAAA,EAAI,GAAG,CAAC,UAAU,GAAG,iBAAiB,GAAG,EAAE,CAAA,CAAE,EACpE,KAAK,EAAE,MAAM,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,SAAS,EAC/C,WAAW,EAAE,GAAG,CAAC,WAAW,EAC5B,WAAW,EAAE,GAAG,CAAC,WAAW,EAC5B,SAAS,EAAE,GAAG,CAAC,SAAS,EACxB,YAAY,EAAE,GAAG,CAAC,SAAS,EAAA,QAAA,EAE3BA,cAAA,CAAA,KAAA,EAAA,EACC,KAAK,EAAE;AACN,gBAAA,SAAS,EAAE,CAAA,UAAA,EAAa,GAAG,CAAC,SAAS,CAAC,CAAC,CAAA,IAAA,EAAO,GAAG,CAAC,SAAS,CAAC,CAAC,CAAA,UAAA,EAAa,GAAG,CAAC,SAAS,CAAC,KAAK,CAAA,CAAA,CAAG;AAChG,gBAAA,eAAe,EAAE,KAAK;gBACtB,UAAU,EAAE,GAAG,CAAC,UAAU,GAAG,MAAM,GAAG,qBAAqB;AAC3D,aAAA,EAAA,QAAA,EAEDA,cAAA,CAAA,KAAA,EAAA,EAAK,GAAG,EAAE,UAAU,EAAE,EAAE,EAAE,SAAS,EAAA,CAAI,EAAA,CAClC,EAAA,CACD;AAER;;;;"}
|
|
@@ -30,7 +30,7 @@ const buildTocTree = (entries) => {
|
|
|
30
30
|
}
|
|
31
31
|
return roots;
|
|
32
32
|
};
|
|
33
|
-
const Blog = ({ children, title = 'In this article', jsonLd, }) => {
|
|
33
|
+
const Blog = ({ children, title = 'In this article', jsonLd, increasedWidthMode = false, }) => {
|
|
34
34
|
const [visibleTitle, setVisibleTitle] = react.useState(null);
|
|
35
35
|
const [showTOC, setShowTOC] = react.useState(false);
|
|
36
36
|
const { categoryTitles, handleSectionReference } = useCategoryTitles.useCategoryTitles({
|
|
@@ -47,7 +47,7 @@ const Blog = ({ children, title = 'In this article', jsonLd, }) => {
|
|
|
47
47
|
transform: showTOC ? 'translateX(0)' : 'translateX(40px)',
|
|
48
48
|
config: web.config.gentle,
|
|
49
49
|
});
|
|
50
|
-
return (jsxRuntime.jsxs("div", { className: Blog_module.default.blog
|
|
50
|
+
return (jsxRuntime.jsxs("div", { className: `${Blog_module.default.blog} ${increasedWidthMode ? Blog_module.default['blog--increased-width'] : ''}`, children: [jsonLd && (jsxRuntime.jsx("script", { type: "application/ld+json", dangerouslySetInnerHTML: { __html: JSON.stringify(jsonLd) } })), jsxRuntime.jsx("div", { className: Blog_module.default['blog__content'], children: react.Children.map(children, child => {
|
|
51
51
|
if (!react.isValidElement(child))
|
|
52
52
|
return child;
|
|
53
53
|
return react.cloneElement(child, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BlogDynamic.js","sources":["../../../src/dynamicComponents/BlogDynamic.tsx"],"sourcesContent":["'use client';\n\nimport {\n\tChildren,\n\tcloneElement,\n\tisValidElement,\n\tuseState,\n} from 'react';\nimport { useSpring, animated, config } from '@react-spring/web';\n\nimport type { ReactNode, RefAttributes } from 'react';\nimport type { Thing, WithContext } from 'schema-dts';\n\nimport styles from '../styles/Blog.module.scss';\nimport { useCategoryTitles } from '../hooks/useCategoryTitles';\nimport { useSectionObserver } from '../hooks/useSectionObserver';\nimport type { CategoryTitleValue } from '../hooks/useCategoryTitles';\nimport TocNodeStatic from '../staticComponents/TocNodeStatic';\nimport type { TocNode } from '../staticComponents/TocNodeStatic';\n\ninterface BlogProperties {\n\tchildren: ReactNode;\n\ttitle?: string;\n\tjsonLd?: WithContext<Thing>;\n}\n\nexport interface ForwardedReference {\n\tparentRef: HTMLDivElement;\n\tchildRefs: ForwardedReference[];\n}\n\nconst MAX_TOC_DEPTH = 2;\n\nconst buildTocTree = (entries: [string, CategoryTitleValue][]): TocNode[] => {\n\tconst roots: TocNode[] = [];\n\tconst stack: TocNode[] = [];\n\tfor (const [id, { title, depth }] of entries.filter(([, { depth }]) => depth <= MAX_TOC_DEPTH)) {\n\t\tconst node: TocNode = { id, title, depth, children: [] };\n\t\twhile (stack.length > 0 && stack[stack.length - 1].depth >= depth) {\n\t\t\tstack.pop();\n\t\t}\n\t\tif (stack.length === 0) {\n\t\t\troots.push(node);\n\t\t} else {\n\t\t\tstack[stack.length - 1].children.push(node);\n\t\t}\n\t\tstack.push(node);\n\t}\n\treturn roots;\n};\n\nconst Blog = ({\n\tchildren,\n\ttitle = 'In this article',\n\tjsonLd,\n}: BlogProperties) => {\n\tconst [visibleTitle, setVisibleTitle] = useState<string | null>(null);\n\tconst [showTOC, setShowTOC] = useState(false);\n\n\tconst { categoryTitles, handleSectionReference } = useCategoryTitles({\n\t\tvisibleTitle,\n\t\tsetVisibleTitle,\n\t\tsetShowTOC,\n\t});\n\n\tconst { handleClickCategoryTitle } = useSectionObserver({\n\t\tcategoryTitles,\n\t\tsetVisibleTitle,\n\t});\n\n\tconst sidebarStyle = useSpring({\n\t\topacity: showTOC ? 1 : 0,\n\t\ttransform: showTOC ? 'translateX(0)' : 'translateX(40px)',\n\t\tconfig: config.gentle,\n\t});\n\n\treturn (\n\t\t<div className={styles.blog}>\n\t\t\t{jsonLd && (\n\t\t\t\t<script\n\t\t\t\t\ttype=\"application/ld+json\"\n\t\t\t\t\tdangerouslySetInnerHTML={{ __html: JSON.stringify(jsonLd) }}\n\t\t\t\t/>\n\t\t\t)}\n\t\t\t<div className={styles['blog__content']}>\n\t\t\t\t{Children.map(children, child => {\n\t\t\t\t\tif (!isValidElement(child)) return child;\n\t\t\t\t\treturn cloneElement(child, {\n\t\t\t\t\t\tref: handleSectionReference,\n\t\t\t\t\t} as RefAttributes<ForwardedReference>);\n\t\t\t\t})}\n\t\t\t</div>\n\t\t\t<animated.div className={styles['blog__sidebar']} style={sidebarStyle}>\n\t\t\t\t<p\n\t\t\t\t\tclassName={`${styles['margin-bottom--3']} ${styles['category__header']}`}\n\t\t\t\t>\n\t\t\t\t\t{title}\n\t\t\t\t</p>\n\t\t\t\t{buildTocTree([...categoryTitles]).map((node, i) => (\n\t\t\t\t\t<TocNodeStatic\n\t\t\t\t\t\tkey={node.id}\n\t\t\t\t\t\tnode={node}\n\t\t\t\t\t\tindex={i}\n\t\t\t\t\t\tvisibleTitle={visibleTitle}\n\t\t\t\t\t\tonClick={handleClickCategoryTitle}\n\t\t\t\t\t/>\n\t\t\t\t))}\n\t\t\t</animated.div>\n\t\t</div>\n\t);\n};\n\nexport default Blog;\n"],"names":["useState","useCategoryTitles","useSectionObserver","useSpring","config","_jsxs","styles","_jsx","Children","isValidElement","cloneElement","animated","TocNodeStatic"],"mappings":";;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"BlogDynamic.js","sources":["../../../src/dynamicComponents/BlogDynamic.tsx"],"sourcesContent":["'use client';\n\nimport {\n\tChildren,\n\tcloneElement,\n\tisValidElement,\n\tuseState,\n} from 'react';\nimport { useSpring, animated, config } from '@react-spring/web';\n\nimport type { ReactNode, RefAttributes } from 'react';\nimport type { Thing, WithContext } from 'schema-dts';\n\nimport styles from '../styles/Blog.module.scss';\nimport { useCategoryTitles } from '../hooks/useCategoryTitles';\nimport { useSectionObserver } from '../hooks/useSectionObserver';\nimport type { CategoryTitleValue } from '../hooks/useCategoryTitles';\nimport TocNodeStatic from '../staticComponents/TocNodeStatic';\nimport type { TocNode } from '../staticComponents/TocNodeStatic';\n\ninterface BlogProperties {\n\tchildren: ReactNode;\n\ttitle?: string;\n\tjsonLd?: WithContext<Thing>;\n\tincreasedWidthMode?: boolean;\n}\n\nexport interface ForwardedReference {\n\tparentRef: HTMLDivElement;\n\tchildRefs: ForwardedReference[];\n}\n\nconst MAX_TOC_DEPTH = 2;\n\nconst buildTocTree = (entries: [string, CategoryTitleValue][]): TocNode[] => {\n\tconst roots: TocNode[] = [];\n\tconst stack: TocNode[] = [];\n\tfor (const [id, { title, depth }] of entries.filter(([, { depth }]) => depth <= MAX_TOC_DEPTH)) {\n\t\tconst node: TocNode = { id, title, depth, children: [] };\n\t\twhile (stack.length > 0 && stack[stack.length - 1].depth >= depth) {\n\t\t\tstack.pop();\n\t\t}\n\t\tif (stack.length === 0) {\n\t\t\troots.push(node);\n\t\t} else {\n\t\t\tstack[stack.length - 1].children.push(node);\n\t\t}\n\t\tstack.push(node);\n\t}\n\treturn roots;\n};\n\nconst Blog = ({\n\tchildren,\n\ttitle = 'In this article',\n\tjsonLd,\n\tincreasedWidthMode = false,\n}: BlogProperties) => {\n\tconst [visibleTitle, setVisibleTitle] = useState<string | null>(null);\n\tconst [showTOC, setShowTOC] = useState(false);\n\n\tconst { categoryTitles, handleSectionReference } = useCategoryTitles({\n\t\tvisibleTitle,\n\t\tsetVisibleTitle,\n\t\tsetShowTOC,\n\t});\n\n\tconst { handleClickCategoryTitle } = useSectionObserver({\n\t\tcategoryTitles,\n\t\tsetVisibleTitle,\n\t});\n\n\tconst sidebarStyle = useSpring({\n\t\topacity: showTOC ? 1 : 0,\n\t\ttransform: showTOC ? 'translateX(0)' : 'translateX(40px)',\n\t\tconfig: config.gentle,\n\t});\n\n\treturn (\n\t\t<div className={`${styles.blog} ${increasedWidthMode ? styles['blog--increased-width'] : ''}`}>\n\t\t\t{jsonLd && (\n\t\t\t\t<script\n\t\t\t\t\ttype=\"application/ld+json\"\n\t\t\t\t\tdangerouslySetInnerHTML={{ __html: JSON.stringify(jsonLd) }}\n\t\t\t\t/>\n\t\t\t)}\n\t\t\t<div className={styles['blog__content']}>\n\t\t\t\t{Children.map(children, child => {\n\t\t\t\t\tif (!isValidElement(child)) return child;\n\t\t\t\t\treturn cloneElement(child, {\n\t\t\t\t\t\tref: handleSectionReference,\n\t\t\t\t\t} as RefAttributes<ForwardedReference>);\n\t\t\t\t})}\n\t\t\t</div>\n\t\t\t<animated.div className={styles['blog__sidebar']} style={sidebarStyle}>\n\t\t\t\t<p\n\t\t\t\t\tclassName={`${styles['margin-bottom--3']} ${styles['category__header']}`}\n\t\t\t\t>\n\t\t\t\t\t{title}\n\t\t\t\t</p>\n\t\t\t\t{buildTocTree([...categoryTitles]).map((node, i) => (\n\t\t\t\t\t<TocNodeStatic\n\t\t\t\t\t\tkey={node.id}\n\t\t\t\t\t\tnode={node}\n\t\t\t\t\t\tindex={i}\n\t\t\t\t\t\tvisibleTitle={visibleTitle}\n\t\t\t\t\t\tonClick={handleClickCategoryTitle}\n\t\t\t\t\t/>\n\t\t\t\t))}\n\t\t\t</animated.div>\n\t\t</div>\n\t);\n};\n\nexport default Blog;\n"],"names":["useState","useCategoryTitles","useSectionObserver","useSpring","config","_jsxs","styles","_jsx","Children","isValidElement","cloneElement","animated","TocNodeStatic"],"mappings":";;;;;;;;;;;;AAgCA,MAAM,aAAa,GAAG,CAAC;AAEvB,MAAM,YAAY,GAAG,CAAC,OAAuC,KAAe;IAC3E,MAAM,KAAK,GAAc,EAAE;IAC3B,MAAM,KAAK,GAAc,EAAE;AAC3B,IAAA,KAAK,MAAM,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,KAAK,EAAE,CAAC,KAAK,KAAK,IAAI,aAAa,CAAC,EAAE;AAC/F,QAAA,MAAM,IAAI,GAAY,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE;AACxD,QAAA,OAAO,KAAK,CAAC,MAAM,GAAG,CAAC,IAAI,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,KAAK,IAAI,KAAK,EAAE;YAClE,KAAK,CAAC,GAAG,EAAE;QACZ;AACA,QAAA,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE;AACvB,YAAA,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC;QACjB;aAAO;AACN,YAAA,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC;QAC5C;AACA,QAAA,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC;IACjB;AACA,IAAA,OAAO,KAAK;AACb,CAAC;AAED,MA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C;AAAE,wBAAA,OAAO,KAAK;oBACxC,OAAOC,kBAAY,CAAC,KAAK,EAAE;AAC1B,wBAAA,GAAG,EAAE,sBAAsB;AACU,qBAAA,CAAC;AACxC,gBAAA,CAAC,CAAC,EAAA,CACG,EACNL,eAAA,CAACM,YAAQ,CAAC,GAAG,EAAA,EAAC,SAAS,EAAEL,mBAAM,CAAC,eAAe,CAAC,EAAE,KAAK,EAAE,YAAY,EAAA,QAAA,EAAA,CACpEC,cAAA,CAAA,GAAA,EAAA,EACC,SAAS,EAAE,CAAA,EAAGD,mBAAM,CAAC,kBAAkB,CAAC,IAAIA,mBAAM,CAAC,kBAAkB,CAAC,EAAE,EAAA,QAAA,EAEvE,KAAK,GACH,EACH,YAAY,CAAC,CAAC,GAAG,cAAc,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,MAC9CC,cAAA,CAACK,qBAAa,IAEb,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,CAAC,EACR,YAAY,EAAE,YAAY,EAC1B,OAAO,EAAE,wBAAwB,EAAA,EAJ5B,IAAI,CAAC,EAAE,CAKX,CACF,CAAC,CAAA,EAAA,CACY,CAAA,EAAA,CACV;AAER;;;;"}
|
|
@@ -23,7 +23,11 @@ function useCategoryTitles({ visibleTitle, setVisibleTitle, setShowTOC, }) {
|
|
|
23
23
|
const sectionsArray = Array.from(sectionReferences.current.entries());
|
|
24
24
|
sectionsArray.sort(sortByDomPosition);
|
|
25
25
|
let firstSectionId = null;
|
|
26
|
-
|
|
26
|
+
const baseIdCounts = new Map();
|
|
27
|
+
for (const [, { title, el, depth, baseId }] of sectionsArray) {
|
|
28
|
+
const occurrence = (baseIdCounts.get(baseId) ?? 0) + 1;
|
|
29
|
+
baseIdCounts.set(baseId, occurrence);
|
|
30
|
+
const id = occurrence === 1 ? baseId : `${baseId}-${occurrence}`;
|
|
27
31
|
if (!firstSectionId) {
|
|
28
32
|
firstSectionId = id;
|
|
29
33
|
}
|
|
@@ -50,19 +54,10 @@ function useCategoryTitles({ visibleTitle, setVisibleTitle, setShowTOC, }) {
|
|
|
50
54
|
updateCategoryTitles();
|
|
51
55
|
}, 200);
|
|
52
56
|
}, [updateCategoryTitles]);
|
|
53
|
-
const removeStaleRefs = (ref) => {
|
|
54
|
-
for (const [existingId, { el }] of sectionReferences.current) {
|
|
55
|
-
if (el !== ref) {
|
|
56
|
-
continue;
|
|
57
|
-
}
|
|
58
|
-
sectionReferences.current.delete(existingId);
|
|
59
|
-
break;
|
|
60
|
-
}
|
|
61
|
-
};
|
|
62
57
|
const handleCategoryTitle = (ref) => {
|
|
63
|
-
const
|
|
58
|
+
const baseId = ref.dataset.id;
|
|
64
59
|
const title = ref.dataset.title;
|
|
65
|
-
if (!
|
|
60
|
+
if (!baseId || !title)
|
|
66
61
|
return;
|
|
67
62
|
let depth = 0;
|
|
68
63
|
let parent = ref.parentElement;
|
|
@@ -71,8 +66,7 @@ function useCategoryTitles({ visibleTitle, setVisibleTitle, setShowTOC, }) {
|
|
|
71
66
|
depth++;
|
|
72
67
|
parent = parent.parentElement;
|
|
73
68
|
}
|
|
74
|
-
|
|
75
|
-
sectionReferences.current.set(id, { el: ref, title, depth });
|
|
69
|
+
sectionReferences.current.set(ref, { el: ref, title, depth, baseId });
|
|
76
70
|
};
|
|
77
71
|
const processSection = (element) => {
|
|
78
72
|
const { parentRef, childRefs } = element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCategoryTitles.js","sources":["../../../src/hooks/useCategoryTitles.ts"],"sourcesContent":["'use client';\n\nimport { useCallback, useEffect, useRef, useState } from 'react';\n\nimport type { Dispatch, SetStateAction } from 'react';\n\nimport type { ForwardedReference } from '../dynamicComponents/BlogDynamic';\n\nexport interface SectionReferenceValue {\n\tel: HTMLElement;\n\ttitle: string;\n\tdepth: number;\n}\n\nexport interface CategoryTitleValue extends SectionReferenceValue {\n\tlastUpdatedAt: number;\n}\n\nexport type CategoryTitle = Map<string, CategoryTitleValue>;\n\ntype SectionReference = Map<
|
|
1
|
+
{"version":3,"file":"useCategoryTitles.js","sources":["../../../src/hooks/useCategoryTitles.ts"],"sourcesContent":["'use client';\n\nimport { useCallback, useEffect, useRef, useState } from 'react';\n\nimport type { Dispatch, SetStateAction } from 'react';\n\nimport type { ForwardedReference } from '../dynamicComponents/BlogDynamic';\n\nexport interface SectionReferenceValue {\n\tel: HTMLElement;\n\ttitle: string;\n\tdepth: number;\n}\n\nexport interface CategoryTitleValue extends SectionReferenceValue {\n\tlastUpdatedAt: number;\n}\n\nexport type CategoryTitle = Map<string, CategoryTitleValue>;\n\ninterface SectionReferenceEntry extends SectionReferenceValue {\n\tbaseId: string;\n}\n\ntype SectionReference = Map<HTMLElement, SectionReferenceEntry>;\n\ninterface Options {\n\tvisibleTitle: string | null;\n\tsetVisibleTitle: Dispatch<SetStateAction<string | null>>;\n\tsetShowTOC: Dispatch<SetStateAction<boolean>>;\n}\n\nexport function useCategoryTitles({\n\tvisibleTitle,\n\tsetVisibleTitle,\n\tsetShowTOC,\n}: Options) {\n\tconst sectionReferences = useRef<SectionReference>(new Map());\n\tconst [categoryTitles, setCategoryTitles] = useState<CategoryTitle>(\n\t\tnew Map()\n\t);\n\tconst updateTimerRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n\n\tconst sortByDomPosition = useCallback(\n\t\t(\n\t\t\t[, a]: [HTMLElement, SectionReferenceEntry],\n\t\t\t[, b]: [HTMLElement, SectionReferenceEntry]\n\t\t) => {\n\t\t\tconst position = a.el.compareDocumentPosition(b.el);\n\t\t\tif (position & Node.DOCUMENT_POSITION_FOLLOWING) {\n\t\t\t\treturn -1;\n\t\t\t} else if (position & Node.DOCUMENT_POSITION_PRECEDING) {\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t\treturn 0;\n\t\t},\n\t\t[]\n\t);\n\n\tconst updateCategoryTitles = useCallback(() => {\n\t\tconst now = Date.now();\n\t\tconst newCategoryTitles = new Map<string, CategoryTitleValue>();\n\n\t\tconst sectionsArray = Array.from(sectionReferences.current.entries());\n\t\tsectionsArray.sort(sortByDomPosition);\n\n\t\tlet firstSectionId: string | null = null;\n\t\tconst baseIdCounts = new Map<string, number>();\n\t\tfor (const [, { title, el, depth, baseId }] of sectionsArray) {\n\t\t\tconst occurrence = (baseIdCounts.get(baseId) ?? 0) + 1;\n\t\t\tbaseIdCounts.set(baseId, occurrence);\n\t\t\tconst id = occurrence === 1 ? baseId : `${baseId}-${occurrence}`;\n\n\t\t\tif (!firstSectionId) {\n\t\t\t\tfirstSectionId = id;\n\t\t\t}\n\t\t\tnewCategoryTitles.set(id, {\n\t\t\t\tel,\n\t\t\t\ttitle,\n\t\t\t\tlastUpdatedAt: now,\n\t\t\t\tdepth,\n\t\t\t});\n\t\t}\n\n\t\tif (newCategoryTitles.size === 0) return;\n\n\t\tsetCategoryTitles(newCategoryTitles);\n\t\tsetShowTOC(true);\n\n\t\tif (visibleTitle) return;\n\t\tsetVisibleTitle(firstSectionId);\n\t}, [visibleTitle, sortByDomPosition, setShowTOC, setVisibleTitle]);\n\n\tconst debounceUpdateCategoryTitles = useCallback(() => {\n\t\tif (updateTimerRef.current) {\n\t\t\tclearTimeout(updateTimerRef.current);\n\t\t}\n\t\tupdateTimerRef.current = setTimeout(() => {\n\t\t\tupdateCategoryTitles();\n\t\t}, 200);\n\t}, [updateCategoryTitles]);\n\n\tconst handleCategoryTitle = (ref: HTMLDivElement) => {\n\t\tconst baseId = ref.dataset.id;\n\t\tconst title = ref.dataset.title;\n\t\tif (!baseId || !title) return;\n\n\t\tlet depth = 0;\n\t\tlet parent = ref.parentElement;\n\t\twhile (parent) {\n\t\t\tif (parent.hasAttribute('data-id')) depth++;\n\t\t\tparent = parent.parentElement;\n\t\t}\n\n\t\tsectionReferences.current.set(ref, { el: ref, title, depth, baseId });\n\t};\n\n\tconst processSection = (element: ForwardedReference) => {\n\t\tconst { parentRef, childRefs } = element;\n\t\tif (parentRef) handleCategoryTitle(parentRef);\n\t\tif (Array.isArray(childRefs)) {\n\t\t\tfor (const childRef of childRefs) {\n\t\t\t\tprocessSection(childRef);\n\t\t\t}\n\t\t}\n\t};\n\n\tconst handleSectionReference = useCallback(\n\t\t(element: ForwardedReference) => {\n\t\t\tif (!element) return;\n\t\t\tprocessSection(element);\n\t\t\tdebounceUpdateCategoryTitles();\n\t\t},\n\t\t[debounceUpdateCategoryTitles]\n\t);\n\n\tuseEffect(() => {\n\t\treturn () => {\n\t\t\tif (updateTimerRef.current) {\n\t\t\t\tclearTimeout(updateTimerRef.current);\n\t\t\t}\n\t\t};\n\t}, []);\n\n\treturn { categoryTitles, handleSectionReference };\n}\n"],"names":["useRef","useState","useCallback","useEffect"],"mappings":";;;;AAgCM,SAAU,iBAAiB,CAAC,EACjC,YAAY,EACZ,eAAe,EACf,UAAU,GACD,EAAA;IACT,MAAM,iBAAiB,GAAGA,YAAM,CAAmB,IAAI,GAAG,EAAE,CAAC;AAC7D,IAAA,MAAM,CAAC,cAAc,EAAE,iBAAiB,CAAC,GAAGC,cAAQ,CACnD,IAAI,GAAG,EAAE,CACT;AACD,IAAA,MAAM,cAAc,GAAGD,YAAM,CAAuC,IAAI,CAAC;AAEzE,IAAA,MAAM,iBAAiB,GAAGE,iBAAW,CACpC,CACC,GAAG,CAAC,CAAuC,EAC3C,GAAG,CAAC,CAAuC,KACxC;AACH,QAAA,MAAM,QAAQ,GAAG,CAAC,CAAC,EAAE,CAAC,uBAAuB,CAAC,CAAC,CAAC,EAAE,CAAC;AACnD,QAAA,IAAI,QAAQ,GAAG,IAAI,CAAC,2BAA2B,EAAE;YAChD,OAAO,EAAE;QACV;AAAO,aAAA,IAAI,QAAQ,GAAG,IAAI,CAAC,2BAA2B,EAAE;AACvD,YAAA,OAAO,CAAC;QACT;AACA,QAAA,OAAO,CAAC;IACT,CAAC,EACD,EAAE,CACF;AAED,IAAA,MAAM,oBAAoB,GAAGA,iBAAW,CAAC,MAAK;AAC7C,QAAA,MAAM,GAAG,GAAG,IAAI,CAAC,G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