@altano/use-toc-visible-sections 4.0.0 → 4.0.1

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 CHANGED
@@ -7,7 +7,6 @@ type Options = ChildOptions & {
7
7
  intersectionOptions?: IntersectionObserverInit;
8
8
  };
9
9
  declare function TocVisibleSectionObserver(options: Options): ReturnType<typeof VisibleElementObserver>;
10
-
11
10
  //#endregion
12
11
  export { TocVisibleSectionObserver, useVisibilityOfTarget };
13
12
  //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["href: string","options: Options"],"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,sBAAsBA,MAAuB;CAC3D,MAAM,kBAAkB,oBAAoB;AAC5C,QAAO,CAAC,GAAG,eAAgB,EAAC,KAAK,CAAC,MAAM,EAAE,eAAe,WAAW,KAAK,EAAE,CAAC;AAC7E;AAOD,SAAgB,0BACdC,SAC2C;AAC3C,wBAAO,IAAC;EAAuB,UAAS;EAAkB,GAAI;GAAW;AAC1E"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@altano/use-toc-visible-sections",
3
- "version": "4.0.0",
3
+ "version": "4.0.1",
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": {
@@ -20,10 +20,11 @@
20
20
  "types": "./dist/index.d.ts",
21
21
  "files": [
22
22
  "dist/**/*.js",
23
+ "dist/**/*.js.map",
23
24
  "dist/**/*.d.ts"
24
25
  ],
25
26
  "dependencies": {
26
- "@altano/use-visible-elements": "4.0.0"
27
+ "@altano/use-visible-elements": "4.0.1"
27
28
  },
28
29
  "devDependencies": {
29
30
  "@arethetypeswrong/cli": "^0.17.4",
@@ -36,7 +37,7 @@
36
37
  "prettier": "^3.5.3",
37
38
  "react": "^19.1.0",
38
39
  "react-dom": "^19.1.0",
39
- "tsdown": "^0.12.3",
40
+ "tsdown": "^0.12.9",
40
41
  "typescript": "^5.8.2",
41
42
  "vite": "^6.2.6",
42
43
  "vitest": "^3.1.4",