{"name":"@rc-component/util","version":"1.12.0","keywords":["react","util"],"license":"MIT","_id":"@rc-component/util@1.12.0","maintainers":[{"name":"zombiej","email":"smith3816@gmail.com"},{"name":"afc163","email":"afc163@gmail.com"},{"name":"madccc","email":"1075746765@qq.com"},{"name":"peachscript","email":"scdzwyxst@gmail.com"},{"name":"chenshuai2144","email":"wasd2144@hotmail.com"}],"homepage":"https://react-component.github.io/util","bugs":{"url":"https://github.com/react-component/util/issues"},"dist":{"shasum":"58e453585810bcb8a35ff1aafd5e01187457b86f","tarball":"http://registry-npm.ywwl.com/@rc-component/util/download/@rc-component/util-1.12.0.tgz","fileCount":172,"integrity":"sha512-AEjPL8JVdohIITaiXokyjL9WQ6tKWWjAYK9QU16tGNE9JaQABBQy+hA4H2Lup5MgXy9yY3iLrbZJheuU13hTdQ==","signatures":[{"sig":"MEUCIQDDwkKnQJWcKuY4pY6cv3GEBrBMXIPTuuPZw43qU7HeLwIgCPrvUf1RqlGTjuJqxQCrZW7+ePrvlDuqq31p/d9Mc3U=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":214118,"size":38917,"noattachment":false,"key":"/@rc-component/util/-/@rc-component/util-1.12.0.tgz"},"main":"./lib/index","types":"./es/index.d.ts","module":"./es/index","gitHead":"152384e967719364f6ff57d7e612269d3b28eede","scripts":{"tsc":"tsc --noEmit","lint":"eslint src/ tests/ docs/examples/ --ext .tsx,.ts,.jsx,.js","test":"rc-test","build":"npm run compile && npm run docs:build","start":"dumi dev","deploy":"npm run gh-pages","compile":"father build","prepare":"husky","coverage":"rc-test --coverage","gh-pages":"npm run compile && cross-env GH_PAGES=1 npm run docs:build && npm run docs:deploy","prettier":"prettier --write --ignore-unknown .","docs:build":"dumi build","docs:deploy":"gh-pages -d docs-dist","prepublishOnly":"npm run compile && rc-np"},"_npmUser":{"name":"zombiej","email":"smith3816@gmail.com"},"repository":{"url":"git+https://github.com/react-component/util.git","type":"git"},"_npmVersion":"11.7.0","description":"Shared React utilities for rc-component packages.","directories":{},"lint-staged":{"*":"prettier --write --ignore-unknown"},"_nodeVersion":"22.15.1","dependencies":{"react-is":"^19.2.7","is-mobile":"^5.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"dumi":"^2.4.38","glob":"^13.0.6","husky":"^9.1.7","react":"^19.2.7","eslint":"^10.6.0","father":"^4.6.24","globals":"^17.7.0","rc-test":"^7.1.3","gh-pages":"^6.3.0","prettier":"^3.9.4","react-19":"npm:react@19.0.0","cross-env":"^10.1.0","react-dom":"^19.2.7","@eslint/js":"^10.0.1","typescript":"^6.0.3","@types/jest":"^30.0.0","@types/node":"^26.0.1","lint-staged":"^17.0.8","@types/react":"^19.2.17","react-dom-19":"npm:react-dom@19.0.0","@eslint/compat":"^2.1.0","@types/warning":"^3.0.4","@types/react-is":"^19.2.0","@rc-component/np":"^1.0.4","@types/react-dom":"^19.2.3","typescript-eslint":"^8.62.1","eslint-plugin-jest":"^29.15.4","@types/responselike":"^1.0.3","eslint-plugin-react":"^7.37.5","@testing-library/dom":"^10.4.1","@testing-library/react":"^16.3.2","eslint-config-prettier":"^10.1.8","@testing-library/jest-dom":"^6.9.1","eslint-plugin-react-hooks":"^7.1.1","@rc-component/father-plugin":"^2.2.0"},"peerDependencies":{"react":">=18.0.0","react-dom":">=18.0.0"},"_npmOperationalInternal":{"tmp":"tmp/util_1.12.0_1783940640830_0.6929457125830409","host":"s3://npm-registry-packages-npm-production"},"readme":"<div align=\"center\">\n  <h1>@rc-component/util</h1>\n  <p><sub><a href=\"https://ant.design\"><img alt=\"Ant Design\" height=\"14\" src=\"https://gw.alipayobjects.com/zos/rmsportal/KDpgvguMpGfqaHPjicRK.svg\" style=\"vertical-align: -0.125em;\" /></a> Ant Design 生态的一部分。</sub></p>\n  <p>🛠️ rc-component 共享工具集合，包含 DOM、React 和测试辅助能力。</p>\n\n  <p>\n    <a href=\"https://npmjs.org/package/@rc-component/util\"><img alt=\"NPM version\" src=\"https://img.shields.io/npm/v/@rc-component/util.svg?style=flat-square\"></a>\n    <a href=\"https://npmjs.org/package/@rc-component/util\"><img alt=\"npm downloads\" src=\"https://img.shields.io/npm/dm/@rc-component/util.svg?style=flat-square\"></a>\n    <a href=\"https://github.com/react-component/util/actions/workflows/react-component-ci.yml\"><img alt=\"build status\" src=\"https://github.com/react-component/util/actions/workflows/react-component-ci.yml/badge.svg\"></a>\n    <a href=\"https://app.codecov.io/gh/react-component/util\"><img alt=\"Codecov\" src=\"https://img.shields.io/codecov/c/github/react-component/util/master.svg?style=flat-square\"></a>\n    <a href=\"https://bundlephobia.com/package/@rc-component/util\"><img alt=\"bundle size\" src=\"https://img.shields.io/bundlephobia/minzip/@rc-component/util?style=flat-square\"></a>\n    <a href=\"https://github.com/umijs/dumi\"><img alt=\"dumi\" src=\"https://img.shields.io/badge/docs%20by-dumi-blue?style=flat-square\"></a>\n  </p>\n</div>\n\n<p align=\"center\"><a href=\"./README.md\">English</a> | 简体中文</p>\n\n## 特性\n\n- 面向 React 构建，并由 rc-component 团队维护。\n- 被 Ant Design 使用和其他 React 组件库使用。\n- 提供 TypeScript 类型声明，同时输出 ES module 和 CommonJS 产物。\n- 示例、测试和预览构建与包源码保持一致。\n\n> 该包历史上曾以 `rc-util` 发布。新代码推荐使用带 scope 的包名。\n\n## 安装\n\n```bash\nnpm install @rc-component/util\n```\n\n## 使用\n\n```tsx | pure\nimport {\n  Portal,\n  raf,\n  useEvent,\n  useLayoutEffect,\n  warning,\n} from '@rc-component/util';\n```\n\n## 示例\n\n运行本地 dumi 站点：\n\n```bash\nnpm install\nnpm start\n```\n\n然后打开 `http://localhost:8000`。\n\n## API\n\n该包提供在 rc-component 和 Ant Design 包中复用的小型聚焦工具。优先导入公开入口；针对 DOM、React 或测试辅助能力，可使用子路径导入。\n\n| 范围         | 示例                                                                               |\n| ------------ | ---------------------------------------------------------------------------------- |\n| React hooks  | `useEvent`, `useLayoutEffect`, `useMergedState`, `useState` 辅助方法               |\n| React 工具   | `Children/toArray`, `composeRef`, `pickAttrs`, `Portal`                            |\n| DOM 工具     | `Dom/canUseDom`, `Dom/contains`, `Dom/dynamicCSS`, `Dom/focus`, `getScrollBarSize` |\n| 异步辅助方法 | `raf`, `raf.cancel`                                                                |\n| 警告工具     | `warning`, `noteOnce`, `resetWarned`                                               |\n| 测试工具     | `test/domHook` 用于 DOM 原型 spy                                                   |\n\n`docs/examples` 中的示例覆盖了常用的子路径辅助工具。\n\n## 本地开发\n\n```bash\nnpm install\nnpm start\nnpm test\nnpm run build\n```\n\ndumi 站点默认运行在 `http://localhost:8000`。\n\n## 发布\n\n```bash\nnpm run prepublishOnly\n```\n\n包构建完成后，发布流程由 `@rc-component/np` 通过 `rc-np` 命令处理。\n\n## 许可证\n\n@rc-component/util 基于 [MIT](./LICENSE) 许可证发布。\n","publish_time":1783940641004,"_cnpm_publish_time":1783940641004,"dist-tags":{"latest":"1.14.1"}}