kamrify commited on
Commit
acbae00
·
1 Parent(s): e9333a2

Fix type definitions not found

Browse files
docs/package.json CHANGED
@@ -16,6 +16,7 @@
16
  "@types/react": "^18.0.21",
17
  "@types/react-dom": "^18.0.6",
18
  "astro": "^2.7.0",
 
19
  "react": "^18.0.0",
20
  "react-dom": "^18.0.0",
21
  "react-fast-marquee": "^1.6.0",
 
16
  "@types/react": "^18.0.21",
17
  "@types/react-dom": "^18.0.6",
18
  "astro": "^2.7.0",
19
+ "driver.js": "1.1.1-next.0",
20
  "react": "^18.0.0",
21
  "react-dom": "^18.0.0",
22
  "react-fast-marquee": "^1.6.0",
docs/pnpm-lock.yaml CHANGED
@@ -23,6 +23,9 @@ dependencies:
23
  astro:
24
  specifier: ^2.7.0
25
  version: 2.7.0
 
 
 
26
  react:
27
  specifier: ^18.0.0
28
  version: 18.2.0
@@ -1373,6 +1376,10 @@ packages:
1373
1374
  resolution: {integrity: sha512-+HlytyjlPKnIG8XuRG8WvmBP8xs8P71y+SKKS6ZXWoEgLuePxtDoUEiH7WkdePWrQ5JBpE6aoVqfZfJUQkjXwA==}
1375
 
 
 
 
 
1376
1377
  resolution: {integrity: sha512-g/M9sqy3oHe477Ar4voQxWtaPIFw1jTdKZuomOjhCcBx9nHUNn0pu6NopuFFrTh/TRZIKEj+76vLWFu9BNKk+Q==}
1378
  engines: {node: '>=4'}
 
23
  astro:
24
  specifier: ^2.7.0
25
  version: 2.7.0
26
+ driver.js:
27
+ specifier: 1.1.1-next.0
28
+ version: 1.1.1-next.0
29
  react:
30
  specifier: ^18.0.0
31
  version: 18.2.0
 
1376
1377
  resolution: {integrity: sha512-+HlytyjlPKnIG8XuRG8WvmBP8xs8P71y+SKKS6ZXWoEgLuePxtDoUEiH7WkdePWrQ5JBpE6aoVqfZfJUQkjXwA==}
1378
 
1379
1380
+ resolution: {integrity: sha512-hXBZzvcVsU0MlNozeQbp3S49fUuPaKTDVNQe2hKK57nQCmr5WgCE3QVi2IgDMeEI6a+z7UDpbRnCHJt+Lt/NkQ==}
1381
+ dev: false
1382
+
1383
1384
  resolution: {integrity: sha512-g/M9sqy3oHe477Ar4voQxWtaPIFw1jTdKZuomOjhCcBx9nHUNn0pu6NopuFFrTh/TRZIKEj+76vLWFu9BNKk+Q==}
1385
  engines: {node: '>=4'}
docs/src/components/examples/SimpleHighlight.tsx ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { useEffect } from "react";
2
+ import type { DriveStep } from "driver.js";
3
+
4
+ type SimpleHighlightProps = {
5
+ popover: DriveStep.Popover;
6
+ }
7
+
8
+ export function SimpleHighlight() {
9
+ useEffect(() => {
10
+ console.log('in browser');
11
+ }, []);
12
+ return (
13
+ <button onClick={() => alert('sup')} className='w-full rounded-md bg-black p-2 text-white'>Highlight Something</button>
14
+ );
15
+ }
docs/src/content/guides/basic-usage.mdx CHANGED
@@ -4,8 +4,11 @@ groupTitle: "Introduction"
4
  sort: 2
5
  ---
6
 
 
 
7
  Once installed, you can import and start using the library. Given below is a simple example of how to highlight a single element.
8
 
 
9
  ```js
10
  import Driver from 'driver.js';
11
  import 'driver.js/dist/driver.min.css';
@@ -19,6 +22,5 @@ driver.highlight({
19
  },
20
  });
21
  ```
22
-
23
- <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/driver.iife.js"></script>
24
- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/style.css"/>
 
4
  sort: 2
