{"name":"@rc-component/tour","version":"1.7.0","description":"React tour Component","keywords":["react","react-component","react-tour"],"homepage":"https://github.com/react-component/tour","bugs":{"url":"https://github.com/react-component/tour/issues"},"repository":{"type":"git","url":"git+https://github.com/react-component/tour.git"},"license":"MIT","author":{"name":"wangning4567@163.com"},"main":"./lib/index","module":"./es/index","typings":"es/index.d.ts","scripts":{"compile":"father build","deploy":"npm run docs:build && npm run docs:deploy","docs:build":"dumi build","docs:deploy":"gh-pages -d docs-dist","lint":"eslint src/ --ext .tsx,.ts","lint:tsc":"tsc -p tsconfig.json --noEmit","now-build":"npm run docs:build","prepublishOnly":"npm run compile && np --no-cleanup --yolo --no-publish","prettier":"prettier --write \"**/*.{js,jsx,tsx,ts,less,md,json}\"","prepare":"dumi setup","start":"dumi dev","test":"umi-test","watch":"father dev"},"dependencies":{"@babel/runtime":"^7.18.0","@rc-component/portal":"^1.0.0-9","@rc-component/trigger":"^1.3.6","classnames":"^2.3.2","rc-util":"^5.24.4"},"devDependencies":{"@testing-library/jest-dom":"^5.16.4","@testing-library/react":"^13.0.0","@types/jest":"^26.0.20","@types/react":"^18.0.0","@types/react-dom":"^18.0.0","@umijs/fabric":"^2.5.2","dumi":"^2.1.2","eslint":"^7.18.0","father":"^4.0.0-rc.8","gh-pages":"^3.1.0","np":"^5.0.3","prettier":"^2.1.2","react":"^18.0.0","react-dom":"^18.0.0","typescript":"^4.6.3","umi-test":"^1.9.7"},"peerDependencies":{"react":">=16.9.0","react-dom":">=16.9.0"},"engines":{"node":">=8.x"},"gitHead":"4bcb16a9b08235e011b3d815cdd8e53ecc72b7d2","_id":"@rc-component/tour@1.7.0","_nodeVersion":"16.19.1","_npmVersion":"9.5.0","dist":{"integrity":"sha512-wZzF1795O68fT/5/ixegZtOYHOOjl1sHmVn0KXu1EgPktpHLLR0KKfbEWMZW02PLHPGa/qZ7PKEld1gaNfalSQ==","shasum":"8f19bc8eca396fe7fce1f465859fec4276998d9c","tarball":"http://registry-npm.ywwl.com/@rc-component/tour/download/@rc-component/tour-1.7.0.tgz","fileCount":35,"unpackedSize":55378,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICgUNZXFj2Kj9HDIFzUElBVd3ZonLkktgNqW26aZLCqiAiEAl59/sXZjmibvx+OtUc590mQPqubjhSV3CCxTZUGPXJ8="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj9X8XACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpDjhAAmdcL5mmU6f4TGNa9spVaZnm/mqF7I7YhIx9TU+VhL4zOEjgl\r\nbxJArs1ElVEuu1uFYVG6wIIbQ9GBnetb6oL9m+UfAfYQBnU7RwB4JBNuPl1H\r\nTpzf3tuOxm/efuzOxcRvWPAL9SI/UOehm66pa36xnHEv7lNDrbwj/7JL058T\r\nC9/10EQWqDnoESH0vAZtaSog99bASSr77rYx7UA8CMctXzzFcYVQ/IzCuEyM\r\nQ3YDzq7WI74fVNx2qYa7zCBU8Avahtn81OlY7TVVHUqn5TC63UY7O6BptkJR\r\nORG5QXLA32Ea0YozqiwpUwT6sjNOuJT8tMfQJ7DwCR/MNUY8hLm4MJ+oU8Mo\r\n0TDA3yVVuS2wkDcsQ0/fgqvLa68Cwx/e08ZE6cgEuM+9Xe8FKYY/MMr+EA4J\r\nFIIQH4g6A7VOLl6QsfMs2nsPLIrYNy1CBOMe7lisdYv+Np+QW8nnhhhNKQk+\r\nrEgjNcHQpWs3z0M2TmkfRifT9hwRvT6IjDMh9R+zNaKIeqDXR+i3OU5l0gNq\r\ndiuhb5lZR0mVH7ALumlxLazp9pyxAudlyxra1/Wp4/cRQBFyH4PfgdN4KCXN\r\n3DYRnPw3Jgc1Vll+4KBw9ywK7OKNAt1q8ZO7i9OguUgJNx7c4YUgnf9uIhbC\r\nqupvE5kpC1fYQr9V6xynUUZdyX7362Vc9gw=\r\n=/L+f\r\n-----END PGP SIGNATURE-----\r\n","size":10273,"noattachment":false,"key":"/@rc-component/tour/-/@rc-component/tour-1.7.0.tgz"},"_npmUser":{"name":"afc163","email":"afc163@gmail.com"},"directories":{},"maintainers":[{"name":"peachscript","email":"scdzwyxst@gmail.com"},{"name":"madccc","email":"1075746765@qq.com"},{"name":"zombiej","email":"smith3816@gmail.com"},{"name":"afc163","email":"afc163@gmail.com"},{"name":"heiyu4585","email":"wangning4567@163.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/tour_1.7.0_1677033239187_0.969465674049693"},"_hasShrinkwrap":false,"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 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","publish_time":1677033239413,"_cnpm_publish_time":1677033239413,"dist-tags":{"latest":"2.4.0"}}