@incremark/react 0.3.5 → 0.3.7
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 +73 -6
- package/package.json +9 -9
package/dist/index.js
CHANGED
|
@@ -2160,7 +2160,14 @@ function getItemBlockChildren(item) {
|
|
|
2160
2160
|
return true;
|
|
2161
2161
|
});
|
|
2162
2162
|
}
|
|
2163
|
-
var IncremarkList = ({
|
|
2163
|
+
var IncremarkList = ({
|
|
2164
|
+
node,
|
|
2165
|
+
components,
|
|
2166
|
+
customContainers,
|
|
2167
|
+
customCodeBlocks,
|
|
2168
|
+
codeBlockConfigs,
|
|
2169
|
+
blockStatus
|
|
2170
|
+
}) => {
|
|
2164
2171
|
const Tag = node.ordered ? "ol" : "ul";
|
|
2165
2172
|
const isTaskList = node.children?.some((item) => item.checked !== null && item.checked !== void 0);
|
|
2166
2173
|
return /* @__PURE__ */ jsx13(Tag, { className: `incremark-list ${isTaskList ? "task-list" : ""}`, start: node.start || void 0, children: node.children?.map((item, index) => {
|
|
@@ -2183,7 +2190,17 @@ var IncremarkList = ({ node }) => {
|
|
|
2183
2190
|
}
|
|
2184
2191
|
return /* @__PURE__ */ jsxs4("li", { className: "incremark-list-item", children: [
|
|
2185
2192
|
/* @__PURE__ */ jsx13(IncremarkInline, { nodes: inlineContent }),
|
|
2186
|
-
blockChildren.map((child, childIndex) => /* @__PURE__ */ jsx13(React10.Fragment, { children: /* @__PURE__ */ jsx13(
|
|
2193
|
+
blockChildren.map((child, childIndex) => /* @__PURE__ */ jsx13(React10.Fragment, { children: /* @__PURE__ */ jsx13(
|
|
2194
|
+
IncremarkRenderer,
|
|
2195
|
+
{
|
|
2196
|
+
node: child,
|
|
2197
|
+
components,
|
|
2198
|
+
customContainers,
|
|
2199
|
+
customCodeBlocks,
|
|
2200
|
+
codeBlockConfigs,
|
|
2201
|
+
blockStatus
|
|
2202
|
+
}
|
|
2203
|
+
) }, childIndex))
|
|
2187
2204
|
] }, index);
|
|
2188
2205
|
}) });
|
|
2189
2206
|
};
|
|
@@ -2191,8 +2208,25 @@ var IncremarkList = ({ node }) => {
|
|
|
2191
2208
|
// src/components/IncremarkBlockquote.tsx
|
|
2192
2209
|
import React11 from "react";
|
|
2193
2210
|
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
2194
|
-
var IncremarkBlockquote = ({
|
|
2195
|
-
|
|
2211
|
+
var IncremarkBlockquote = ({
|
|
2212
|
+
node,
|
|
2213
|
+
components,
|
|
2214
|
+
customContainers,
|
|
2215
|
+
customCodeBlocks,
|
|
2216
|
+
codeBlockConfigs,
|
|
2217
|
+
blockStatus
|
|
2218
|
+
}) => {
|
|
2219
|
+
return /* @__PURE__ */ jsx14("blockquote", { className: "incremark-blockquote", children: node.children.map((child, index) => /* @__PURE__ */ jsx14(React11.Fragment, { children: /* @__PURE__ */ jsx14(
|
|
2220
|
+
IncremarkRenderer,
|
|
2221
|
+
{
|
|
2222
|
+
node: child,
|
|
2223
|
+
components,
|
|
2224
|
+
customContainers,
|
|
2225
|
+
customCodeBlocks,
|
|
2226
|
+
codeBlockConfigs,
|
|
2227
|
+
blockStatus
|
|
2228
|
+
}
|
|
2229
|
+
) }, index)) });
|
|
2196
2230
|
};
|
|
2197
2231
|
|
|
2198
2232
|
// src/components/IncremarkTable.tsx
|
|
@@ -2320,6 +2354,32 @@ var IncremarkRenderer = ({
|
|
|
2320
2354
|
}
|
|
2321
2355
|
);
|
|
2322
2356
|
}
|
|
2357
|
+
if (node.type === "list") {
|
|
2358
|
+
return /* @__PURE__ */ jsx19(
|
|
2359
|
+
IncremarkList,
|
|
2360
|
+
{
|
|
2361
|
+
node,
|
|
2362
|
+
components,
|
|
2363
|
+
customContainers,
|
|
2364
|
+
customCodeBlocks,
|
|
2365
|
+
codeBlockConfigs,
|
|
2366
|
+
blockStatus
|
|
2367
|
+
}
|
|
2368
|
+
);
|
|
2369
|
+
}
|
|
2370
|
+
if (node.type === "blockquote") {
|
|
2371
|
+
return /* @__PURE__ */ jsx19(
|
|
2372
|
+
IncremarkBlockquote,
|
|
2373
|
+
{
|
|
2374
|
+
node,
|
|
2375
|
+
components,
|
|
2376
|
+
customContainers,
|
|
2377
|
+
customCodeBlocks,
|
|
2378
|
+
codeBlockConfigs,
|
|
2379
|
+
blockStatus
|
|
2380
|
+
}
|
|
2381
|
+
);
|
|
2382
|
+
}
|
|
2323
2383
|
const Component = getComponent(node.type, components);
|
|
2324
2384
|
return /* @__PURE__ */ jsx19(Component, { node });
|
|
2325
2385
|
};
|
|
@@ -2711,8 +2771,14 @@ var AutoScrollContainer = forwardRef2(
|
|
|
2711
2771
|
AutoScrollContainer.displayName = "AutoScrollContainer";
|
|
2712
2772
|
|
|
2713
2773
|
// src/ThemeProvider.tsx
|
|
2714
|
-
import { useEffect as useEffect10, useRef as useRef10 } from "react";
|
|
2774
|
+
import { useEffect as useEffect10, useRef as useRef10, useMemo as useMemo7 } from "react";
|
|
2715
2775
|
import { applyTheme } from "@incremark/theme";
|
|
2776
|
+
|
|
2777
|
+
// src/hooks/useThemeContext.tsx
|
|
2778
|
+
import { useContext as useContext3, createContext as createContext3 } from "react";
|
|
2779
|
+
var ThemeContext = createContext3("default");
|
|
2780
|
+
|
|
2781
|
+
// src/ThemeProvider.tsx
|
|
2716
2782
|
import { jsx as jsx25 } from "react/jsx-runtime";
|
|
2717
2783
|
var ThemeProvider = ({
|
|
2718
2784
|
theme,
|
|
@@ -2720,12 +2786,13 @@ var ThemeProvider = ({
|
|
|
2720
2786
|
className = ""
|
|
2721
2787
|
}) => {
|
|
2722
2788
|
const containerRef = useRef10(null);
|
|
2789
|
+
const themeValue = useMemo7(() => theme, [theme]);
|
|
2723
2790
|
useEffect10(() => {
|
|
2724
2791
|
if (containerRef.current) {
|
|
2725
2792
|
applyTheme(containerRef.current, theme);
|
|
2726
2793
|
}
|
|
2727
2794
|
}, [theme]);
|
|
2728
|
-
return /* @__PURE__ */ jsx25("div", { ref: containerRef, className: `incremark-theme-provider ${className}`.trim(), children });
|
|
2795
|
+
return /* @__PURE__ */ jsx25(ThemeContext.Provider, { value: themeValue, children: /* @__PURE__ */ jsx25("div", { ref: containerRef, className: `incremark-theme-provider ${className}`.trim(), children }) });
|
|
2729
2796
|
};
|
|
2730
2797
|
|
|
2731
2798
|
// src/index.ts
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@incremark/react",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.7",
|
|
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.
|
|
24
|
+
"@incremark/core": "0.3.7"
|
|
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.
|
|
31
|
-
"@incremark/shared": "0.3.
|
|
32
|
-
"@incremark/icons": "0.3.
|
|
33
|
-
"@incremark/theme": "0.3.
|
|
30
|
+
"@incremark/devtools": "0.3.7",
|
|
31
|
+
"@incremark/shared": "0.3.7",
|
|
32
|
+
"@incremark/icons": "0.3.7",
|
|
33
|
+
"@incremark/theme": "0.3.7"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"@shikijs/core": "^3.21.0",
|
|
37
37
|
"@types/mdast": "^4.0.0",
|
|
38
|
-
"@types/react": "^
|
|
39
|
-
"react": "^
|
|
38
|
+
"@types/react": "^19.2.8",
|
|
39
|
+
"react": "^19.2.3",
|
|
40
40
|
"tsup": "^8.0.0",
|
|
41
|
-
"typescript": "^5.3
|
|
41
|
+
"typescript": "^5.9.3"
|
|
42
42
|
},
|
|
43
43
|
"keywords": [
|
|
44
44
|
"markdown",
|