diff --git a/docs/.vitepress/api/gh-icon/[...data].get.ts b/docs/.vitepress/api/gh-icon/[...data].get.ts index 204b132b6..346901712 100644 --- a/docs/.vitepress/api/gh-icon/[...data].get.ts +++ b/docs/.vitepress/api/gh-icon/[...data].get.ts @@ -13,7 +13,10 @@ export default eventHandler((event) => { const data = pathData.at(-1).slice(0, -4); const [name] = pathData; - const src = Buffer.from(data, 'base64').toString('utf8'); + const src = Buffer.from(data, 'base64') + .toString('utf8') + .replaceAll('\n', '') + .replace(/]*>|<\/svg>/g, ''); const children = []; @@ -30,7 +33,7 @@ export default eventHandler((event) => { const LucideIcon = createLucideIcon(backdropName, iconNode); const svg = renderToStaticMarkup(createElement(LucideIcon)); - const backdropString = svg.replace(/]*>|<\/svg>/g, ''); + const backdropString = svg.replaceAll('\n', '').replace(/]*>|<\/svg>/g, ''); children.push( createElement(Backdrop, { @@ -39,6 +42,15 @@ export default eventHandler((event) => { color: name in iconNodes ? 'red' : '#777', }), ); + if (name in iconNodes) { + children.push( + createElement(Backdrop, { + backdropString: src, + src: backdropString, + color: 'lime', + }), + ); + } } const svg = Buffer.from( diff --git a/docs/.vitepress/lib/SvgPreview/Backdrop.tsx b/docs/.vitepress/lib/SvgPreview/Backdrop.tsx index 4fa9b9b13..088dcf7e9 100644 --- a/docs/.vitepress/lib/SvgPreview/Backdrop.tsx +++ b/docs/.vitepress/lib/SvgPreview/Backdrop.tsx @@ -7,11 +7,12 @@ interface BackdropProps { } const Backdrop = ({ src, color = 'red', backdropString }: BackdropProps): JSX.Element => { + const id = React.useId(); return ( <> - + - - - - - + + + + + + - - ); }; diff --git a/docs/.vitepress/lib/SvgPreview/index.tsx b/docs/.vitepress/lib/SvgPreview/index.tsx index 43bf1d2c2..5d6b5d386 100644 --- a/docs/.vitepress/lib/SvgPreview/index.tsx +++ b/docs/.vitepress/lib/SvgPreview/index.tsx @@ -301,7 +301,6 @@ const Handles = ({ 'strokeWidth' | 'stroke' | 'strokeDasharray' | 'strokeOpacity', any >) => { - console.log(paths); return (