{"version":3,"file":"ComponentsPreviewSkeleton.BQROKDYv.mjs","names":["useState","Skeleton"],"sources":["https:/framerusercontent.com/modules/gNZ119Ll7gqKCRzIvNTp/1T88oSZf5jXVkp2sbLXo/ComponentsPreviewSkeleton.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useState,useEffect}from\"react\";import{Skeleton}from\"antd\";// 创建一个全局状态来同步加载状态\nlet globalSetLoading=null;// 监听 #components-content 内容加载\nfunction useContentLoaded(){const[isLoading,setIsLoading]=useState(true);useEffect(()=>{globalSetLoading=setIsLoading;const checkContent=()=>{const content=document.getElementById(\"components-content\");if(content&&content.children.length>0){// 内容已加载，延迟一点隐藏骨架屏（更平滑）\nsetTimeout(()=>{setIsLoading(false);},300);return true;}return false;};// 立即检查一次\nif(checkContent())return;// 用 MutationObserver 监听 DOM 变化\nconst observer=new MutationObserver(()=>{if(checkContent()){observer.disconnect();}});const target=document.getElementById(\"components-content\");if(target){observer.observe(target,{childList:true,subtree:true});}else{// 如果元素还不存在，监听整个 body\nobserver.observe(document.body,{childList:true,subtree:true});}return()=>observer.disconnect();},[]);return isLoading;}// 大图预览区骨架屏\nexport function withPreviewSkeleton(Component){return props=>{const isLoading=useContentLoaded();if(isLoading){return /*#__PURE__*/_jsx(Skeleton.Node,{active:true,style:{width:790,height:536,borderRadius:15},children:/*#__PURE__*/_jsx(\"div\",{style:{width:790,height:536}})});}return /*#__PURE__*/_jsx(Component,{...props});};}// 标题骨架屏\nexport function withTitleSkeleton(Component){return props=>{const isLoading=useContentLoaded();if(isLoading){return /*#__PURE__*/_jsx(Skeleton.Input,{active:true,style:{width:120,height:29,borderRadius:8}});}return /*#__PURE__*/_jsx(Component,{...props});};}// 描述文字骨架屏\nexport function withDescSkeleton(Component){return props=>{const isLoading=useContentLoaded();if(isLoading){return /*#__PURE__*/_jsx(Skeleton,{active:true,title:false,paragraph:{rows:3,width:[359,359,200]}});}return /*#__PURE__*/_jsx(Component,{...props});};}// 按钮骨架屏\nexport function withButtonSkeleton(Component){return props=>{const isLoading=useContentLoaded();if(isLoading){return /*#__PURE__*/_jsx(Skeleton.Button,{active:true,style:{width:359,height:40,borderRadius:100}});}return /*#__PURE__*/_jsx(Component,{...props});};}// 提示条骨架屏\nexport function withTipBarSkeleton(Component){return props=>{const isLoading=useContentLoaded();if(isLoading){return /*#__PURE__*/_jsx(Skeleton.Input,{active:true,style:{width:790,height:34,borderRadius:10}});}return /*#__PURE__*/_jsx(Component,{...props});};}// 面包屑骨架屏\nexport function withBreadcrumbSkeleton(Component){return props=>{const isLoading=useContentLoaded();if(isLoading){return /*#__PURE__*/_jsx(Skeleton.Input,{active:true,style:{width:100,height:20,borderRadius:4}});}return /*#__PURE__*/_jsx(Component,{...props});};}export function withSectionPreviewSkeleton(Component){return props=>{const isLoading=useContentLoaded();if(isLoading){return /*#__PURE__*/_jsx(Skeleton.Node,{active:true,style:{width:790,height:498,borderRadius:15},children:/*#__PURE__*/_jsx(\"div\",{style:{width:790,height:498}})});}return /*#__PURE__*/_jsx(Component,{...props});};}export function withHelpSkeleton(Component){return props=>{const isLoading=useContentLoaded();if(isLoading){return /*#__PURE__*/_jsx(Skeleton.Node,{active:true,style:{width:359.5,height:138,borderRadius:15},children:/*#__PURE__*/_jsx(\"div\",{style:{width:359.5,height:138}})});}return /*#__PURE__*/_jsx(Component,{...props});};}\nexport const __FramerMetadata__ = {\"exports\":{\"withDescSkeleton\":{\"type\":\"reactHoc\",\"name\":\"withDescSkeleton\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withButtonSkeleton\":{\"type\":\"reactHoc\",\"name\":\"withButtonSkeleton\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withTipBarSkeleton\":{\"type\":\"reactHoc\",\"name\":\"withTipBarSkeleton\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withBreadcrumbSkeleton\":{\"type\":\"reactHoc\",\"name\":\"withBreadcrumbSkeleton\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withPreviewSkeleton\":{\"type\":\"reactHoc\",\"name\":\"withPreviewSkeleton\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withSectionPreviewSkeleton\":{\"type\":\"reactHoc\",\"name\":\"withSectionPreviewSkeleton\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withHelpSkeleton\":{\"type\":\"reactHoc\",\"name\":\"withHelpSkeleton\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withTitleSkeleton\":{\"type\":\"reactHoc\",\"name\":\"withTitleSkeleton\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ComponentsPreviewSkeleton.map"],"mappings":"6KAEA,SAAS,GAAkB,CAAC,GAAK,CAAC,EAAU,GAAcA,EAAS,GAAK,CAI6B,OAJ5B,MAAc,CAA+B,IAAM,MAAiB,CAAC,IAAM,EAAQ,SAAS,eAAe,qBAAqB,CACjJ,OADqJ,GAAS,EAAQ,SAAS,OAAO,GAC9O,eAAe,CAAC,EAAa,GAAM,EAAG,IAAI,CAAQ,IAAa,IAC/D,GAAG,GAAc,CAAC,OAClB,IAAM,EAAS,IAAI,qBAAqB,CAAI,GAAc,EAAE,EAAS,YAAY,EAAI,CAAO,EAAO,SAAS,eAAe,qBAAqB,CACjF,OADqF,EAAQ,EAAS,QAAQ,EAAO,CAAC,UAAU,GAAK,QAAQ,GAAK,CAAC,CAClN,EAAS,QAAQ,SAAS,KAAK,CAAC,UAAU,GAAK,QAAQ,GAAK,CAAC,KAAY,EAAS,YAAY,EAAG,EAAE,CAAC,CAAQ,EAC5G,SAAgB,EAAoB,EAAU,CAAC,MAAO,IAAwB,GAAkB,CAAmC,EAAKC,EAAS,KAAK,CAAC,OAAO,GAAK,MAAM,CAAC,MAAM,IAAI,OAAO,IAAI,aAAa,GAAG,CAAC,SAAsB,EAAK,MAAM,CAAC,MAAM,CAAC,MAAM,IAAI,OAAO,IAAI,CAAC,CAAC,CAAC,CAAC,CAAsB,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