@altano/use-toc-visible-sections 4.0.1 → 4.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.js +1 -2
- package/dist/index.js.map +1 -1
- package/package.json +17 -17
package/dist/index.js
CHANGED
|
@@ -3,8 +3,7 @@ import { jsx } from "react/jsx-runtime";
|
|
|
3
3
|
|
|
4
4
|
//#region src/useTocVisibleSections.tsx
|
|
5
5
|
function useVisibilityOfTarget(href) {
|
|
6
|
-
|
|
7
|
-
return [...visibleElements].some((s) => s.querySelector(`:scope > ${href}`));
|
|
6
|
+
return [...useVisibleElements()].some((s) => s.querySelector(`:scope > ${href}`));
|
|
8
7
|
}
|
|
9
8
|
function TocVisibleSectionObserver(options) {
|
|
10
9
|
return /* @__PURE__ */ jsx(VisibleElementObserver, {
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../src/useTocVisibleSections.tsx"],"sourcesContent":["import {\n VisibleElementObserver,\n useVisibleElements,\n type ChildOptions,\n} from \"@altano/use-visible-elements\";\n\nexport function useVisibilityOfTarget(href: string): boolean {\n const visibleElements = useVisibleElements();\n return [...visibleElements].some((s) => s.querySelector(`:scope > ${href}`));\n}\n\ntype Options = ChildOptions & {\n selector?: string;\n intersectionOptions?: IntersectionObserverInit;\n};\n\nexport function TocVisibleSectionObserver(\n options: Options,\n): ReturnType<typeof VisibleElementObserver> {\n return <VisibleElementObserver selector=\"article section\" {...options} />;\n}\n"],"mappings":";;;;AAMA,SAAgB,sBAAsB,MAAuB;AAE3D,QAAO,CAAC,GADgB,oBAAoB,CACjB,CAAC,MAAM,MAAM,EAAE,cAAc,YAAY,OAAO,CAAC;;AAQ9E,SAAgB,0BACd,SAC2C;AAC3C,QAAO,oBAAC,wBAAD;EAAwB,UAAS;EAAkB,GAAI;EAAW"}
|
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.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
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.2"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@arethetypeswrong/cli": "^0.
|
|
31
|
-
"@playwright/test": "1.
|
|
32
|
-
"@types/node": "^
|
|
33
|
-
"@types/react": "^19.
|
|
34
|
-
"@types/react-dom": "^19.
|
|
30
|
+
"@arethetypeswrong/cli": "^0.18.2",
|
|
31
|
+
"@playwright/test": "1.58.2",
|
|
32
|
+
"@types/node": "^25.5.0",
|
|
33
|
+
"@types/react": "^19.2.10",
|
|
34
|
+
"@types/react-dom": "^19.2.3",
|
|
35
35
|
"depcheck": "^1.4.7",
|
|
36
|
-
"eslint": "^9.
|
|
37
|
-
"prettier": "^3.
|
|
38
|
-
"react": "^19.
|
|
39
|
-
"react-dom": "^19.
|
|
40
|
-
"tsdown": "^0.
|
|
41
|
-
"typescript": "^5.
|
|
42
|
-
"vite": "^
|
|
43
|
-
"vitest": "^
|
|
36
|
+
"eslint": "^9.39.4",
|
|
37
|
+
"prettier": "^3.8.1",
|
|
38
|
+
"react": "^19.2.4",
|
|
39
|
+
"react-dom": "^19.2.4",
|
|
40
|
+
"tsdown": "^0.21.4",
|
|
41
|
+
"typescript": "^5.9.3",
|
|
42
|
+
"vite": "^7.3.1",
|
|
43
|
+
"vitest": "^4.1.0",
|
|
44
44
|
"@altano/build-config": "0.0.1",
|
|
45
45
|
"@altano/tsconfig": "0.0.1"
|
|
46
46
|
},
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"access": "public"
|
|
52
52
|
},
|
|
53
53
|
"scripts": {
|
|
54
|
-
"build": "tsdown --config ../build-config/tsdown.config.browser.ts",
|
|
54
|
+
"build": "tsdown --config-loader unrun --config ../build-config/tsdown.config.browser.ts",
|
|
55
55
|
"check:exports": "attw --pack . --profile esm-only --quiet",
|
|
56
56
|
"check:types:src": "tsc --noEmit",
|
|
57
57
|
"check:types:test": "tsc --noEmit --project ./tests/tsconfig.json",
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"lint": "eslint",
|
|
64
64
|
"lint:fix": "TIMING=1 pnpm lint --fix",
|
|
65
65
|
"lint:timing": "TIMING=1 pnpm lint",
|
|
66
|
-
"test:e2e": "playwright test",
|
|
66
|
+
"test:e2e": "NODE_OPTIONS='--no-experimental-strip-types' playwright test",
|
|
67
67
|
"test:e2e:server": "vite --strictPort --port 4727 ./tests/e2e",
|
|
68
68
|
"test:e2e:ui": "playwright test --ui"
|
|
69
69
|
}
|