├── .changelogrc.js ├── .commitlintrc.js ├── .dumi ├── theme │ └── slots │ │ ├── ApiHeader │ │ └── index.tsx │ │ ├── Footer │ │ └── index.tsx │ │ └── NotFound │ │ ├── index.less │ │ ├── index.tsx │ │ ├── utils.less │ │ ├── variables.css │ │ └── variables.less └── tsconfig.json ├── .dumirc.ts ├── .editorconfig ├── .eslintrc.js ├── .fatherrc.ts ├── .gitattributes ├── .github ├── CONTRIBUTING.md ├── FUNDING.yml ├── ISSUE_TEMPLATE │ ├── .github │ │ └── ISSUE_TEMPLATE │ │ │ └── question.md │ ├── bug_report.md │ └── feature_request.md ├── PULL_REQUEST_TEMPLATE.md ├── commit-convention.md ├── dependabot.yml ├── renovate.json ├── stale.yml └── workflows │ ├── automerge.yml │ ├── ci.yml │ ├── clear.yml │ ├── contributor-help.yml │ ├── coverage.yml │ ├── deploy.yml │ ├── emoji-helper.yml │ ├── images.yml │ ├── issue-label.yml │ ├── issue-reply.yml │ ├── notfoundbot.yml │ ├── pr-welcome.yml │ ├── preview.yml │ ├── release.yml │ ├── sync.yml │ └── test.yml ├── .gitignore ├── .gitpod.yml ├── .husky ├── commit-msg └── pre-commit ├── .npmrc ├── .prettierignore ├── .prettierrc.js ├── .releaserc.js ├── .stylelintrc ├── .vscode └── settings.json ├── CHANGELOG.md ├── LICENSE ├── PULL_REQUEST_TEMPLATE.md ├── README.md ├── config ├── features.ts └── footer.tsx ├── copy.sh ├── docs ├── changelog.md ├── guide │ ├── DumiSiteProvider.zh-CN.md │ ├── Features.zh-CN.md │ ├── Hero.zh-CN.md │ ├── Highlighter.zh-CN.md │ ├── api-header.md │ ├── builtin.md │ ├── demo.md │ ├── demos │ │ ├── Antd.tsx │ │ ├── AntdLight.tsx │ │ ├── ApiHeader.tsx │ │ ├── DumiSiteProvider.tsx │ │ ├── Features │ │ │ ├── config.ts │ │ │ └── index.tsx │ │ ├── Footer.tsx │ │ ├── Hero.tsx │ │ ├── Highlighter │ │ │ ├── Prism.tsx │ │ │ ├── Shiki.tsx │ │ │ └── ShikiTheme.tsx │ │ ├── Left.tsx │ │ ├── Right.tsx │ │ ├── Toc.tsx │ │ ├── Top.tsx │ │ └── inheritSiteTheme.tsx │ ├── dev.md │ ├── footer.zh-CN.md │ ├── index.md │ ├── markdown.zh-CN.md │ ├── syntax-highlighter.md │ ├── tab.md │ ├── theme.md │ └── toc.md └── index.md ├── eslint.config.js ├── package.json ├── public ├── logo.png └── robots.txt ├── renovate.json ├── src ├── hooks │ ├── index.md │ ├── index.ts │ ├── useBattery │ │ ├── demos │ │ │ └── index.tsx │ │ ├── index.md │ │ └── index.tsx │ ├── useControlled │ │ ├── demos │ │ │ └── index.tsx │ │ ├── index.md │ │ └── index.ts │ ├── useCookie │ │ ├── demos │ │ │ └── index.tsx │ │ ├── index.md │ │ └── index.tsx │ ├── useCopy │ │ ├── demos │ │ │ └── index.tsx │ │ ├── index.md │ │ └── index.tsx │ ├── useCountDown │ │ ├── demos │ │ │ └── index.tsx │ │ ├── index.md │ │ └── index.ts │ ├── useCounter │ │ ├── demos │ │ │ └── index.tsx │ │ ├── index.md │ │ └── index.tsx │ ├── useCycleList │ │ ├── demos │ │ │ └── index.tsx │ │ ├── index.md │ │ └── index.ts │ ├── useDebounce │ │ ├── demos │ │ │ └── index.tsx │ │ ├── index.md │ │ └── index.ts │ ├── useEvent │ │ ├── demos │ │ │ └── index.tsx │ │ ├── index.md │ │ └── index.tsx │ ├── useFileDownloader │ │ ├── demos │ │ │ └── index.tsx │ │ ├── index.md │ │ └── index.tsx │ ├── useFirstMountState │ │ ├── demos │ │ │ └── index.tsx │ │ ├── index.md │ │ └── index.tsx │ ├── useGeolocation │ │ ├── demos │ │ │ └── index.tsx │ │ ├── index.md │ │ └── index.tsx │ ├── useHover │ │ ├── demos │ │ │ └── index.tsx │ │ ├── index.md │ │ └── index.tsx │ ├── useHoverDirty │ │ ├── demos │ │ │ └── index.tsx │ │ ├── index.md │ │ └── index.tsx │ ├── useIdle │ │ ├── demos │ │ │ └── index.tsx │ │ ├── index.md │ │ └── index.tsx │ ├── useInterval │ │ ├── demos │ │ │ └── index.tsx │ │ ├── index.md │ │ └── index.ts │ ├── useLatest │ │ ├── demos │ │ │ └── index.tsx │ │ ├── index.md │ │ └── index.tsx │ ├── useLocal │ │ ├── demos │ │ │ └── index.tsx │ │ ├── index.md │ │ ├── index.ts │ │ └── index.tsx │ ├── useLocalStorage │ │ ├── demos │ │ │ └── index.tsx │ │ ├── index.md │ │ └── index.ts │ ├── useLocation │ │ ├── demos │ │ │ └── index.tsx │ │ ├── index.md │ │ └── index.tsx │ ├── useMeasure │ │ ├── demos │ │ │ └── index.tsx │ │ ├── index.md │ │ └── index.tsx │ ├── useMedia │ │ ├── demos │ │ │ └── index.tsx │ │ ├── index.md │ │ └── index.tsx │ ├── useMediaDevices │ │ ├── demos │ │ │ └── index.tsx │ │ ├── index.md │ │ └── index.tsx │ ├── useMount │ │ ├── demos │ │ │ └── index.tsx │ │ ├── index.md │ │ └── index.tsx │ ├── useMountedState │ │ ├── demos │ │ │ └── index.tsx │ │ ├── index.md │ │ └── index.tsx │ ├── useNetwork │ │ ├── demos │ │ │ └── index.tsx │ │ ├── index.md │ │ └── index.tsx │ ├── usePrevious │ │ ├── demos │ │ │ └── index.tsx │ │ ├── index.md │ │ └── index.ts │ ├── useRafState │ │ ├── demos │ │ │ └── index.tsx │ │ ├── index.md │ │ └── index.ts │ ├── useSafeState │ │ ├── demos │ │ │ └── index.tsx │ │ ├── index.md │ │ └── index.tsx │ ├── useSessionStorage │ │ ├── demos │ │ │ └── index.tsx │ │ ├── index.md │ │ ├── index.ts │ │ └── index.tsx │ ├── useThrottle │ │ ├── demos │ │ │ └── index.tsx │ │ ├── index.md │ │ └── index.ts │ ├── useToggle │ │ ├── demos │ │ │ └── index.tsx │ │ ├── index.md │ │ └── index.tsx │ ├── useUnmount │ │ ├── demos │ │ │ └── index.tsx │ │ ├── index.md │ │ └── index.tsx │ ├── useUnmountedRef │ │ ├── demos │ │ │ └── index.tsx │ │ ├── index.md │ │ └── index.tsx │ └── useVirtualList │ │ ├── demos │ │ └── index.tsx │ │ ├── index.md │ │ └── index.ts ├── index.ts └── utils │ ├── date │ ├── demos │ │ └── index.tsx │ ├── index.md │ └── index.ts │ ├── index.md │ └── index.ts ├── tea.yaml ├── tests └── test-setup.ts ├── tsconfig-check.json ├── tsconfig.json └── vitest.config.ts /.changelogrc.js: -------------------------------------------------------------------------------- 1 | // 详情配置查看 https://github.com/arvinxx/gitmoji-commit-workflow/tree/master/packages/changelog#readme 2 | module.exports = { 3 | displayTypes: ['feat', 'fix', 'styles', 'pref', 'build'], 4 | titleLanguage: 'zh-CN', 5 | showAuthor: true, 6 | showAuthorAvatar: true, 7 | showSummary: true, 8 | reduceHeadingLevel: true, 9 | newlineTimestamp: true, 10 | addBackToTop: true, 11 | }; 12 | -------------------------------------------------------------------------------- /.commitlintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | extends: ['gitmoji'], 3 | }; 4 | -------------------------------------------------------------------------------- /.dumi/theme/slots/ApiHeader/index.tsx: -------------------------------------------------------------------------------- 1 | import { SmileOutlined } from '@ant-design/icons'; 2 | import { ApiHeader as Header, siteSelectors, useSiteStore } from 'dumi-theme-antd-style'; 3 | import { FC, memo } from 'react'; 4 | 5 | const ApiHeader: FC = memo(() => { 6 | const props = useSiteStore(siteSelectors.apiHeader); 7 | const { pkg } = props; 8 | 9 | const packages = [ 10 | { 11 | label: 'icon', 12 | icon: , 13 | children: 'demo', 14 | url: `https://www.npmjs.com/package/${pkg}`, 15 | }, 16 | ]; 17 | 18 | return
; 19 | }); 20 | 21 | export default ApiHeader; 22 | -------------------------------------------------------------------------------- /.dumi/theme/slots/Footer/index.tsx: -------------------------------------------------------------------------------- 1 | import { 2 | GithubOutlined, 3 | HistoryOutlined, 4 | IssuesCloseOutlined, 5 | MediumOutlined, 6 | TwitterOutlined, 7 | ZhihuOutlined, 8 | } from '@ant-design/icons'; 9 | import { Footer } from 'dumi-theme-antd-style'; 10 | 11 | export default () => { 12 | const footerColumns = [ 13 | { 14 | title: '相关资源', 15 | items: [ 16 | { 17 | title: 'Ant Design Pro', 18 | url: 'https://pro.ant.design', 19 | openExternal: true, 20 | }, 21 | { 22 | title: 'Ant Design Pro Components', 23 | url: 'https://procomponents.ant.design', 24 | openExternal: true, 25 | }, 26 | { 27 | title: 'Umi', 28 | description: 'React 应用开发框架', 29 | url: 'https://umijs.org', 30 | openExternal: true, 31 | }, 32 | { 33 | title: 'Dumi', 34 | description: '组件/文档研发工具', 35 | url: 'https://d.umijs.org', 36 | openExternal: true, 37 | }, 38 | { 39 | title: 'qiankun', 40 | description: '微前端框架', 41 | url: 'https://qiankun.umijs.org', 42 | openExternal: true, 43 | }, 44 | ], 45 | }, 46 | { 47 | title: '社区', 48 | items: [ 49 | { 50 | icon: , 51 | title: 'Medium', 52 | url: 'http://medium.com/ant-design/', 53 | openExternal: true, 54 | }, 55 | { 56 | icon: , 57 | title: 'Twitter', 58 | url: 'http://twitter.com/antdesignui', 59 | openExternal: true, 60 | }, 61 | { 62 | icon: ( 63 | yuque 67 | ), 68 | title: 'Ant Design 语雀专栏', 69 | url: 'https://yuque.com/ant-design/ant-design', 70 | openExternal: true, 71 | }, 72 | { 73 | icon: , 74 | title: 'Ant Design 知乎专栏', 75 | url: 'https://www.zhihu.com/column/c_1564262000561106944', 76 | openExternal: true, 77 | }, 78 | { 79 | icon: , 80 | title: '体验科技专栏', 81 | url: 'http://zhuanlan.zhihu.com/xtech', 82 | openExternal: true, 83 | }, 84 | { 85 | icon: ( 86 | seeconf 90 | ), 91 | title: 'SEE Conf', 92 | description: 'SEE Conf-蚂蚁体验科技大会', 93 | url: 'https://seeconf.antfin.com/', 94 | openExternal: true, 95 | }, 96 | ], 97 | }, 98 | { 99 | title: '帮助', 100 | items: [ 101 | { 102 | icon: , 103 | title: 'GitHub', 104 | url: 'https://github.com/h7ml/hooks.git', 105 | openExternal: true, 106 | }, 107 | { 108 | icon: , 109 | title: '更新日志', 110 | url: '/changelog', 111 | // LinkComponent: Link, 112 | }, 113 | 114 | { 115 | icon: , 116 | title: '讨论', 117 | url: 'https://github.com/h7ml/hooks/issues', 118 | openExternal: true, 119 | }, 120 | ], 121 | }, 122 | { 123 | icon: ( 124 | more products 128 | ), 129 | title: '更多产品', 130 | items: [ 131 | { 132 | icon: ( 133 | yuque 137 | ), 138 | title: '语雀', 139 | url: 'https://yuque.com', 140 | description: '知识创作与分享工具', 141 | openExternal: true, 142 | }, 143 | { 144 | icon: ( 145 | AntV 149 | ), 150 | title: 'AntV', 151 | url: 'https://antv.vision', 152 | description: '数据可视化解决方案', 153 | openExternal: true, 154 | }, 155 | { 156 | icon: Egg, 157 | title: 'Egg', 158 | url: 'https://eggjs.org', 159 | description: '企业级 Node.js 框架', 160 | openExternal: true, 161 | }, 162 | { 163 | icon: ( 164 | kitchen 168 | ), 169 | title: 'Kitchen', 170 | description: 'Sketch 工具集', 171 | url: 'https://kitchen.alipay.com', 172 | openExternal: true, 173 | }, 174 | { 175 | icon: ( 176 | xtech 180 | ), 181 | title: '蚂蚁体验科技', 182 | url: 'https://xtech.antfin.com/', 183 | openExternal: true, 184 | }, 185 | ], 186 | }, 187 | ]; 188 | const currentYear = new Date().getFullYear(); 189 | 190 | return ( 191 |