@altano/use-toc-visible-sections 2.0.0 → 2.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +18 -2
- package/package.json +36 -32
- package/dist/useTocVisibleSections.d.ts +0 -17
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { VisibleElementObserver } from '@altano/use-visible-elements';
|
|
3
|
+
|
|
4
|
+
declare function useVisibilityOfTarget(href: string): boolean;
|
|
5
|
+
type Options = {
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
useWrapperDiv?: true;
|
|
8
|
+
selector?: string;
|
|
9
|
+
intersectionOptions?: IntersectionObserverInit;
|
|
10
|
+
} | {
|
|
11
|
+
children: React.ReactElement;
|
|
12
|
+
useWrapperDiv: false;
|
|
13
|
+
selector?: string;
|
|
14
|
+
intersectionOptions?: IntersectionObserverInit;
|
|
15
|
+
};
|
|
16
|
+
declare function TocVisibleSectionObserver(options: Options): ReturnType<typeof VisibleElementObserver>;
|
|
17
|
+
|
|
18
|
+
export { TocVisibleSectionObserver, useVisibilityOfTarget };
|
package/package.json
CHANGED
|
@@ -1,64 +1,68 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@altano/use-toc-visible-sections",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.2",
|
|
4
4
|
"description": "Intersection-Observer-based Table of Contents Scroll Spy React Hook",
|
|
5
|
-
"
|
|
5
|
+
"homepage": "https://github.com/altano/npm-packages/tree/main/packages/use-toc-visible-sections",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "https://github.com/altano/npm-packages",
|
|
9
|
+
"directory": "packages/use-toc-visible-sections"
|
|
10
|
+
},
|
|
11
|
+
"license": "ISC",
|
|
12
|
+
"author": {
|
|
13
|
+
"name": "Alan Norbauer",
|
|
14
|
+
"email": "altano@gmail.com",
|
|
15
|
+
"url": "https://alan.norbauer.com"
|
|
16
|
+
},
|
|
6
17
|
"sideEffects": false,
|
|
18
|
+
"type": "module",
|
|
7
19
|
"exports": "./dist/index.js",
|
|
8
20
|
"types": "./dist/index.d.ts",
|
|
9
21
|
"files": [
|
|
10
22
|
"dist/**/*.js",
|
|
11
23
|
"dist/**/*.d.ts"
|
|
12
24
|
],
|
|
13
|
-
"author": {
|
|
14
|
-
"name": "Alan Norbauer",
|
|
15
|
-
"email": "altano@gmail.com",
|
|
16
|
-
"url": "https://alan.norbauer.com"
|
|
17
|
-
},
|
|
18
|
-
"license": "ISC",
|
|
19
|
-
"repository": {
|
|
20
|
-
"type": "git",
|
|
21
|
-
"url": "https://github.com/altano/npm-packages",
|
|
22
|
-
"directory": "packages/use-toc-visible-sections"
|
|
23
|
-
},
|
|
24
|
-
"homepage": "https://github.com/altano/npm-packages/tree/main/packages/use-toc-visible-sections",
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@altano/use-visible-elements": "2.0.
|
|
27
|
-
},
|
|
28
|
-
"peerDependencies": {
|
|
29
|
-
"react": "^18"
|
|
26
|
+
"@altano/use-visible-elements": "2.0.2"
|
|
30
27
|
},
|
|
31
28
|
"devDependencies": {
|
|
32
|
-
"@
|
|
33
|
-
"@
|
|
29
|
+
"@arethetypeswrong/cli": "^0.15.4",
|
|
30
|
+
"@playwright/test": "1.47.0",
|
|
31
|
+
"@types/node": "^22.13.10",
|
|
34
32
|
"@types/react": "^18.2.64",
|
|
35
33
|
"@types/react-dom": "^18.2.21",
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"
|
|
34
|
+
"depcheck": "^1.4.7",
|
|
35
|
+
"eslint": "^9.22.0",
|
|
36
|
+
"prettier": "^3.3.3",
|
|
37
|
+
"react": "^18.3.1",
|
|
39
38
|
"react-dom": "^18.2.0",
|
|
40
|
-
"typescript": "^5.
|
|
41
|
-
"vite": "^
|
|
42
|
-
"
|
|
43
|
-
"
|
|
39
|
+
"typescript": "^5.8.2",
|
|
40
|
+
"vite": "^6.2.3",
|
|
41
|
+
"vitest": "^3.0.9",
|
|
42
|
+
"@altano/build-config": "0.0.0",
|
|
43
|
+
"@altano/tsconfig": "0.0.0"
|
|
44
|
+
},
|
|
45
|
+
"peerDependencies": {
|
|
46
|
+
"react": "18.x.x"
|
|
44
47
|
},
|
|
45
48
|
"publishConfig": {
|
|
46
49
|
"access": "public"
|
|
47
50
|
},
|
|
48
51
|
"scripts": {
|
|
49
52
|
"build": "tsup --config build-config/tsup.config.browser.ts",
|
|
50
|
-
"
|
|
53
|
+
"check:exports": "attw --pack . --ignore-rules=cjs-resolves-to-esm",
|
|
54
|
+
"check:types:src": "tsc --noEmit",
|
|
55
|
+
"check:types:test": "tsc --noEmit --project ./tests/tsconfig.json",
|
|
56
|
+
"check:unused-dependencies": "depcheck",
|
|
51
57
|
"clean": "rm -rf .turbo && rm -rf .tsbuildinfo && rm -rf node_modules && rm -rf dist",
|
|
52
58
|
"dev": "pnpm run build --watch",
|
|
53
59
|
"format": "prettier --check src",
|
|
54
60
|
"format:fix": "prettier --write src",
|
|
55
|
-
"lint": "eslint
|
|
61
|
+
"lint": "eslint",
|
|
56
62
|
"lint:fix": "TIMING=1 pnpm lint --fix",
|
|
57
63
|
"lint:timing": "TIMING=1 pnpm lint",
|
|
58
64
|
"test:e2e": "playwright test",
|
|
59
65
|
"test:e2e:server": "vite --strictPort --port 4727 ./tests/e2e",
|
|
60
|
-
"test:e2e:ui": "playwright test --ui"
|
|
61
|
-
"typecheck:src": "tsc --noEmit",
|
|
62
|
-
"typecheck:test": "tsc --noEmit --project ./tests/tsconfig.json"
|
|
66
|
+
"test:e2e:ui": "playwright test --ui"
|
|
63
67
|
}
|
|
64
68
|
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { VisibleElementObserver } from "@altano/use-visible-elements";
|
|
3
|
-
export declare function useVisibilityOfTarget(href: string): boolean;
|
|
4
|
-
type Options = {
|
|
5
|
-
children: React.ReactNode;
|
|
6
|
-
useWrapperDiv?: true;
|
|
7
|
-
selector?: string;
|
|
8
|
-
intersectionOptions?: IntersectionObserverInit;
|
|
9
|
-
} | {
|
|
10
|
-
children: React.ReactElement;
|
|
11
|
-
useWrapperDiv: false;
|
|
12
|
-
selector?: string;
|
|
13
|
-
intersectionOptions?: IntersectionObserverInit;
|
|
14
|
-
};
|
|
15
|
-
export declare function TocVisibleSectionObserver(options: Options): ReturnType<typeof VisibleElementObserver>;
|
|
16
|
-
export {};
|
|
17
|
-
//# sourceMappingURL=useTocVisibleSections.d.ts.map
|