diff --git a/docs/package.json b/docs/package.json index 4124090..ddd803b 100644 --- a/docs/package.json +++ b/docs/package.json @@ -16,7 +16,7 @@ "@types/react": "^18.0.21", "@types/react-dom": "^18.0.6", "astro": "^2.7.0", - "driver.js": "1.1.1-next.0", + "driver.js": "1.1.2-next.0", "react": "^18.0.0", "react-dom": "^18.0.0", "react-fast-marquee": "^1.6.0", diff --git a/docs/pnpm-lock.yaml b/docs/pnpm-lock.yaml index e785e94..e5ceac6 100644 --- a/docs/pnpm-lock.yaml +++ b/docs/pnpm-lock.yaml @@ -24,8 +24,8 @@ dependencies: specifier: ^2.7.0 version: 2.7.0 driver.js: - specifier: 1.1.1-next.0 - version: 1.1.1-next.0 + specifier: 1.1.2-next.0 + version: 1.1.2-next.0 react: specifier: ^18.0.0 version: 18.2.0 @@ -1376,8 +1376,8 @@ packages: /dlv@1.1.3: resolution: {integrity: sha512-+HlytyjlPKnIG8XuRG8WvmBP8xs8P71y+SKKS6ZXWoEgLuePxtDoUEiH7WkdePWrQ5JBpE6aoVqfZfJUQkjXwA==} - /driver.js@1.1.1-next.0: - resolution: {integrity: sha512-hXBZzvcVsU0MlNozeQbp3S49fUuPaKTDVNQe2hKK57nQCmr5WgCE3QVi2IgDMeEI6a+z7UDpbRnCHJt+Lt/NkQ==} + /driver.js@1.1.2-next.0: + resolution: {integrity: sha512-2VrKUesC5Cs0OTSze2fhpkiHF4+wNxEwwOuD9AtCWiLDhtwc5En3ktHeP057yhSfEvaUQihffchylQ001zEPSQ==} dev: false /dset@3.1.2: diff --git a/docs/src/components/examples/SimpleHighlight.tsx b/docs/src/components/examples/SimpleHighlight.tsx index 94429b6..0a58a6d 100644 --- a/docs/src/components/examples/SimpleHighlight.tsx +++ b/docs/src/components/examples/SimpleHighlight.tsx @@ -1,15 +1,25 @@ import { useEffect } from "react"; +import { Config, driver } from "driver.js"; +import "driver.js/dist/style.css"; + import type { DriveStep } from "driver.js"; type SimpleHighlightProps = { - popover: DriveStep.Popover; -} + config: Config; + step: DriveStep; +}; + +export function SimpleHighlight(props: SimpleHighlightProps) { + const { config, step } = props; + + function onClick() { + const driverObj = driver(config); + driverObj.highlight(step); + } -export function SimpleHighlight() { - useEffect(() => { - console.log('in browser'); - }, []); return ( - + ); -} \ No newline at end of file +} diff --git a/docs/src/content/guides/basic-usage.mdx b/docs/src/content/guides/basic-usage.mdx index 5d97d8a..ec34f47 100644 --- a/docs/src/content/guides/basic-usage.mdx +++ b/docs/src/content/guides/basic-usage.mdx @@ -8,19 +8,25 @@ import { SimpleHighlight } from "../../components/examples/SimpleHighlight.tsx"; Once installed, you can import and start using the library. Given below is a simple example of how to highlight a single element. -
-```js -import Driver from 'driver.js'; -import 'driver.js/dist/driver.min.css'; +
+ ```js + import Driver from 'driver.js'; + import 'driver.js/dist/driver.min.css'; -const driver = new Driver(); -driver.highlight({ + const driver = new Driver(); + driver.highlight({ element: '#some-element', popover: { - title: 'Title for the Popover', - description: 'Description for it', - }, + title: 'Title for the Popover', + description: 'Description for it', +}, }); -``` - + ``` +
\ No newline at end of file diff --git a/index.html b/index.html index be1e399..4044811 100644 --- a/index.html +++ b/index.html @@ -338,6 +338,7 @@ npm install driver.js