diff --git a/package.json b/package.json index 729d1841..ef7c1187 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,6 @@ "culori": "^4.0.2", "dayjs": "^1.11.11", "dompurify": "^3.2.6", - "driver.js": "^1.3.1", "echarts": "^5.5.1", "file-saver": "^2.0.5", "has-ansi": "^5.0.1", diff --git a/src/hooks/use-driver.ts b/src/hooks/use-driver.ts deleted file mode 100644 index c923d975..00000000 --- a/src/hooks/use-driver.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { useIntl } from '@umijs/max'; -import { driver, type Config } from 'driver.js'; -import { useEffect, useRef } from 'react'; - -export const useDriver = (config?: Config & { id: string }) => { - const intl = useIntl(); - const driverRef = useRef(null); - - const handleDoNotShowAgain = () => {}; - - const init = () => { - driverRef.current = driver({ - overlayOpacity: 0.2, - animate: false, - ...config - }); - }; - - const start = () => { - if (!driverRef.current) { - init(); - } - driverRef.current.drive(); - }; - - useEffect(() => { - return () => { - driverRef.current?.destroy(); - }; - }, []); - - return { start, initDriver: init, driver: driverRef.current }; -}; - -export default useDriver;