@altano/use-toc-visible-sections 4.0.3 → 4.0.4
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 +3 -5
- package/dist/index.js +1 -2
- package/package.json +12 -12
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import { ChildOptions, VisibleElementObserver } from "@altano/use-visible-elements";
|
|
2
|
-
|
|
3
|
-
declare function useVisibilityOfTarget(href: string): boolean;
|
|
2
|
+
export declare function useVisibilityOfTarget(href: string): boolean;
|
|
4
3
|
type Options = ChildOptions & {
|
|
5
4
|
selector?: string;
|
|
6
5
|
intersectionOptions?: IntersectionObserverInit;
|
|
7
6
|
};
|
|
8
|
-
declare function TocVisibleSectionObserver(options: Options): ReturnType<typeof VisibleElementObserver>;
|
|
9
|
-
|
|
10
|
-
export { TocVisibleSectionObserver, useVisibilityOfTarget };
|
|
7
|
+
export declare function TocVisibleSectionObserver(options: Options): ReturnType<typeof VisibleElementObserver>;
|
|
8
|
+
export {};
|
|
11
9
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { VisibleElementObserver, useVisibleElements } from "@altano/use-visible-elements";
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
// src/useTocVisibleSections.tsx
|
|
5
5
|
function useVisibilityOfTarget(href) {
|
|
6
6
|
return [...useVisibleElements()].some((s) => s.querySelector(`:scope > ${href}`));
|
|
7
7
|
}
|
|
@@ -12,6 +12,5 @@ function TocVisibleSectionObserver(options) {
|
|
|
12
12
|
});
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
//#endregion
|
|
16
15
|
export { TocVisibleSectionObserver, useVisibilityOfTarget };
|
|
17
16
|
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@altano/use-toc-visible-sections",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.4",
|
|
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
6
|
"repository": {
|
|
@@ -24,23 +24,23 @@
|
|
|
24
24
|
"dist/**/*.d.ts"
|
|
25
25
|
],
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@altano/use-visible-elements": "4.0.
|
|
27
|
+
"@altano/use-visible-elements": "4.0.4"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@arethetypeswrong/cli": "^0.18.5",
|
|
31
31
|
"@playwright/test": "1.59.1",
|
|
32
|
-
"@types/node": "^26.
|
|
33
|
-
"@types/react": "^19.
|
|
34
|
-
"@types/react-dom": "^19.
|
|
32
|
+
"@types/node": "^26.6.6",
|
|
33
|
+
"@types/react": "^19.3.0",
|
|
34
|
+
"@types/react-dom": "^19.3.0",
|
|
35
35
|
"depcheck": "^1.4.7",
|
|
36
|
-
"eslint": "^
|
|
37
|
-
"prettier": "3.9.
|
|
38
|
-
"react": "^19.
|
|
39
|
-
"react-dom": "^19.
|
|
40
|
-
"tsdown": "^0.
|
|
36
|
+
"eslint": "^10.14.0",
|
|
37
|
+
"prettier": "3.9.10",
|
|
38
|
+
"react": "^19.3.1",
|
|
39
|
+
"react-dom": "^19.3.1",
|
|
40
|
+
"tsdown": "^0.23.5",
|
|
41
41
|
"typescript": "^6.0.3",
|
|
42
|
-
"vite": "^8.
|
|
43
|
-
"vitest": "^
|
|
42
|
+
"vite": "^8.3.5",
|
|
43
|
+
"vitest": "^5.1.0",
|
|
44
44
|
"@altano/build-config": "0.0.1",
|
|
45
45
|
"@altano/testing": "0.0.1",
|
|
46
46
|
"@altano/tsconfig": "0.0.1"
|