{"name":"@rc-component/tour","version":"2.0.0","keywords":["react","react-component","react-tour"],"author":{"name":"wangning4567@163.com"},"license":"MIT","_id":"@rc-component/tour@2.0.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"}],"homepage":"https://github.com/react-component/tour","bugs":{"url":"https://github.com/react-component/tour/issues"},"dist":{"shasum":"846fb3aa0e97f10f702235ce8aa0c61966d5f2b7","tarball":"http://registry-npm.ywwl.com/@rc-component/tour/download/@rc-component/tour-2.0.0.tgz","fileCount":43,"integrity":"sha512-W8rljh28OcIA0sgLwaoZELs/hTS8t/Ox5G+5PSrQuzn3VUM0EnLA+CL/J8VsH6uX0RMa/xSIubyVPq9SLiaOQA==","signatures":[{"sig":"MEUCIQDHK0lnDe6RfraPtw2E9OPYG7u9AzK+wr4wNKhZKB/2RAIgTZ74b+GltrCh65CDvE26zejhnHYI5EKNEeQdHnHZhtU=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":59430,"size":11231,"noattachment":false,"key":"/@rc-component/tour/-/@rc-component/tour-2.0.0.tgz"},"main":"./lib/index","module":"./es/index","engines":{"node":">=8.x"},"gitHead":"e840ed3b18a4f41da99d7420d5379e378c190ae5","scripts":{"lint":"eslint src/ --ext .tsx,.ts","test":"umi-test","start":"dumi dev","watch":"father dev","deploy":"npm run docs:build && npm run docs:deploy","compile":"father build","prepare":"dumi setup","lint:tsc":"tsc -p tsconfig.json --noEmit","prettier":"prettier --write \"**/*.{js,jsx,tsx,ts,less,md,json}\"","now-build":"npm run docs:build","docs:build":"dumi build","docs:deploy":"gh-pages -d docs-dist","prepublishOnly":"npm run compile && rc-np"},"typings":"es/index.d.ts","_npmUser":{"name":"zombiej","email":"smith3816@gmail.com"},"repository":{"url":"git+https://github.com/react-component/tour.git","type":"git"},"_npmVersion":"10.8.2","description":"React tour Component","directories":{},"_nodeVersion":"22.5.1","dependencies":{"rc-util":"^5.24.4","classnames":"^2.3.2","@babel/runtime":"^7.18.0","@rc-component/portal":"^1.0.0-9","@rc-component/trigger":"^2.0.0"},"_hasShrinkwrap":false,"devDependencies":{"dumi":"^2.1.2","react":"^18.3.1","eslint":"^7.18.0","father":"^4.0.0","cheerio":"1.0.0-rc.12","gh-pages":"^3.1.0","prettier":"^3.0.0","umi-test":"^1.9.7","react-dom":"^18.3.1","typescript":"^5.0.0","@types/jest":"^29.0.0","@types/react":"^18.0.0","@umijs/fabric":"^2.5.2","@rc-component/np":"^1.0.3","@types/react-dom":"^18.0.0","@testing-library/react":"^15.0.0","@testing-library/jest-dom":"^5.16.4","@rc-component/father-plugin":"^2.0.3"},"peerDependencies":{"react":">=16.9.0","react-dom":">=16.9.0"},"_npmOperationalInternal":{"tmp":"tmp/tour_2.0.0_1737803655270_0.7378333101521641","host":"s3://npm-registry-packages-npm-production"},"readme":"# @rc-component/tour\n\nReact 18 supported Tour Component.\n\n[![NPM version][npm-image]][npm-url] [![dumi](https://img.shields.io/badge/docs%20by-dumi-blue?style=flat-square)](https://github.com/umijs/dumi) [![build status][github-actions-image]][github-actions-url] [![Codecov][codecov-image]][codecov-url] [![npm download][download-image]][download-url]\n\n[npm-image]: http://img.shields.io/npm/v/@rc-component/tour.svg?style=flat-square\n[npm-url]: http://npmjs.org/package/@rc-component/tour\n[github-actions-image]: https://github.com/react-component/tour/workflows/CI/badge.svg\n[github-actions-url]: https://github.com/react-component/tour/actions\n[codecov-image]: https://img.shields.io/codecov/c/github/react-component/tour/master.svg?style=flat-square\n[codecov-url]: https://app.codecov.io/gh/react-component/tour\n[download-image]: https://img.shields.io/npm/dm/@rc-component/tour.svg?style=flat-square\n[download-url]: https://npmjs.org/package/@rc-component/tour\n\n## Development\n\n```bash\nnpm install\nnpm start\nopen http://localhost:8000\n```\n\n## Feature\n\n- React life cycle support tour component\n\n## Install\n\n[![@rc-component/tour](https://nodei.co/npm/@rc-component/tour.png)](https://www.npmjs.com/package/@rc-component/tour)\n\n## Usage\n\n<!-- prettier-ignore -->\n```js | pure\nimport { useRef } from 'react';\nimport Tour from '@rc-component/tour';\n\nconst Demo = () => {\n    const createBtnRef = useRef<HTMLButtonElement>(null);\n    const updateBtnRef = useRef<HTMLButtonElement>(null);\n    const deleteBtnRef = useRef<HTMLButtonElement>(null);\n    return (\n        <div style={{ margin: 20 }}>\n            <div>\n                <button\n                    className=\"ant-target\"\n                    ref={createBtnRef}\n                    style={{ marginLeft: 100 }}\n                >\n                    Create\n                </button>\n                <div style={{ height: 200 }} />\n                <button className=\"ant-target\" ref={updateBtnRef}>\n                    Update\n                </button>\n                <button className=\"ant-target\" ref={deleteBtnRef}>\n                    Delete\n                </button>\n            </div>\n\n            <div style={{ height: 200 }} />\n\n            <Tour\n                defaultCurrent={0}\n                steps={[\n                    {\n                        title: '创建',\n                        description: '创建一条数据',\n                        target: () => createBtnRef.current,\n                        mask: true,\n                    },\n                    {\n                        title: '更新',\n                        description: (\n                            <div>\n                                <span>更新一条数据</span>\n                                <button>帮助文档</button>\n                            </div>\n                        ),\n                        target: () => updateBtnRef.current,\n                    },\n                    {\n                        title: '删除',\n                        description: (\n                            <div>\n                                <span>危险操作：删除一条数据</span>\n                                <button>帮助文档</button>\n                            </div>\n                        ),\n                        target: () => deleteBtnRef.current,\n                        mask: true,\n                        style: { color: 'red' },\n                    },\n                ]}\n            />\n        </div>\n    );\n};\n\nexport default Demo;\n```\n\n## 🔥 API\n\nWe use typescript to create the Type definition. You can view directly in IDE. But you can still check the type definition [here](https://github.com/react-component/tour/blob/master/src/interface.ts).\n\n### Tour\n\n<!-- prettier-ignore -->\n| 属性 | 类型 | 默认值 | 说明 |\n| --- | --- | --- | --- |\n| closeIcon | `React.ReactNode` | - | 自定义关闭按钮 |\n| steps | `TourStepProps[]` | - | 引导步骤 |\n| open | `boolean` | `true` | 受控打开引导（与 `current` 受控分开） |\n| current | `number` | 0 | 受控当前处于哪一步 |\n| defaultCurrent | `number` | 0 | 默认处于哪一步 |\n| gap | `{ offset?: number \\| [number, number]; radius?: number }` | - | 控制引导显示间距 |\n| onChange | `(current: number) => void` | - | 步骤改变时的回调，`current`为改变前的步骤，`next`为改变后的步骤 |\n| onClose | `(current: number) => void` | - | 关闭引导时的回调 |\n| onFinish | `() => void` | - | 完成引导时的回调 |\n| mask | `boolean \\| { style?: React.CSSProperties; color?: string; }` | `true` | 整体是否启用蒙层，也可以传入自定义样式修改蒙层样式 |\n| animated | `boolean \\| { placeholder: boolean }` | `false` | 是否启用目标遮罩动画 |\n| arrow | `boolean \\| { pointAtCenter: boolean}` | `true` | 整体是否显示箭头，包含是否指向元素中心的配置 |\n| scrollIntoViewOptions | `boolean \\| ScrollIntoViewOptions` | `true` | 是否支持当前元素滚动到视窗内，也可传入配置指定滚动视窗的相关参数 |\n| onPopupAlign | `function(popupDomNode, align)` | - | 当弹出框对齐后回调 |\n| zIndex | `number` | 1001 | 弹层的层级 |\n\n### TourStep\n\n<!-- prettier-ignore -->\n| 属性 | 类型 | 默认值 | 说明 |\n| --- | --- | --- | --- |\n| closeIcon | `React.ReactNode` | - | 自定义关闭按钮 |\n| target | `() => HTMLElement` \\|  `HTMLElement` | - | 获取引导卡片指向的元素 |\n| arrow | `boolean` \\| `{ pointAtCenter: boolean}` | `true` | 是否显示箭头，包含是否指向元素中心的配置 |\n| placement | `left` \\| `leftTop` \\| `leftBottom` \\| `right` \\| `rightTop` \\| `rightBottom` \\| `top` \\| `topLeft` \\| `topRight` \\| `bottom`  \\| `bottomLeft` \\| `bottomRight` | `bottom` | 引导卡片相对于目标元素的位置 |\n| onClose | `() => void` | - | 关闭引导时的回调函数 |\n| mask | `boolean \\| { style?: React.CSSProperties; color?: string; }` | `true` | 是否启用蒙层，也可以传入自定义样式修改蒙层样式，默认跟随 Tour 的 `mask` 属性 |\n| renderPanel | `(props: TourStepProps, current: number) => ReactNode;` |  | 渲染 popoup 弹窗方法 |\n| className | `string` | - | - |\n| style | `React.CSSProperties` | - | - |\n| scrollIntoViewOptions | `boolean \\| ScrollIntoViewOptions` | `true` | 是否支持当前元素滚动到视窗内，也可传入配置指定滚动视窗的相关参数，默认跟随 Tour 的 `scrollIntoViewOptions` 属性 |\n\n## 🤝 Contributing \n\n<a href=\"https://openomy.app/github/react-component/tour\" target=\"_blank\" style=\"display: block; width: 100%;\" align=\"center\">\n  <img src=\"https://openomy.app/svg?repo=react-component/tour&chart=bubble&latestMonth=24\" target=\"_blank\" alt=\"Contribution Leaderboard\" style=\"display: block; width: 100%;\" />\n</a>\n","publish_time":1737803655513,"_cnpm_publish_time":1737803655513,"dist-tags":{"latest":"2.4.0"}}