fumadocs-core 15.3.1 → 15.3.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.
@@ -21,6 +21,7 @@ import {
21
21
  import rehypeShikiFromHighlighter from "@shikijs/rehype/core";
22
22
  import {
23
23
  transformerNotationDiff,
24
+ transformerNotationFocus,
24
25
  transformerNotationHighlight,
25
26
  transformerNotationWordHighlight
26
27
  } from "@shikijs/transformers";
@@ -209,6 +210,9 @@ var rehypeCodeDefaultOptions = {
209
210
  }),
210
211
  transformerNotationDiff({
211
212
  matchAlgorithm: "v3"
213
+ }),
214
+ transformerNotationFocus({
215
+ matchAlgorithm: "v3"
212
216
  })
213
217
  ],
214
218
  parseMetaString(meta) {
package/dist/toc.js CHANGED
@@ -46,8 +46,9 @@ function useAnchorObserver(watch, single) {
46
46
  function onScroll() {
47
47
  const element = document.scrollingElement;
48
48
  if (!element) return;
49
- if (element.scrollTop === 0 && single) setActiveAnchor(watch.slice(0, 1));
50
- else if (element.scrollTop + element.clientHeight >= element.scrollHeight - 6) {
49
+ const top = element.scrollTop;
50
+ if (top <= 0 && single) setActiveAnchor(watch.slice(0, 1));
51
+ else if (top + element.clientHeight >= element.scrollHeight - 6) {
51
52
  setActiveAnchor((active) => {
52
53
  return active.length > 0 && !single ? watch.slice(watch.indexOf(active[0])) : watch.slice(-1);
53
54
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fumadocs-core",
3
- "version": "15.3.1",
3
+ "version": "15.3.2",
4
4
  "description": "The library for building a documentation website in Next.js",
5
5
  "keywords": [
6
6
  "NextJs",