{"name":"@rc-component/util","version":"1.6.0","keywords":["react","util"],"license":"MIT","_id":"@rc-component/util@1.6.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":"http://github.com/react-component/util","bugs":{"url":"http://github.com/react-component/util/issues"},"dist":{"shasum":"4f700da5417eb5fd5f9491f08edcba6d075d9454","tarball":"http://registry-npm.ywwl.com/@rc-component/util/download/@rc-component/util-1.6.0.tgz","fileCount":163,"integrity":"sha512-YbjuIVAm8InCnXVoA4n6G+uh31yESTxQ6fSY2frZ2/oMSvktoB+bumFUfNN7RKh7YeOkZgOvN2suGtEDhJSX0A==","signatures":[{"sig":"MEYCIQD8AZP1dEsVx5JBNcpRa/fNKcZb3IgF/i13bKmW2UI7EAIhANAwaLoRoghZEHsRjf77g8ezt8vEs1vBVNRAGGrwWUph","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":187135,"size":34534,"noattachment":false,"key":"/@rc-component/util/-/@rc-component/util-1.6.0.tgz"},"main":"./lib/index","types":"./lib/index.d.ts","module":"./es/index","gitHead":"7e344f2722e34a92e59999a8029b54ac823bcfbf","scripts":{"lint":"eslint src/ --ext .tsx,.ts & eslint tests/ --ext .tsx,.ts","test":"rc-test","build":"dumi build","start":"dumi dev","compile":"father build","prepare":"husky install","coverage":"npm test -- --coverage","prepublishOnly":"npm run compile && rc-np"},"_npmUser":{"name":"zombiej","email":"smith3816@gmail.com"},"repository":{"url":"git+ssh://git@github.com/react-component/util.git","type":"git"},"_npmVersion":"10.9.2","description":"Common Utils For React Component","directories":{},"lint-staged":{"**/*.{js,jsx,tsx,ts,md,json}":["prettier --write","git add"]},"_nodeVersion":"22.15.1","dependencies":{"react-is":"^18.2.0","is-mobile":"^5.0.0"},"_hasShrinkwrap":false,"devDependencies":{"dumi":"^2.1.3","glob":"^11.0.3","husky":"^9.1.6","react":"^18.0.0","eslint":"^8.54.0","father":"^4.1.3","rc-test":"^7.0.14","prettier":"^3.3.2","react-19":"npm:react@19.0.0","cross-env":"^7.0.2","react-dom":"^18.0.0","typescript":"^5.3.2","@types/jest":"^30.0.0","@types/node":"^24.6.1","lint-staged":"^15.1.0","@types/react":"^18.0.0","react-dom-19":"npm:react-dom@19.0.0","@umijs/fabric":"^3.0.0","@types/warning":"^3.0.0","@types/react-is":"^19.0.0","@rc-component/np":"^1.0.3","@types/react-dom":"^18.0.0","eslint-plugin-jest":"^29.0.1","@types/responselike":"^1.0.0","eslint-plugin-unicorn":"^56.0.1","@testing-library/react":"^16.0.0","@rc-component/father-plugin":"^2.0.1"},"peerDependencies":{"react":">=18.0.0","react-dom":">=18.0.0"},"_npmOperationalInternal":{"tmp":"tmp/util_1.6.0_1765269923848_0.7930885749737957","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":1765269924009,"_cnpm_publish_time":1765269924009,"dist-tags":{"latest":"1.14.1"}}