mirror of
https://github.com/hanzo-docs/docs.git
synced 2026-10-25 04:20:02 +00:00
hotfix: production source map being ignored
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'fumadocs-ui': patch
|
||||
---
|
||||
|
||||
hotfix: production source map being ignored
|
||||
@@ -45,7 +45,22 @@ export function HideIfEmpty({ children }: { children: React.ReactNode }) {
|
||||
};
|
||||
}, []);
|
||||
|
||||
const inject = `{${isEmpty.toString()}
|
||||
const inject = `{
|
||||
function isEmpty(node) {
|
||||
for (let i = 0; i < node.childNodes.length; i++) {
|
||||
const child = node.childNodes.item(i);
|
||||
if (child.nodeType === Node.TEXT_NODE) {
|
||||
return false;
|
||||
} else if (
|
||||
child.nodeType === Node.ELEMENT_NODE &&
|
||||
window.getComputedStyle(child).display !== 'none'
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
const element = document.querySelector('[data-fdid="${id}"]')
|
||||
if (element) {
|
||||
|
||||
Reference in New Issue
Block a user