fumadocs-core 14.6.0 → 14.6.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.
@@ -5,7 +5,7 @@ export { S as SortedResult } from '../types-Ch8gnVgO.js';
5
5
  import { Metadata } from 'next';
6
6
  import { NextRequest } from 'next/server';
7
7
  import { LoaderOutput, LoaderConfig, InferPageType } from '../source/index.js';
8
- export { H as HighlightOptions, c as createStyleTransformer, h as highlight } from '../shiki-fdNJu0Yj.js';
8
+ export { H as HighlightOptions, c as createStyleTransformer, h as highlight } from '../shiki-CNmCR8Td.js';
9
9
  import 'react';
10
10
  import '../config-inq6kP6y.js';
11
11
  import 'shiki';
@@ -1,10 +1,11 @@
1
- import { ShikiTransformer, CodeToHastOptionsCommon, BundledLanguage, HighlighterCoreOptions, CodeOptionsThemes, CodeOptionsMeta } from 'shiki';
1
+ import { ShikiTransformer, CodeToHastOptionsCommon, BundledLanguage, CodeOptionsThemes, CodeOptionsMeta, Awaitable, RegexEngine } from 'shiki';
2
2
  import { BundledTheme } from 'shiki/themes';
3
3
  import { Components } from 'hast-util-to-jsx-runtime';
4
4
  import { ReactNode } from 'react';
5
5
 
6
6
  declare function createStyleTransformer(): ShikiTransformer;
7
- type HighlightOptions = CodeToHastOptionsCommon<BundledLanguage> & Pick<HighlighterCoreOptions, 'engine'> & Partial<CodeOptionsThemes<BundledTheme>> & CodeOptionsMeta & {
7
+ type HighlightOptions = CodeToHastOptionsCommon<BundledLanguage> & (CodeOptionsThemes<BundledTheme> | Record<never, never>) & CodeOptionsMeta & {
8
+ engine?: Awaitable<RegexEngine>;
8
9
  components?: Partial<Components>;
9
10
  };
10
11
  declare function highlight(code: string, options: HighlightOptions): Promise<ReactNode>;
@@ -1,6 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { ReactNode, DependencyList } from 'react';
3
- import { H as HighlightOptions } from '../shiki-fdNJu0Yj.js';
3
+ import { H as HighlightOptions } from '../shiki-CNmCR8Td.js';
4
4
  import { Root } from 'hast';
5
5
  import 'shiki';
6
6
  import 'shiki/themes';
@@ -10,6 +10,7 @@ import "../chunk-MLKGABMK.js";
10
10
  import {
11
11
  use,
12
12
  useEffect,
13
+ useMemo,
13
14
  useRef,
14
15
  useState
15
16
  } from "react";
@@ -33,7 +34,10 @@ function useShiki(code, {
33
34
  scriptKey,
34
35
  ...options
35
36
  }, deps) {
36
- const key = deps ? JSON.stringify(deps) : `${options.lang}:${code}`;
37
+ const key = useMemo(
38
+ () => deps ? JSON.stringify(deps) : `${options.lang}:${code}`,
39
+ [code, deps, options.lang]
40
+ );
37
41
  const shikiOptions = getHighlightOptions(options);
38
42
  const currentTask = useRef({
39
43
  key,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fumadocs-core",
3
- "version": "14.6.0",
3
+ "version": "14.6.2",
4
4
  "description": "The library for building a documentation website in Next.js",
5
5
  "keywords": [
6
6
  "NextJs",
@@ -81,7 +81,7 @@
81
81
  "hast-util-to-jsx-runtime": "^2.3.2",
82
82
  "image-size": "^1.1.1",
83
83
  "negotiator": "^1.0.0",
84
- "react-remove-scroll": "^2.6.0",
84
+ "react-remove-scroll": "^2.6.2",
85
85
  "remark": "^15.0.0",
86
86
  "remark-gfm": "^4.0.0",
87
87
  "scroll-into-view-if-needed": "^3.1.0",
@@ -96,13 +96,13 @@
96
96
  "@types/hast": "^3.0.4",
97
97
  "@types/mdast": "^4.0.3",
98
98
  "@types/negotiator": "^0.6.3",
99
- "@types/node": "22.10.1",
99
+ "@types/node": "22.10.2",
100
100
  "@types/react": "^19.0.1",
101
101
  "@types/react-dom": "^19.0.2",
102
102
  "algoliasearch": "4.24.0",
103
103
  "mdast-util-mdx-jsx": "^3.1.3",
104
104
  "mdast-util-mdxjs-esm": "^2.0.1",
105
- "next": "^15.0.4",
105
+ "next": "^15.1.1",
106
106
  "remark-mdx": "^3.1.0",
107
107
  "remark-rehype": "^11.1.1",
108
108
  "shiki-transformers": "^1.0.1",