@incremark/react 0.3.5 → 0.3.6

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.
Files changed (2) hide show
  1. package/dist/index.js +9 -2
  2. package/package.json +9 -9
package/dist/index.js CHANGED
@@ -2711,8 +2711,14 @@ var AutoScrollContainer = forwardRef2(
2711
2711
  AutoScrollContainer.displayName = "AutoScrollContainer";
2712
2712
 
2713
2713
  // src/ThemeProvider.tsx
2714
- import { useEffect as useEffect10, useRef as useRef10 } from "react";
2714
+ import { useEffect as useEffect10, useRef as useRef10, useMemo as useMemo7 } from "react";
2715
2715
  import { applyTheme } from "@incremark/theme";
2716
+
2717
+ // src/hooks/useThemeContext.tsx
2718
+ import { useContext as useContext3, createContext as createContext3 } from "react";
2719
+ var ThemeContext = createContext3("default");
2720
+
2721
+ // src/ThemeProvider.tsx
2716
2722
  import { jsx as jsx25 } from "react/jsx-runtime";
2717
2723
  var ThemeProvider = ({
2718
2724
  theme,
@@ -2720,12 +2726,13 @@ var ThemeProvider = ({
2720
2726
  className = ""
2721
2727
  }) => {
2722
2728
  const containerRef = useRef10(null);
2729
+ const themeValue = useMemo7(() => theme, [theme]);
2723
2730
  useEffect10(() => {
2724
2731
  if (containerRef.current) {
2725
2732
  applyTheme(containerRef.current, theme);
2726
2733
  }
2727
2734
  }, [theme]);
2728
- return /* @__PURE__ */ jsx25("div", { ref: containerRef, className: `incremark-theme-provider ${className}`.trim(), children });
2735
+ return /* @__PURE__ */ jsx25(ThemeContext.Provider, { value: themeValue, children: /* @__PURE__ */ jsx25("div", { ref: containerRef, className: `incremark-theme-provider ${className}`.trim(), children }) });
2729
2736
  };
2730
2737
 
2731
2738
  // src/index.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@incremark/react",
3
- "version": "0.3.5",
3
+ "version": "0.3.6",
4
4
  "license": "MIT",
5
5
  "description": "High-performance streaming markdown renderer for React ecosystem.",
6
6
  "type": "module",
@@ -21,24 +21,24 @@
21
21
  "mermaid": "^10.0.0 || ^11.0.0",
22
22
  "katex": "^0.16.0",
23
23
  "react": ">=18.0.0",
24
- "@incremark/core": "0.3.5"
24
+ "@incremark/core": "0.3.6"
25
25
  },
26
26
  "dependencies": {
27
27
  "@antfu/utils": "^9.3.0",
28
28
  "shiki": "^3.20.0",
29
29
  "shiki-stream": "^0.1.4",
30
- "@incremark/devtools": "0.3.5",
31
- "@incremark/shared": "0.3.5",
32
- "@incremark/icons": "0.3.5",
33
- "@incremark/theme": "0.3.5"
30
+ "@incremark/shared": "0.3.6",
31
+ "@incremark/theme": "0.3.6",
32
+ "@incremark/icons": "0.3.6",
33
+ "@incremark/devtools": "0.3.6"
34
34
  },
35
35
  "devDependencies": {
36
36
  "@shikijs/core": "^3.21.0",
37
37
  "@types/mdast": "^4.0.0",
38
- "@types/react": "^18.2.0",
39
- "react": "^18.2.0",
38
+ "@types/react": "^19.2.8",
39
+ "react": "^19.2.3",
40
40
  "tsup": "^8.0.0",
41
- "typescript": "^5.3.0"
41
+ "typescript": "^5.9.3"
42
42
  },
43
43
  "keywords": [
44
44
  "markdown",