5
  ---
6
 
7
+ import { SimpleHighlight } from "../../components/examples/SimpleHighlight.tsx";
8
+
9
  Once installed, you can import and start using the library. Given below is a simple example of how to highlight a single element.
10
 
11
+ <div>
12
  ```js
13
  import Driver from 'driver.js';
14
  import 'driver.js/dist/driver.min.css';
 
22
  },
23
  });
24
  ```
25
+ <SimpleHighlight client:load />
26
+ </div>
 
docs/src/content/guides/installation.mdx CHANGED
@@ -4,6 +4,8 @@ groupTitle: "Introduction"
4
  sort: 1
5
  ---
6
 
 
 
7
  Run one of the following commands to install the package:
8
 
9
  ```bash
@@ -20,11 +22,10 @@ yarn add driver.js
20
  Alternatively, you can use CDN and include the script in your HTML file:
21
 
22
  ```html
23
- <script src="https://cdn.jsdelivr.net/npm/driver.js@1.0.0-next.0/dist/driver.js.iife.js"></script>
24
- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/driver.js@1.0.0-next.0/dist/style.css"/>
25
  ```
26
 
27
-
28
  ## Start Using
29
  Once installed, you can import the package in your project. The following example shows how to highlight an element:
30
 
@@ -42,4 +43,21 @@ driver.highlight({
42
  });
43
  ```
44
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
45
  Continue reading the [Getting Started](/docs/basic-usage) guide to learn more about the package.
 
4
  sort: 1
5
  ---
6
 
7
+ import { SimpleHighlight } from "../../components/examples/SimpleHighlight.js";
8
+
9
  Run one of the following commands to install the package:
10
 
11
  ```bash
 
22
  Alternatively, you can use CDN and include the script in your HTML file:
23
 
24
  ```html
25
+ <script src="https://cdn.jsdelivr.net/npm/driver.js@1.1.1-next.0/dist/driver.js.iife.js"></script>
26
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/driver.js@1.1.1-next.0/dist/style.css"/>
27
  ```
28
 
 
29
  ## Start Using
30
  Once installed, you can import the package in your project. The following example shows how to highlight an element:
31
 
 
43
  });
44
  ```
45
 
46
+ ### Note on CDN
47
+
48
+ If you are using the CDN, you will have to use the package from the `window` object:
49
+
50
+ ```js
51
+ const Driver = window.driver.js.driver;
52
+
53
+ const driver = new Driver();
54
+ driver.highlight({
55
+ element: "#some-element",
56
+ popover: {
57
+ title: "Title",
58
+ description: "Description"
59
+ }
60
+ });
61
+ ```
62
+
63
  Continue reading the [Getting Started](/docs/basic-usage) guide to learn more about the package.
docs/src/layouts/DocsLayout.astro CHANGED
@@ -22,7 +22,7 @@ const { groupTitle, sort, title } = guide.data;
22
  <Sidebar activePath={`/docs/${guide.slug}`} />
23
  <div class="flex-1 px-2 py-6">
24
  <Container>
25
- <div class="prose lg:proxe-xl mb-24">
26
  <slot />
27
  </div>
28
  </Container>
 
22
  <Sidebar activePath={`/docs/${guide.slug}`} />
23
  <div class="flex-1 px-2 py-6">
24
  <Container>
25
+ <div class="prose lg:proxe-xl mb-24 prose-blockquote:font-normal prose-blockquote:not-italic prose-blockquote:text-gray-500 prose-p:before:content-['']">
26
  <slot />
27
  </div>
28
  </Container>
package.json CHANGED
@@ -4,6 +4,7 @@
4
  "version": "1.1.1-next.0",
5
  "main": "./dist/driver.js.cjs",
6
  "module": "./dist/driver.js.mjs",
 
7
  "exports": {
8
  ".": {
9
  "require": "./dist/driver.js.cjs",
 
4
  "version": "1.1.1-next.0",
5
  "main": "./dist/driver.js.cjs",
6
  "module": "./dist/driver.js.mjs",
7
+ "types": "./dist/driver.js.d.ts",
8
  "exports": {
9
  ".": {
10
  "require": "./dist/driver.js.cjs",