@lobehub/ui 5.10.3 → 5.10.4

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 (54) hide show
  1. package/es/Highlighter/style.mjs +1 -1
  2. package/es/HtmlPreview/HtmlPreview.d.mts +8 -0
  3. package/es/HtmlPreview/HtmlPreview.mjs +329 -0
  4. package/es/HtmlPreview/HtmlPreview.mjs.map +1 -0
  5. package/es/HtmlPreview/Iframe.d.mts +8 -0
  6. package/es/HtmlPreview/Iframe.mjs +159 -0
  7. package/es/HtmlPreview/Iframe.mjs.map +1 -0
  8. package/es/HtmlPreview/buildShellSrcDoc.mjs +235 -0
  9. package/es/HtmlPreview/buildShellSrcDoc.mjs.map +1 -0
  10. package/es/HtmlPreview/buildStaticSrcDoc.mjs +44 -0
  11. package/es/HtmlPreview/buildStaticSrcDoc.mjs.map +1 -0
  12. package/es/HtmlPreview/const.d.mts +42 -0
  13. package/es/HtmlPreview/const.mjs +63 -0
  14. package/es/HtmlPreview/const.mjs.map +1 -0
  15. package/es/HtmlPreview/index.d.mts +6 -0
  16. package/es/HtmlPreview/index.d.ts +1 -0
  17. package/es/HtmlPreview/index.js +1 -0
  18. package/es/HtmlPreview/index.mjs +5 -0
  19. package/es/HtmlPreview/injectAutoHeightScript.d.mts +5 -0
  20. package/es/HtmlPreview/injectAutoHeightScript.mjs +37 -0
  21. package/es/HtmlPreview/injectAutoHeightScript.mjs.map +1 -0
  22. package/es/HtmlPreview/injectStorageShim.mjs +62 -0
  23. package/es/HtmlPreview/injectStorageShim.mjs.map +1 -0
  24. package/es/HtmlPreview/type.d.mts +114 -0
  25. package/es/Markdown/Markdown.mjs +7 -3
  26. package/es/Markdown/Markdown.mjs.map +1 -1
  27. package/es/Markdown/SyntaxMarkdown/StreamdownRender.mjs +2 -17
  28. package/es/Markdown/SyntaxMarkdown/StreamdownRender.mjs.map +1 -1
  29. package/es/Markdown/SyntaxMarkdown/fenceState.mjs +40 -0
  30. package/es/Markdown/SyntaxMarkdown/fenceState.mjs.map +1 -0
  31. package/es/Markdown/SyntaxMarkdown/useSmoothStreamContent.mjs +13 -0
  32. package/es/Markdown/SyntaxMarkdown/useSmoothStreamContent.mjs.map +1 -1
  33. package/es/Markdown/components/CodeBlock.mjs +10 -2
  34. package/es/Markdown/components/CodeBlock.mjs.map +1 -1
  35. package/es/Markdown/type.d.mts +3 -0
  36. package/es/NeuralNetworkLoading/NeuralNetworkLoading.d.mts +8 -0
  37. package/es/NeuralNetworkLoading/NeuralNetworkLoading.mjs +142 -0
  38. package/es/NeuralNetworkLoading/NeuralNetworkLoading.mjs.map +1 -0
  39. package/es/NeuralNetworkLoading/index.d.mts +3 -0
  40. package/es/NeuralNetworkLoading/index.d.ts +1 -0
  41. package/es/NeuralNetworkLoading/index.js +1 -0
  42. package/es/NeuralNetworkLoading/index.mjs +2 -0
  43. package/es/NeuralNetworkLoading/type.d.mts +12 -0
  44. package/es/hooks/useMarkdown/useMarkdownComponents.mjs +9 -2
  45. package/es/hooks/useMarkdown/useMarkdownComponents.mjs.map +1 -1
  46. package/es/hooks/useStableValue.mjs +30 -0
  47. package/es/hooks/useStableValue.mjs.map +1 -0
  48. package/es/index.d.mts +8 -1
  49. package/es/index.mjs +7 -2
  50. package/es/mdx/mdxComponents/Pre.mjs +14 -1
  51. package/es/mdx/mdxComponents/Pre.mjs.map +1 -1
  52. package/es/utils/isDeepEqual.mjs +21 -0
  53. package/es/utils/isDeepEqual.mjs.map +1 -0
  54. package/package.json +1 -1
@@ -0,0 +1,142 @@
1
+ "use client";
2
+ import { memo } from "react";
3
+ import { jsx, jsxs } from "react/jsx-runtime";
4
+ import { createStaticStyles, keyframes } from "antd-style";
5
+ //#region src/NeuralNetworkLoading/NeuralNetworkLoading.tsx
6
+ const pulseAnim = keyframes`
7
+ 0%, 100% { opacity: 0.3; }
8
+ 50% { opacity: 1; }
9
+ `;
10
+ const flowAnim = keyframes`
11
+ 0% { transform: translateX(0); opacity: 0.5; }
12
+ 50% { opacity: 1; }
13
+ 100% { transform: translateX(var(--flow-distance)); opacity: 0.5; }
14
+ `;
15
+ const rotateAnim = keyframes`
16
+ 100% { transform: rotate(360deg); }
17
+ `;
18
+ const scaleAnim = keyframes`
19
+ 0%, 100% { transform: scale(0.8); opacity: 0.5; }
20
+ 50% { transform: scale(1); opacity: 1; }
21
+ `;
22
+ const styles = createStaticStyles(({ css, cssVar }) => ({
23
+ center: css`
24
+ fill: ${cssVar.colorTextSecondary};
25
+ animation: ${scaleAnim} 2s infinite;
26
+ `,
27
+ connection: css`
28
+ opacity: 0.3;
29
+ stroke: ${cssVar.colorTextSecondary};
30
+ stroke-width: 0.5;
31
+ `,
32
+ container: css`
33
+ display: flex;
34
+ align-items: center;
35
+ justify-content: center;
36
+ `,
37
+ node: css`
38
+ fill: ${cssVar.colorTextSecondary};
39
+ animation: ${pulseAnim} 2s infinite;
40
+ `,
41
+ particle: css`
42
+ fill: ${cssVar.colorTextSecondary};
43
+ animation: ${flowAnim} 2s infinite;
44
+ `,
45
+ ring: css`
46
+ transform-origin: center;
47
+
48
+ fill: none;
49
+ stroke: ${cssVar.colorFill};
50
+ stroke-dasharray: 0 8;
51
+ stroke-width: 1;
52
+
53
+ animation: ${rotateAnim} 20s infinite linear;
54
+ `,
55
+ svg: css`
56
+ width: 100%;
57
+ height: 100%;
58
+ `
59
+ }));
60
+ const LAYER_COUNT = 3;
61
+ const NODE_COUNT = 3;
62
+ const NeuralNetworkLoading = memo(({ size = 16, className, style }) => {
63
+ const nodes = [];
64
+ for (let layerIndex = 0; layerIndex < LAYER_COUNT; layerIndex++) for (let nodeIndex = 0; nodeIndex < NODE_COUNT; nodeIndex++) {
65
+ const x = 25 + layerIndex * 25;
66
+ const y = 25 + nodeIndex * 25;
67
+ const delay = (layerIndex * NODE_COUNT + nodeIndex) * .2;
68
+ nodes.push(/* @__PURE__ */ jsx("circle", {
69
+ className: styles.node,
70
+ cx: x,
71
+ cy: y,
72
+ r: "3",
73
+ style: { animationDelay: `${delay}s` }
74
+ }, `node-${layerIndex}-${nodeIndex}`));
75
+ }
76
+ const connections = [];
77
+ for (let layerIndex = 0; layerIndex < LAYER_COUNT - 1; layerIndex++) for (let nodeIndex = 0; nodeIndex < NODE_COUNT; nodeIndex++) {
78
+ const x1 = 25 + layerIndex * 25;
79
+ const y1 = 25 + nodeIndex * 25;
80
+ for (let targetIndex = 0; targetIndex < NODE_COUNT; targetIndex++) {
81
+ const x2 = 25 + (layerIndex + 1) * 25;
82
+ const y2 = 25 + targetIndex * 25;
83
+ connections.push(/* @__PURE__ */ jsx("line", {
84
+ className: styles.connection,
85
+ x1,
86
+ x2,
87
+ y1,
88
+ y2
89
+ }, `connection-${layerIndex}-${nodeIndex}-${targetIndex}`));
90
+ }
91
+ }
92
+ const particles = [
93
+ 0,
94
+ 1,
95
+ 2
96
+ ].map((index) => /* @__PURE__ */ jsx("circle", {
97
+ className: styles.particle,
98
+ cx: 25,
99
+ cy: 50,
100
+ r: "1.5",
101
+ style: {
102
+ "--flow-distance": "50px",
103
+ "animationDelay": `${index * .6}s`
104
+ }
105
+ }, `particle-${index}`));
106
+ return /* @__PURE__ */ jsx("div", {
107
+ className: [styles.container, className].filter(Boolean).join(" "),
108
+ style: {
109
+ height: size,
110
+ width: size,
111
+ ...style
112
+ },
113
+ children: /* @__PURE__ */ jsxs("svg", {
114
+ className: styles.svg,
115
+ viewBox: "0 0 100 100",
116
+ xmlns: "http://www.w3.org/2000/svg",
117
+ children: [
118
+ connections,
119
+ nodes,
120
+ particles,
121
+ /* @__PURE__ */ jsx("rect", {
122
+ className: styles.center,
123
+ height: "6",
124
+ width: "6",
125
+ x: "47",
126
+ y: "47"
127
+ }),
128
+ /* @__PURE__ */ jsx("circle", {
129
+ className: styles.ring,
130
+ cx: "50",
131
+ cy: "50",
132
+ r: "40"
133
+ })
134
+ ]
135
+ })
136
+ });
137
+ });
138
+ NeuralNetworkLoading.displayName = "NeuralNetworkLoading";
139
+ //#endregion
140
+ export { NeuralNetworkLoading as default };
141
+
142
+ //# sourceMappingURL=NeuralNetworkLoading.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NeuralNetworkLoading.mjs","names":[],"sources":["../../src/NeuralNetworkLoading/NeuralNetworkLoading.tsx"],"sourcesContent":["'use client';\n\nimport { createStaticStyles, keyframes } from 'antd-style';\nimport { type CSSProperties, memo } from 'react';\n\nimport type { NeuralNetworkLoadingProps } from './type';\n\nconst pulseAnim = keyframes`\n 0%, 100% { opacity: 0.3; }\n 50% { opacity: 1; }\n`;\n\nconst flowAnim = keyframes`\n 0% { transform: translateX(0); opacity: 0.5; }\n 50% { opacity: 1; }\n 100% { transform: translateX(var(--flow-distance)); opacity: 0.5; }\n`;\n\nconst rotateAnim = keyframes`\n 100% { transform: rotate(360deg); }\n`;\n\nconst scaleAnim = keyframes`\n 0%, 100% { transform: scale(0.8); opacity: 0.5; }\n 50% { transform: scale(1); opacity: 1; }\n`;\n\nconst styles = createStaticStyles(({ css, cssVar }) => ({\n center: css`\n fill: ${cssVar.colorTextSecondary};\n animation: ${scaleAnim} 2s infinite;\n `,\n connection: css`\n opacity: 0.3;\n stroke: ${cssVar.colorTextSecondary};\n stroke-width: 0.5;\n `,\n container: css`\n display: flex;\n align-items: center;\n justify-content: center;\n `,\n node: css`\n fill: ${cssVar.colorTextSecondary};\n animation: ${pulseAnim} 2s infinite;\n `,\n particle: css`\n fill: ${cssVar.colorTextSecondary};\n animation: ${flowAnim} 2s infinite;\n `,\n ring: css`\n transform-origin: center;\n\n fill: none;\n stroke: ${cssVar.colorFill};\n stroke-dasharray: 0 8;\n stroke-width: 1;\n\n animation: ${rotateAnim} 20s infinite linear;\n `,\n svg: css`\n width: 100%;\n height: 100%;\n `,\n}));\n\nconst LAYER_COUNT = 3;\nconst NODE_COUNT = 3;\n\nconst NeuralNetworkLoading = memo<NeuralNetworkLoadingProps>(({ size = 16, className, style }) => {\n const nodes = [];\n for (let layerIndex = 0; layerIndex < LAYER_COUNT; layerIndex++) {\n for (let nodeIndex = 0; nodeIndex < NODE_COUNT; nodeIndex++) {\n const x = 25 + layerIndex * 25;\n const y = 25 + nodeIndex * 25;\n const delay = (layerIndex * NODE_COUNT + nodeIndex) * 0.2;\n nodes.push(\n <circle\n className={styles.node}\n cx={x}\n cy={y}\n key={`node-${layerIndex}-${nodeIndex}`}\n r=\"3\"\n style={{ animationDelay: `${delay}s` }}\n />,\n );\n }\n }\n\n const connections = [];\n for (let layerIndex = 0; layerIndex < LAYER_COUNT - 1; layerIndex++) {\n for (let nodeIndex = 0; nodeIndex < NODE_COUNT; nodeIndex++) {\n const x1 = 25 + layerIndex * 25;\n const y1 = 25 + nodeIndex * 25;\n for (let targetIndex = 0; targetIndex < NODE_COUNT; targetIndex++) {\n const x2 = 25 + (layerIndex + 1) * 25;\n const y2 = 25 + targetIndex * 25;\n connections.push(\n <line\n className={styles.connection}\n key={`connection-${layerIndex}-${nodeIndex}-${targetIndex}`}\n x1={x1}\n x2={x2}\n y1={y1}\n y2={y2}\n />,\n );\n }\n }\n }\n\n const particles = [0, 1, 2].map((index) => (\n <circle\n className={styles.particle}\n cx={25}\n cy={50}\n key={`particle-${index}`}\n r=\"1.5\"\n style={\n {\n '--flow-distance': '50px',\n 'animationDelay': `${index * 0.6}s`,\n } as CSSProperties\n }\n />\n ));\n\n return (\n <div\n className={[styles.container, className].filter(Boolean).join(' ')}\n style={{ height: size, width: size, ...style }}\n >\n <svg className={styles.svg} viewBox=\"0 0 100 100\" xmlns=\"http://www.w3.org/2000/svg\">\n {connections}\n {nodes}\n {particles}\n <rect className={styles.center} height=\"6\" width=\"6\" x=\"47\" y=\"47\" />\n <circle className={styles.ring} cx=\"50\" cy=\"50\" r=\"40\" />\n </svg>\n </div>\n );\n});\n\nNeuralNetworkLoading.displayName = 'NeuralNetworkLoading';\n\nexport default NeuralNetworkLoading;\n"],"mappings":";;;;;AAOA,MAAM,YAAY,SAAS;;;;AAK3B,MAAM,WAAW,SAAS;;;;;AAM1B,MAAM,aAAa,SAAS;;;AAI5B,MAAM,YAAY,SAAS;;;;AAK3B,MAAM,SAAS,oBAAoB,EAAE,KAAK,cAAc;CACtD,QAAQ,GAAG;YACD,OAAO,mBAAmB;iBACrB,UAAU;;CAEzB,YAAY,GAAG;;cAEH,OAAO,mBAAmB;;;CAGtC,WAAW,GAAG;;;;;CAKd,MAAM,GAAG;YACC,OAAO,mBAAmB;iBACrB,UAAU;;CAEzB,UAAU,GAAG;YACH,OAAO,mBAAmB;iBACrB,SAAS;;CAExB,MAAM,GAAG;;;;cAIG,OAAO,UAAU;;;;iBAId,WAAW;;CAE1B,KAAK,GAAG;;;;CAIT,EAAE;AAEH,MAAM,cAAc;AACpB,MAAM,aAAa;AAEnB,MAAM,uBAAuB,MAAiC,EAAE,OAAO,IAAI,WAAW,YAAY;CAChG,MAAM,QAAQ,EAAE;AAChB,MAAK,IAAI,aAAa,GAAG,aAAa,aAAa,aACjD,MAAK,IAAI,YAAY,GAAG,YAAY,YAAY,aAAa;EAC3D,MAAM,IAAI,KAAK,aAAa;EAC5B,MAAM,IAAI,KAAK,YAAY;EAC3B,MAAM,SAAS,aAAa,aAAa,aAAa;AACtD,QAAM,KACJ,oBAAC,UAAD;GACE,WAAW,OAAO;GAClB,IAAI;GACJ,IAAI;GAEJ,GAAE;GACF,OAAO,EAAE,gBAAgB,GAAG,MAAM,IAAI;GACtC,EAHK,QAAQ,WAAW,GAAG,YAG3B,CACH;;CAIL,MAAM,cAAc,EAAE;AACtB,MAAK,IAAI,aAAa,GAAG,aAAa,cAAc,GAAG,aACrD,MAAK,IAAI,YAAY,GAAG,YAAY,YAAY,aAAa;EAC3D,MAAM,KAAK,KAAK,aAAa;EAC7B,MAAM,KAAK,KAAK,YAAY;AAC5B,OAAK,IAAI,cAAc,GAAG,cAAc,YAAY,eAAe;GACjE,MAAM,KAAK,MAAM,aAAa,KAAK;GACnC,MAAM,KAAK,KAAK,cAAc;AAC9B,eAAY,KACV,oBAAC,QAAD;IACE,WAAW,OAAO;IAEd;IACA;IACA;IACA;IACJ,EALK,cAAc,WAAW,GAAG,UAAU,GAAG,cAK9C,CACH;;;CAKP,MAAM,YAAY;EAAC;EAAG;EAAG;EAAE,CAAC,KAAK,UAC/B,oBAAC,UAAD;EACE,WAAW,OAAO;EAClB,IAAI;EACJ,IAAI;EAEJ,GAAE;EACF,OACE;GACE,mBAAmB;GACnB,kBAAkB,GAAG,QAAQ,GAAI;GAClC;EAEH,EARK,YAAY,QAQjB,CACF;AAEF,QACE,oBAAC,OAAD;EACE,WAAW,CAAC,OAAO,WAAW,UAAU,CAAC,OAAO,QAAQ,CAAC,KAAK,IAAI;EAClE,OAAO;GAAE,QAAQ;GAAM,OAAO;GAAM,GAAG;GAAO;YAE9C,qBAAC,OAAD;GAAK,WAAW,OAAO;GAAK,SAAQ;GAAc,OAAM;aAAxD;IACG;IACA;IACA;IACD,oBAAC,QAAD;KAAM,WAAW,OAAO;KAAQ,QAAO;KAAI,OAAM;KAAI,GAAE;KAAK,GAAE;KAAO,CAAA;IACrE,oBAAC,UAAD;KAAQ,WAAW,OAAO;KAAM,IAAG;KAAK,IAAG;KAAK,GAAE;KAAO,CAAA;IACrD;;EACF,CAAA;EAER;AAEF,qBAAqB,cAAc"}
@@ -0,0 +1,3 @@
1
+ import { NeuralNetworkLoadingProps } from "./type.mjs";
2
+ import { NeuralNetworkLoading } from "./NeuralNetworkLoading.mjs";
3
+ export { NeuralNetworkLoadingProps, NeuralNetworkLoading as default };
@@ -0,0 +1 @@
1
+ export * from './index.d.mts';
@@ -0,0 +1 @@
1
+ export * from './index.mjs';
@@ -0,0 +1,2 @@
1
+ import NeuralNetworkLoading from "./NeuralNetworkLoading.mjs";
2
+ export { NeuralNetworkLoading as default };
@@ -0,0 +1,12 @@
1
+ import { CSSProperties } from "react";
2
+
3
+ //#region src/NeuralNetworkLoading/type.d.ts
4
+ interface NeuralNetworkLoadingProps {
5
+ className?: string;
6
+ /** Size in pixels (width and height). */
7
+ size?: number;
8
+ style?: CSSProperties;
9
+ }
10
+ //#endregion
11
+ export { NeuralNetworkLoadingProps };
12
+ //# sourceMappingURL=type.d.mts.map
@@ -10,7 +10,7 @@ import { useCallback, useMemo } from "react";
10
10
  import { jsx } from "react/jsx-runtime";
11
11
  //#region src/hooks/useMarkdown/useMarkdownComponents.tsx
12
12
  const useMarkdownComponents = () => {
13
- const { components, animated, citations, componentProps, enableMermaid, fullFeaturedCodeBlock, showFootnotes } = useMarkdownContext();
13
+ const { components, animated, citations, componentProps, enableHtmlPreview, enableMermaid, fullFeaturedCodeBlock, showFootnotes } = useMarkdownContext();
14
14
  const memoA = useCallback(({ node, ...props }) => /* @__PURE__ */ jsx(Link, {
15
15
  citations,
16
16
  ...props,
@@ -50,14 +50,20 @@ const useMarkdownComponents = () => {
50
50
  ...componentProps.highlight,
51
51
  theme: highlightTheme
52
52
  } : void 0,
53
+ html: componentProps.html,
53
54
  mermaid: componentProps.mermaid ? {
54
55
  ...componentProps.mermaid,
55
56
  theme: mermaidTheme
56
57
  } : void 0
57
58
  };
58
- }, [highlightTheme, mermaidTheme]);
59
+ }, [
60
+ highlightTheme,
61
+ mermaidTheme,
62
+ componentProps?.html
63
+ ]);
59
64
  const memoPre = useCallback(({ node, ...props }) => /* @__PURE__ */ jsx(CodeBlock, {
60
65
  animated,
66
+ enableHtmlPreview,
61
67
  enableMermaid,
62
68
  fullFeatured: fullFeaturedCodeBlock,
63
69
  ...stableComponentProps,
@@ -65,6 +71,7 @@ const useMarkdownComponents = () => {
65
71
  ...props
66
72
  }), [
67
73
  animated,
74
+ enableHtmlPreview,
68
75
  enableMermaid,
69
76
  fullFeaturedCodeBlock,
70
77
  stableComponentProps,
@@ -1 +1 @@
1
- {"version":3,"file":"useMarkdownComponents.mjs","names":[],"sources":["../../../src/hooks/useMarkdown/useMarkdownComponents.tsx"],"sourcesContent":["'use client';\n\nimport { useCallback, useMemo } from 'react';\nimport type { Components } from 'react-markdown';\n\nimport Hotkey from '@/Hotkey';\nimport { CodeBlock } from '@/Markdown/components/CodeBlock';\nimport { useMarkdownContext } from '@/Markdown/components/MarkdownProvider';\nimport Image from '@/mdx/mdxComponents/Image';\nimport Link from '@/mdx/mdxComponents/Link';\nimport Section from '@/mdx/mdxComponents/Section';\nimport Video from '@/mdx/mdxComponents/Video';\n\nexport const useMarkdownComponents = (): Components => {\n const {\n components,\n animated,\n citations,\n componentProps,\n enableMermaid,\n fullFeaturedCodeBlock,\n showFootnotes,\n } = useMarkdownContext();\n\n const memoA = useCallback(\n ({ node, ...props }: any) => <Link citations={citations} {...props} {...componentProps?.a} />,\n [citations, componentProps?.a],\n );\n\n const memoImg = useCallback(\n ({ node, ...props }: any) => <Image {...props} {...componentProps?.img} />,\n [componentProps?.img],\n );\n\n const memoVideo = useCallback(\n ({ node, ...props }: any) => <Video {...props} {...componentProps?.video} />,\n [componentProps?.video],\n );\n\n const memoSection = useCallback(\n ({ node, ...props }: any) => <Section showFootnotes={showFootnotes} {...props} />,\n [showFootnotes],\n );\n\n const memoKbd = useCallback(\n ({ children }: any) => <Hotkey keys={children} style={{ display: 'inline-flex' }} />,\n [],\n );\n\n const memoBr = useCallback(() => <br />, []);\n\n const memeP = useCallback(({ style, children, className }: any) => {\n const skipWrapperTags = ['img', 'video'];\n if (typeof children === 'object' && skipWrapperTags.includes(children?.props?.node?.tagName)) {\n return children;\n }\n return (\n <p className={className} style={style}>\n {children}\n </p>\n );\n }, []);\n\n // Stable references for theme objects to prevent unnecessary re-renders\n const highlightTheme = useMemo(\n () => componentProps?.highlight?.theme,\n [JSON.stringify(componentProps?.highlight?.theme)],\n );\n\n const mermaidTheme = useMemo(\n () => componentProps?.mermaid?.theme,\n [JSON.stringify(componentProps?.mermaid?.theme)],\n );\n\n // Create stable component props reference\n const stableComponentProps = useMemo(() => {\n if (!componentProps) return;\n\n return {\n highlight: componentProps.highlight\n ? { ...componentProps.highlight, theme: highlightTheme }\n : undefined,\n mermaid: componentProps.mermaid\n ? { ...componentProps.mermaid, theme: mermaidTheme }\n : undefined,\n };\n }, [highlightTheme, mermaidTheme]);\n\n const memoPre = useCallback(\n ({ node, ...props }: any) => (\n <CodeBlock\n animated={animated}\n enableMermaid={enableMermaid}\n fullFeatured={fullFeaturedCodeBlock}\n {...stableComponentProps}\n {...componentProps?.pre}\n {...props}\n />\n ),\n [animated, enableMermaid, fullFeaturedCodeBlock, stableComponentProps, componentProps?.pre],\n );\n\n const memoColorPreview = useCallback(({ node, ...props }: any) => <code {...props} />, []);\n\n const memoComponents = useMemo(\n () => ({\n a: memoA,\n br: memoBr,\n colorPreview: memoColorPreview,\n img: memoImg,\n kbd: memoKbd,\n p: memeP,\n pre: memoPre,\n section: memoSection,\n video: memoVideo,\n }),\n [memoA, memoBr, memoImg, memoVideo, memoPre, memoSection, memeP, memoColorPreview, memoKbd],\n );\n\n return useMemo(\n () => ({\n ...memoComponents,\n ...components,\n }),\n [memoComponents, components],\n );\n};\n"],"mappings":";;;;;;;;;;;AAaA,MAAa,8BAA0C;CACrD,MAAM,EACJ,YACA,UACA,WACA,gBACA,eACA,uBACA,kBACE,oBAAoB;CAExB,MAAM,QAAQ,aACX,EAAE,MAAM,GAAG,YAAiB,oBAAC,MAAD;EAAiB;EAAW,GAAI;EAAO,GAAI,gBAAgB;EAAK,CAAA,EAC7F,CAAC,WAAW,gBAAgB,EAAE,CAC/B;CAED,MAAM,UAAU,aACb,EAAE,MAAM,GAAG,YAAiB,oBAAC,OAAD;EAAO,GAAI;EAAO,GAAI,gBAAgB;EAAO,CAAA,EAC1E,CAAC,gBAAgB,IAAI,CACtB;CAED,MAAM,YAAY,aACf,EAAE,MAAM,GAAG,YAAiB,oBAAC,OAAD;EAAO,GAAI;EAAO,GAAI,gBAAgB;EAAS,CAAA,EAC5E,CAAC,gBAAgB,MAAM,CACxB;CAED,MAAM,cAAc,aACjB,EAAE,MAAM,GAAG,YAAiB,oBAAC,SAAD;EAAwB;EAAe,GAAI;EAAS,CAAA,EACjF,CAAC,cAAc,CAChB;CAED,MAAM,UAAU,aACb,EAAE,eAAoB,oBAAC,QAAD;EAAQ,MAAM;EAAU,OAAO,EAAE,SAAS,eAAe;EAAI,CAAA,EACpF,EAAE,CACH;CAED,MAAM,SAAS,kBAAkB,oBAAC,MAAD,EAAM,CAAA,EAAE,EAAE,CAAC;CAE5C,MAAM,QAAQ,aAAa,EAAE,OAAO,UAAU,gBAAqB;AAEjE,MAAI,OAAO,aAAa,YAAY,CADX,OAAO,QACmB,CAAC,SAAS,UAAU,OAAO,MAAM,QAAQ,CAC1F,QAAO;AAET,SACE,oBAAC,KAAD;GAAc;GAAkB;GAC7B;GACC,CAAA;IAEL,EAAE,CAAC;CAGN,MAAM,iBAAiB,cACf,gBAAgB,WAAW,OACjC,CAAC,KAAK,UAAU,gBAAgB,WAAW,MAAM,CAAC,CACnD;CAED,MAAM,eAAe,cACb,gBAAgB,SAAS,OAC/B,CAAC,KAAK,UAAU,gBAAgB,SAAS,MAAM,CAAC,CACjD;CAGD,MAAM,uBAAuB,cAAc;AACzC,MAAI,CAAC,eAAgB;AAErB,SAAO;GACL,WAAW,eAAe,YACtB;IAAE,GAAG,eAAe;IAAW,OAAO;IAAgB,GACtD,KAAA;GACJ,SAAS,eAAe,UACpB;IAAE,GAAG,eAAe;IAAS,OAAO;IAAc,GAClD,KAAA;GACL;IACA,CAAC,gBAAgB,aAAa,CAAC;CAElC,MAAM,UAAU,aACb,EAAE,MAAM,GAAG,YACV,oBAAC,WAAD;EACY;EACK;EACf,cAAc;EACd,GAAI;EACJ,GAAI,gBAAgB;EACpB,GAAI;EACJ,CAAA,EAEJ;EAAC;EAAU;EAAe;EAAuB;EAAsB,gBAAgB;EAAI,CAC5F;CAED,MAAM,mBAAmB,aAAa,EAAE,MAAM,GAAG,YAAiB,oBAAC,QAAD,EAAM,GAAI,OAAS,CAAA,EAAE,EAAE,CAAC;CAE1F,MAAM,iBAAiB,eACd;EACL,GAAG;EACH,IAAI;EACJ,cAAc;EACd,KAAK;EACL,KAAK;EACL,GAAG;EACH,KAAK;EACL,SAAS;EACT,OAAO;EACR,GACD;EAAC;EAAO;EAAQ;EAAS;EAAW;EAAS;EAAa;EAAO;EAAkB;EAAQ,CAC5F;AAED,QAAO,eACE;EACL,GAAG;EACH,GAAG;EACJ,GACD,CAAC,gBAAgB,WAAW,CAC7B"}
1
+ {"version":3,"file":"useMarkdownComponents.mjs","names":[],"sources":["../../../src/hooks/useMarkdown/useMarkdownComponents.tsx"],"sourcesContent":["'use client';\n\nimport { useCallback, useMemo } from 'react';\nimport type { Components } from 'react-markdown';\n\nimport Hotkey from '@/Hotkey';\nimport { CodeBlock } from '@/Markdown/components/CodeBlock';\nimport { useMarkdownContext } from '@/Markdown/components/MarkdownProvider';\nimport Image from '@/mdx/mdxComponents/Image';\nimport Link from '@/mdx/mdxComponents/Link';\nimport Section from '@/mdx/mdxComponents/Section';\nimport Video from '@/mdx/mdxComponents/Video';\n\nexport const useMarkdownComponents = (): Components => {\n const {\n components,\n animated,\n citations,\n componentProps,\n enableHtmlPreview,\n enableMermaid,\n fullFeaturedCodeBlock,\n showFootnotes,\n } = useMarkdownContext();\n\n const memoA = useCallback(\n ({ node, ...props }: any) => <Link citations={citations} {...props} {...componentProps?.a} />,\n [citations, componentProps?.a],\n );\n\n const memoImg = useCallback(\n ({ node, ...props }: any) => <Image {...props} {...componentProps?.img} />,\n [componentProps?.img],\n );\n\n const memoVideo = useCallback(\n ({ node, ...props }: any) => <Video {...props} {...componentProps?.video} />,\n [componentProps?.video],\n );\n\n const memoSection = useCallback(\n ({ node, ...props }: any) => <Section showFootnotes={showFootnotes} {...props} />,\n [showFootnotes],\n );\n\n const memoKbd = useCallback(\n ({ children }: any) => <Hotkey keys={children} style={{ display: 'inline-flex' }} />,\n [],\n );\n\n const memoBr = useCallback(() => <br />, []);\n\n const memeP = useCallback(({ style, children, className }: any) => {\n const skipWrapperTags = ['img', 'video'];\n if (typeof children === 'object' && skipWrapperTags.includes(children?.props?.node?.tagName)) {\n return children;\n }\n return (\n <p className={className} style={style}>\n {children}\n </p>\n );\n }, []);\n\n // Stable references for theme objects to prevent unnecessary re-renders\n const highlightTheme = useMemo(\n () => componentProps?.highlight?.theme,\n [JSON.stringify(componentProps?.highlight?.theme)],\n );\n\n const mermaidTheme = useMemo(\n () => componentProps?.mermaid?.theme,\n [JSON.stringify(componentProps?.mermaid?.theme)],\n );\n\n // Create stable component props reference\n const stableComponentProps = useMemo(() => {\n if (!componentProps) return;\n\n return {\n highlight: componentProps.highlight\n ? { ...componentProps.highlight, theme: highlightTheme }\n : undefined,\n html: componentProps.html,\n mermaid: componentProps.mermaid\n ? { ...componentProps.mermaid, theme: mermaidTheme }\n : undefined,\n };\n }, [highlightTheme, mermaidTheme, componentProps?.html]);\n\n const memoPre = useCallback(\n ({ node, ...props }: any) => (\n <CodeBlock\n animated={animated}\n enableHtmlPreview={enableHtmlPreview}\n enableMermaid={enableMermaid}\n fullFeatured={fullFeaturedCodeBlock}\n {...stableComponentProps}\n {...componentProps?.pre}\n {...props}\n />\n ),\n [\n animated,\n enableHtmlPreview,\n enableMermaid,\n fullFeaturedCodeBlock,\n stableComponentProps,\n componentProps?.pre,\n ],\n );\n\n const memoColorPreview = useCallback(({ node, ...props }: any) => <code {...props} />, []);\n\n const memoComponents = useMemo(\n () => ({\n a: memoA,\n br: memoBr,\n colorPreview: memoColorPreview,\n img: memoImg,\n kbd: memoKbd,\n p: memeP,\n pre: memoPre,\n section: memoSection,\n video: memoVideo,\n }),\n [memoA, memoBr, memoImg, memoVideo, memoPre, memoSection, memeP, memoColorPreview, memoKbd],\n );\n\n return useMemo(\n () => ({\n ...memoComponents,\n ...components,\n }),\n [memoComponents, components],\n );\n};\n"],"mappings":";;;;;;;;;;;AAaA,MAAa,8BAA0C;CACrD,MAAM,EACJ,YACA,UACA,WACA,gBACA,mBACA,eACA,uBACA,kBACE,oBAAoB;CAExB,MAAM,QAAQ,aACX,EAAE,MAAM,GAAG,YAAiB,oBAAC,MAAD;EAAiB;EAAW,GAAI;EAAO,GAAI,gBAAgB;EAAK,CAAA,EAC7F,CAAC,WAAW,gBAAgB,EAAE,CAC/B;CAED,MAAM,UAAU,aACb,EAAE,MAAM,GAAG,YAAiB,oBAAC,OAAD;EAAO,GAAI;EAAO,GAAI,gBAAgB;EAAO,CAAA,EAC1E,CAAC,gBAAgB,IAAI,CACtB;CAED,MAAM,YAAY,aACf,EAAE,MAAM,GAAG,YAAiB,oBAAC,OAAD;EAAO,GAAI;EAAO,GAAI,gBAAgB;EAAS,CAAA,EAC5E,CAAC,gBAAgB,MAAM,CACxB;CAED,MAAM,cAAc,aACjB,EAAE,MAAM,GAAG,YAAiB,oBAAC,SAAD;EAAwB;EAAe,GAAI;EAAS,CAAA,EACjF,CAAC,cAAc,CAChB;CAED,MAAM,UAAU,aACb,EAAE,eAAoB,oBAAC,QAAD;EAAQ,MAAM;EAAU,OAAO,EAAE,SAAS,eAAe;EAAI,CAAA,EACpF,EAAE,CACH;CAED,MAAM,SAAS,kBAAkB,oBAAC,MAAD,EAAM,CAAA,EAAE,EAAE,CAAC;CAE5C,MAAM,QAAQ,aAAa,EAAE,OAAO,UAAU,gBAAqB;AAEjE,MAAI,OAAO,aAAa,YAAY,CADX,OAAO,QACmB,CAAC,SAAS,UAAU,OAAO,MAAM,QAAQ,CAC1F,QAAO;AAET,SACE,oBAAC,KAAD;GAAc;GAAkB;GAC7B;GACC,CAAA;IAEL,EAAE,CAAC;CAGN,MAAM,iBAAiB,cACf,gBAAgB,WAAW,OACjC,CAAC,KAAK,UAAU,gBAAgB,WAAW,MAAM,CAAC,CACnD;CAED,MAAM,eAAe,cACb,gBAAgB,SAAS,OAC/B,CAAC,KAAK,UAAU,gBAAgB,SAAS,MAAM,CAAC,CACjD;CAGD,MAAM,uBAAuB,cAAc;AACzC,MAAI,CAAC,eAAgB;AAErB,SAAO;GACL,WAAW,eAAe,YACtB;IAAE,GAAG,eAAe;IAAW,OAAO;IAAgB,GACtD,KAAA;GACJ,MAAM,eAAe;GACrB,SAAS,eAAe,UACpB;IAAE,GAAG,eAAe;IAAS,OAAO;IAAc,GAClD,KAAA;GACL;IACA;EAAC;EAAgB;EAAc,gBAAgB;EAAK,CAAC;CAExD,MAAM,UAAU,aACb,EAAE,MAAM,GAAG,YACV,oBAAC,WAAD;EACY;EACS;EACJ;EACf,cAAc;EACd,GAAI;EACJ,GAAI,gBAAgB;EACpB,GAAI;EACJ,CAAA,EAEJ;EACE;EACA;EACA;EACA;EACA;EACA,gBAAgB;EACjB,CACF;CAED,MAAM,mBAAmB,aAAa,EAAE,MAAM,GAAG,YAAiB,oBAAC,QAAD,EAAM,GAAI,OAAS,CAAA,EAAE,EAAE,CAAC;CAE1F,MAAM,iBAAiB,eACd;EACL,GAAG;EACH,IAAI;EACJ,cAAc;EACd,KAAK;EACL,KAAK;EACL,GAAG;EACH,KAAK;EACL,SAAS;EACT,OAAO;EACR,GACD;EAAC;EAAO;EAAQ;EAAS;EAAW;EAAS;EAAa;EAAO;EAAkB;EAAQ,CAC5F;AAED,QAAO,eACE;EACL,GAAG;EACH,GAAG;EACJ,GACD,CAAC,gBAAgB,WAAW,CAC7B"}
@@ -0,0 +1,30 @@
1
+ import { isDeepEqual } from "../utils/isDeepEqual.mjs";
2
+ import { useRef } from "react";
3
+ //#region src/hooks/useStableValue.ts
4
+ /**
5
+ * Return the previous reference when the incoming value is structurally
6
+ * identical to it, so callers don't have to wrap every prop-shaped object
7
+ * in `useMemo` to keep downstream React reference checks happy.
8
+ *
9
+ * Motivation: when a structural prop like `componentProps={{ html: {
10
+ * theme: 'dark' } }}` is passed inline, React's normal ref equality
11
+ * forces every consumer downstream to re-run effects, recompute memos,
12
+ * and — most importantly — remount any children whose deps include
13
+ * sub-properties of that object (`components` for react-markdown is the
14
+ * classic case). For Markdown rendering a streaming HTML preview that
15
+ * blew the iframe up 50× per second.
16
+ *
17
+ * Comparison is structural for plain objects and arrays. Functions and
18
+ * class instances are compared by reference — callers passing inline
19
+ * callbacks still need `useCallback` to keep those stable. Don't use this
20
+ * for state values you intend to compare with `===`.
21
+ */
22
+ const useStableValue = (value) => {
23
+ const prevRef = useRef(value);
24
+ if (!isDeepEqual(prevRef.current, value)) prevRef.current = value;
25
+ return prevRef.current;
26
+ };
27
+ //#endregion
28
+ export { useStableValue };
29
+
30
+ //# sourceMappingURL=useStableValue.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useStableValue.mjs","names":[],"sources":["../../src/hooks/useStableValue.ts"],"sourcesContent":["import { useRef } from 'react';\n\nimport { isDeepEqual } from '@/utils/isDeepEqual';\n\n/**\n * Return the previous reference when the incoming value is structurally\n * identical to it, so callers don't have to wrap every prop-shaped object\n * in `useMemo` to keep downstream React reference checks happy.\n *\n * Motivation: when a structural prop like `componentProps={{ html: {\n * theme: 'dark' } }}` is passed inline, React's normal ref equality\n * forces every consumer downstream to re-run effects, recompute memos,\n * and — most importantly — remount any children whose deps include\n * sub-properties of that object (`components` for react-markdown is the\n * classic case). For Markdown rendering a streaming HTML preview that\n * blew the iframe up 50× per second.\n *\n * Comparison is structural for plain objects and arrays. Functions and\n * class instances are compared by reference — callers passing inline\n * callbacks still need `useCallback` to keep those stable. Don't use this\n * for state values you intend to compare with `===`.\n */\nexport const useStableValue = <T>(value: T): T => {\n const prevRef = useRef<T>(value);\n if (!isDeepEqual(prevRef.current, value)) {\n prevRef.current = value;\n }\n return prevRef.current;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAsBA,MAAa,kBAAqB,UAAgB;CAChD,MAAM,UAAU,OAAU,MAAM;AAChC,KAAI,CAAC,YAAY,QAAQ,SAAS,MAAM,CACtC,SAAQ,UAAU;AAEpB,QAAO,QAAQ"}
package/es/index.d.mts CHANGED
@@ -136,6 +136,11 @@ import { Highlighter } from "./Highlighter/Highlighter.mjs";
136
136
  import { SyntaxHighlighter } from "./Highlighter/SyntaxHighlighter/index.mjs";
137
137
  import { HotkeyInputProps } from "./HotkeyInput/type.mjs";
138
138
  import { HotkeyInput } from "./HotkeyInput/HotkeyInput.mjs";
139
+ import { DEFAULT_HEIGHT, DEFAULT_SANDBOX, containsScript, isFullHtmlDocument, isHtmlContentClosed } from "./HtmlPreview/const.mjs";
140
+ import { HtmlPreviewIframeProps, HtmlPreviewMode, HtmlPreviewProps, HtmlPreviewStreamingMode } from "./HtmlPreview/type.mjs";
141
+ import { HtmlPreview } from "./HtmlPreview/HtmlPreview.mjs";
142
+ import { HtmlPreviewIframe } from "./HtmlPreview/Iframe.mjs";
143
+ import { AUTO_HEIGHT_MESSAGE_TYPE } from "./HtmlPreview/injectAutoHeightScript.mjs";
139
144
  import { ImageProps, PreviewGroupProps } from "./Image/type.mjs";
140
145
  import { PreviewGroup } from "./Image/PreviewGroup.mjs";
141
146
  import Image from "./Image/index.mjs";
@@ -178,6 +183,8 @@ import { MaskShadow } from "./MaskShadow/MaskShadow.mjs";
178
183
  import { MaterialFileTypeIconProps } from "./MaterialFileTypeIcon/type.mjs";
179
184
  import { MaterialFileTypeIcon } from "./MaterialFileTypeIcon/MaterialFileTypeIcon.mjs";
180
185
  import { styles } from "./Menu/sharedStyle.mjs";
186
+ import { NeuralNetworkLoadingProps } from "./NeuralNetworkLoading/type.mjs";
187
+ import { NeuralNetworkLoading } from "./NeuralNetworkLoading/NeuralNetworkLoading.mjs";
181
188
  import { I18nProvider, I18nProviderProps } from "./i18n/context.mjs";
182
189
  import { useTranslation } from "./i18n/useTranslation.mjs";
183
190
  import { ScrollAreaContent, ScrollAreaContentProps, ScrollAreaCorner, ScrollAreaCornerProps, ScrollAreaRoot, ScrollAreaRootProps, ScrollAreaScrollbar, ScrollAreaScrollbarProps, ScrollAreaThumb, ScrollAreaThumbProps, ScrollAreaViewport, ScrollAreaViewportProps } from "./base-ui/ScrollArea/atoms.mjs";
@@ -234,4 +241,4 @@ import { LayoutSidebarInner } from "./Layout/components/LayoutSidebarInner.mjs";
234
241
  import { LayoutToc } from "./Layout/components/LayoutToc.mjs";
235
242
  import Layout from "./Layout/index.mjs";
236
243
  import { ErrorBoundary, ErrorBoundaryProps } from "react-error-boundary";
237
- export { A, AProps, Accordion, AccordionItem, type AccordionItemProps, type AccordionProps, ActionIcon, ActionIconGroup, type ActionIconGroupEvent, type MenuItemType as ActionIconGroupItemType, type ActionIconGroupProps, type ActionIconProps, type ActionIconSize, Alert, type AlertProps, AutoComplete, type AutoCompleteProps, Avatar, AvatarGroup, type AvatarGroupProps, type AvatarProps, type BaseMenuItemType, Block, type BlockProps, Burger, type BurgerProps, Button, type ButtonProps, type CDN, CLASSNAMES, Center, type CenterProps, Checkbox, CheckboxGroup, type CheckboxGroupOption, type CheckboxGroupProps, type CheckboxProps, CodeDiff, type CodeDiffProps, CodeEditor, type CodeEditorProps, Collapse, type CollapseItemType, type CollapseProps, ColorPalettes, ColorPalettesAlpha, ColorSwatches, type ColorSwatchesProps, ColorToken, type Config, ConfigProvider, type ContextMenuCheckboxItem, ContextMenuHost, type ContextMenuItem, ContextMenuTrigger, CopyButton, type CopyButtonProps, DatePicker, type DatePickerProps, type DiffViewMode, DivProps, DownloadButton, type DownloadButtonProps, DraggablePanel, DraggablePanelBody, type DraggablePanelBodyProps, DraggablePanelContainer, type DraggablePanelContainerProps, DraggablePanelFooter, type DraggablePanelFooterProps, DraggablePanelHeader, type DraggablePanelHeaderProps, type DraggablePanelProps, DraggableSideNav, type DraggableSideNavProps, Drawer, type DrawerProps, Dropdown, type DropdownItem, DropdownMenu, type DropdownMenuCheckboxItem, DropdownMenuCheckboxItemIndicator, DropdownMenuCheckboxItemPrimitive, DropdownMenuGroup, DropdownMenuGroupLabel, type DropdownMenuGroupLabelProps, DropdownMenuItem, DropdownMenuItemContent, type DropdownMenuItemContentProps, DropdownMenuItemExtra, type DropdownMenuItemExtraProps, DropdownMenuItemIcon, type DropdownMenuItemIconProps, DropdownMenuItemLabel, type DropdownMenuItemLabelProps, type DropdownMenuItemProps, type MenuItemType as DropdownMenuItemType, type DropdownMenuPlacement, DropdownMenuPopup, type DropdownMenuPopupProps, DropdownMenuPortal, type DropdownMenuPortalProps, DropdownMenuPositioner, type DropdownMenuPositionerProps, type DropdownMenuProps, DropdownMenuRoot, DropdownMenuSeparator, type DropdownMenuSeparatorProps, DropdownMenuSubmenuArrow, type DropdownMenuSubmenuArrowProps, DropdownMenuSubmenuRoot, DropdownMenuSubmenuTrigger, type DropdownMenuSubmenuTriggerProps, DropdownMenuTrigger, type DropdownMenuTriggerProps, type DropdownProps, EditableText, type EditableTextProps, EditorSlashMenu, type EditorSlashMenuGroup, type EditorSlashMenuItems, type EditorSlashMenuOption, EmojiPicker, type EmojiPickerProps, Empty, type EmptyProps, ErrorBoundary, type ErrorBoundaryProps, FileTypeIcon, type FileTypeIconProps, _default as FlexBasic, type FlexBasicProps, _default as Flexbox, type FlexboxProps, FluentEmoji, type FluentEmojiProps, FontLoader, type FontLoaderProps, Footer, type FooterProps, Form, FormGroup, type FormGroupItemType, type FormGroupProps, type FormInstance, FormItem, type FormItemProps, FormModal, type FormModalProps, type FormProps, FormSubmitFooter, type FormSubmitFooterProps, FormTitle, type FormTitleProps, Freeze, type FreezeProps, type GenericItemType, Grid, type GridProps, GroupAvatar, type GroupAvatarProps, GuideCard, type GuideCardProps, Header, type HeaderProps, Highlighter, type HighlighterProps, Hotkey, HotkeyInput, type HotkeyInputProps, type HotkeyProps, I18nProvider, type I18nProviderProps, Icon, type IconProps, IconProvider, type IconSize, Image, type ImageProps, ImageSelect, type ImageSelectItem, type ImageSelectProps, ImgProps, type ImperativeModalProps, Input, InputNumber, type InputNumberProps, InputOPT, type InputOPTProps, InputPassword, type InputPasswordProps, type InputProps, type ItemType, KeyMapEnum, LOBE_THEME_APP_ID, Layout, LayoutFooter, type LayoutFooterProps, LayoutHeader, type LayoutHeaderProps, LayoutMain, type LayoutMainProps, type LayoutProps, LayoutSidebar, LayoutSidebarInner, type LayoutSidebarInnerProps, type LayoutSidebarProps, LayoutToc, type LayoutTocProps, List, ListItem, type ListItemProps, type ListProps, LobeCustomStylish, LobeCustomToken, I18nProvider as LobeUIProvider, Markdown, type MarkdownProps, MaskShadow, type MaskShadowProps, MaterialFileTypeIcon, type MaterialFileTypeIconProps, Menu, type MenuCheckboxItemType, type MenuInfo, type MenuItemType, type MenuProps, Mermaid, type MermaidProps, Meta, type MetaProps, Modal, ModalHost, type ModalHostProps, type ModalInstance, type ModalProps, ModalProvider, MotionComponent, type MotionComponentType, MotionProvider, NeutralColors, NeutralColorsObj, PatchDiff, type PatchDiffProps, type Placement, type PlacementConfig, Popover, PopoverArrow, type PopoverArrowAtomProps, PopoverArrowIcon, PopoverBackdrop, type PopoverContextValue, PopoverGroup, type PopoverPlacement, PopoverPopup, type PopoverPopupAtomProps, PopoverPortal, type PopoverPortalAtomProps, PopoverPositioner, type PopoverPositionerAtomProps, type PopoverProps, PopoverProvider, PopoverRoot, type PopoverTrigger, PopoverTriggerElement, type PopoverTriggerElementProps, PopoverViewport, type PopoverViewportAtomProps, PresetColorKey, PresetColorType, PresetSystemColorKey, PresetSystemColorType, PreviewGroup, type PreviewGroupProps, PrimaryColors, PrimaryColorsObj, type RawModalComponent, type RawModalComponentProps, type RawModalInstance, type RawModalKeyOptions, type RawModalOptions, ScrollArea, ScrollAreaContent, ScrollAreaContentProps, ScrollAreaCorner, ScrollAreaCornerProps, ScrollAreaProps, ScrollAreaRoot, ScrollAreaRootProps, ScrollAreaScrollbar, ScrollAreaScrollbarProps, ScrollAreaThumb, ScrollAreaThumbProps, ScrollAreaViewport, ScrollAreaViewportProps, ScrollShadow, type ScrollShadowProps, SearchBar, type SearchBarProps, SearchResultCards, type SearchResultCardsProps, Segmented, type SegmentedProps, Select, type SelectProps, _default$1 as ShikiLobeTheme, SideNav, type SideNavProps, Skeleton, SkeletonAvatar, type SkeletonAvatarProps, SkeletonBlock, type SkeletonBlockProps, SkeletonButton, type SkeletonButtonProps, SkeletonParagraph, type SkeletonParagraphProps, type SkeletonProps, SkeletonTags, type SkeletonTagsProps, SkeletonTitle, type SkeletonTitleProps, SliderWithInput, type SliderWithInputProps, Snippet, type SnippetProps, SortableList, type SortableListProps, SpanProps, SvgProps, SyntaxHighlighter, type SyntaxHighlighterProps, SyntaxMermaid, type SyntaxMermaidProps, SystemColorToken, Tabs, type TabsProps, Tag, type TagProps, Text, TextArea, type TextAreaProps, type TextProps, ThemeProvider, type ThemeProviderProps, ThemeSwitch, type ThemeSwitchProps, type ToastAPI, ToastHost, type ToastHostProps, type ToastInstance, type ToastOptions, type ToastPosition, type ToastPromiseOptions, type ToastProps, type ToastType, Toc, type TocProps, Tooltip, TooltipGroup, type TooltipProps, Trigger, Typography, type TypographyProps, Video, type VideoProps, closeContextMenu, combineKeys, copyToClipboard, createModal, createRawModal, findCustomThemeName, genCdnUrl, generateColorNeutralPalette, generateColorPalette, highlighterThemes, generateCustomStylish as lobeCustomStylish, generateCustomToken as lobeCustomToken, staticStylish as lobeStaticStylish, styles as menuSharedStyles, mermaidThemes, neutralColors, neutralColorsSwatches, placementMap, preprocessMarkdownContent, preventDefault, preventDefaultAndStopPropagation, primaryColors, primaryColorsSwatches, rehypeCustomFootnotes, rehypeKatexDir, rehypeStreamAnimated, remarkBr, remarkColor, remarkCustomFootnotes, remarkGfmPlus, remarkVideo, renderDropdownMenuItems, showContextMenu, stopPropagation, toFloatingUIPlacement, toast, updateContextMenuItems, useAppElement, useCdnFn, useModalContext, useMotionComponent, usePopoverContext, usePopoverPortalContainer, useToast, useTranslation };
244
+ export { A, AProps, Accordion, AccordionItem, type AccordionItemProps, type AccordionProps, ActionIcon, ActionIconGroup, type ActionIconGroupEvent, type MenuItemType as ActionIconGroupItemType, type ActionIconGroupProps, type ActionIconProps, type ActionIconSize, Alert, type AlertProps, AutoComplete, type AutoCompleteProps, Avatar, AvatarGroup, type AvatarGroupProps, type AvatarProps, type BaseMenuItemType, Block, type BlockProps, Burger, type BurgerProps, Button, type ButtonProps, type CDN, CLASSNAMES, Center, type CenterProps, Checkbox, CheckboxGroup, type CheckboxGroupOption, type CheckboxGroupProps, type CheckboxProps, CodeDiff, type CodeDiffProps, CodeEditor, type CodeEditorProps, Collapse, type CollapseItemType, type CollapseProps, ColorPalettes, ColorPalettesAlpha, ColorSwatches, type ColorSwatchesProps, ColorToken, type Config, ConfigProvider, type ContextMenuCheckboxItem, ContextMenuHost, type ContextMenuItem, ContextMenuTrigger, CopyButton, type CopyButtonProps, DatePicker, type DatePickerProps, type DiffViewMode, DivProps, DownloadButton, type DownloadButtonProps, DraggablePanel, DraggablePanelBody, type DraggablePanelBodyProps, DraggablePanelContainer, type DraggablePanelContainerProps, DraggablePanelFooter, type DraggablePanelFooterProps, DraggablePanelHeader, type DraggablePanelHeaderProps, type DraggablePanelProps, DraggableSideNav, type DraggableSideNavProps, Drawer, type DrawerProps, Dropdown, type DropdownItem, DropdownMenu, type DropdownMenuCheckboxItem, DropdownMenuCheckboxItemIndicator, DropdownMenuCheckboxItemPrimitive, DropdownMenuGroup, DropdownMenuGroupLabel, type DropdownMenuGroupLabelProps, DropdownMenuItem, DropdownMenuItemContent, type DropdownMenuItemContentProps, DropdownMenuItemExtra, type DropdownMenuItemExtraProps, DropdownMenuItemIcon, type DropdownMenuItemIconProps, DropdownMenuItemLabel, type DropdownMenuItemLabelProps, type DropdownMenuItemProps, type MenuItemType as DropdownMenuItemType, type DropdownMenuPlacement, DropdownMenuPopup, type DropdownMenuPopupProps, DropdownMenuPortal, type DropdownMenuPortalProps, DropdownMenuPositioner, type DropdownMenuPositionerProps, type DropdownMenuProps, DropdownMenuRoot, DropdownMenuSeparator, type DropdownMenuSeparatorProps, DropdownMenuSubmenuArrow, type DropdownMenuSubmenuArrowProps, DropdownMenuSubmenuRoot, DropdownMenuSubmenuTrigger, type DropdownMenuSubmenuTriggerProps, DropdownMenuTrigger, type DropdownMenuTriggerProps, type DropdownProps, EditableText, type EditableTextProps, EditorSlashMenu, type EditorSlashMenuGroup, type EditorSlashMenuItems, type EditorSlashMenuOption, EmojiPicker, type EmojiPickerProps, Empty, type EmptyProps, ErrorBoundary, type ErrorBoundaryProps, FileTypeIcon, type FileTypeIconProps, _default as FlexBasic, type FlexBasicProps, _default as Flexbox, type FlexboxProps, FluentEmoji, type FluentEmojiProps, FontLoader, type FontLoaderProps, Footer, type FooterProps, Form, FormGroup, type FormGroupItemType, type FormGroupProps, type FormInstance, FormItem, type FormItemProps, FormModal, type FormModalProps, type FormProps, FormSubmitFooter, type FormSubmitFooterProps, FormTitle, type FormTitleProps, Freeze, type FreezeProps, type GenericItemType, Grid, type GridProps, GroupAvatar, type GroupAvatarProps, GuideCard, type GuideCardProps, DEFAULT_HEIGHT as HTML_PREVIEW_DEFAULT_HEIGHT, DEFAULT_SANDBOX as HTML_PREVIEW_DEFAULT_SANDBOX, AUTO_HEIGHT_MESSAGE_TYPE as HTML_PREVIEW_RESIZE_MESSAGE, Header, type HeaderProps, Highlighter, type HighlighterProps, Hotkey, HotkeyInput, type HotkeyInputProps, type HotkeyProps, HtmlPreview, HtmlPreviewIframe, type HtmlPreviewIframeProps, type HtmlPreviewMode, type HtmlPreviewProps, type HtmlPreviewStreamingMode, I18nProvider, type I18nProviderProps, Icon, type IconProps, IconProvider, type IconSize, Image, type ImageProps, ImageSelect, type ImageSelectItem, type ImageSelectProps, ImgProps, type ImperativeModalProps, Input, InputNumber, type InputNumberProps, InputOPT, type InputOPTProps, InputPassword, type InputPasswordProps, type InputProps, type ItemType, KeyMapEnum, LOBE_THEME_APP_ID, Layout, LayoutFooter, type LayoutFooterProps, LayoutHeader, type LayoutHeaderProps, LayoutMain, type LayoutMainProps, type LayoutProps, LayoutSidebar, LayoutSidebarInner, type LayoutSidebarInnerProps, type LayoutSidebarProps, LayoutToc, type LayoutTocProps, List, ListItem, type ListItemProps, type ListProps, LobeCustomStylish, LobeCustomToken, I18nProvider as LobeUIProvider, Markdown, type MarkdownProps, MaskShadow, type MaskShadowProps, MaterialFileTypeIcon, type MaterialFileTypeIconProps, Menu, type MenuCheckboxItemType, type MenuInfo, type MenuItemType, type MenuProps, Mermaid, type MermaidProps, Meta, type MetaProps, Modal, ModalHost, type ModalHostProps, type ModalInstance, type ModalProps, ModalProvider, MotionComponent, type MotionComponentType, MotionProvider, NeuralNetworkLoading, type NeuralNetworkLoadingProps, NeutralColors, NeutralColorsObj, PatchDiff, type PatchDiffProps, type Placement, type PlacementConfig, Popover, PopoverArrow, type PopoverArrowAtomProps, PopoverArrowIcon, PopoverBackdrop, type PopoverContextValue, PopoverGroup, type PopoverPlacement, PopoverPopup, type PopoverPopupAtomProps, PopoverPortal, type PopoverPortalAtomProps, PopoverPositioner, type PopoverPositionerAtomProps, type PopoverProps, PopoverProvider, PopoverRoot, type PopoverTrigger, PopoverTriggerElement, type PopoverTriggerElementProps, PopoverViewport, type PopoverViewportAtomProps, PresetColorKey, PresetColorType, PresetSystemColorKey, PresetSystemColorType, PreviewGroup, type PreviewGroupProps, PrimaryColors, PrimaryColorsObj, type RawModalComponent, type RawModalComponentProps, type RawModalInstance, type RawModalKeyOptions, type RawModalOptions, ScrollArea, ScrollAreaContent, ScrollAreaContentProps, ScrollAreaCorner, ScrollAreaCornerProps, ScrollAreaProps, ScrollAreaRoot, ScrollAreaRootProps, ScrollAreaScrollbar, ScrollAreaScrollbarProps, ScrollAreaThumb, ScrollAreaThumbProps, ScrollAreaViewport, ScrollAreaViewportProps, ScrollShadow, type ScrollShadowProps, SearchBar, type SearchBarProps, SearchResultCards, type SearchResultCardsProps, Segmented, type SegmentedProps, Select, type SelectProps, _default$1 as ShikiLobeTheme, SideNav, type SideNavProps, Skeleton, SkeletonAvatar, type SkeletonAvatarProps, SkeletonBlock, type SkeletonBlockProps, SkeletonButton, type SkeletonButtonProps, SkeletonParagraph, type SkeletonParagraphProps, type SkeletonProps, SkeletonTags, type SkeletonTagsProps, SkeletonTitle, type SkeletonTitleProps, SliderWithInput, type SliderWithInputProps, Snippet, type SnippetProps, SortableList, type SortableListProps, SpanProps, SvgProps, SyntaxHighlighter, type SyntaxHighlighterProps, SyntaxMermaid, type SyntaxMermaidProps, SystemColorToken, Tabs, type TabsProps, Tag, type TagProps, Text, TextArea, type TextAreaProps, type TextProps, ThemeProvider, type ThemeProviderProps, ThemeSwitch, type ThemeSwitchProps, type ToastAPI, ToastHost, type ToastHostProps, type ToastInstance, type ToastOptions, type ToastPosition, type ToastPromiseOptions, type ToastProps, type ToastType, Toc, type TocProps, Tooltip, TooltipGroup, type TooltipProps, Trigger, Typography, type TypographyProps, Video, type VideoProps, closeContextMenu, combineKeys, copyToClipboard, createModal, createRawModal, findCustomThemeName, genCdnUrl, generateColorNeutralPalette, generateColorPalette, highlighterThemes, containsScript as htmlPreviewContainsScript, isFullHtmlDocument, isHtmlContentClosed, generateCustomStylish as lobeCustomStylish, generateCustomToken as lobeCustomToken, staticStylish as lobeStaticStylish, styles as menuSharedStyles, mermaidThemes, neutralColors, neutralColorsSwatches, placementMap, preprocessMarkdownContent, preventDefault, preventDefaultAndStopPropagation, primaryColors, primaryColorsSwatches, rehypeCustomFootnotes, rehypeKatexDir, rehypeStreamAnimated, remarkBr, remarkColor, remarkCustomFootnotes, remarkGfmPlus, remarkVideo, renderDropdownMenuItems, showContextMenu, stopPropagation, toFloatingUIPlacement, toast, updateContextMenuItems, useAppElement, useCdnFn, useModalContext, useMotionComponent, usePopoverContext, usePopoverPortalContainer, useToast, useTranslation };
package/es/index.mjs CHANGED
@@ -106,6 +106,12 @@ import Header from "./Header/Header.mjs";
106
106
  import Highlighter from "./Highlighter/Highlighter.mjs";
107
107
  import { preprocessMarkdownContent } from "./hooks/useMarkdown/utils.mjs";
108
108
  import HotkeyInput from "./HotkeyInput/HotkeyInput.mjs";
109
+ import { DEFAULT_HEIGHT, DEFAULT_SANDBOX, containsScript, isFullHtmlDocument, isHtmlContentClosed } from "./HtmlPreview/const.mjs";
110
+ import NeuralNetworkLoading from "./NeuralNetworkLoading/NeuralNetworkLoading.mjs";
111
+ import Segmented from "./Segmented/Segmented.mjs";
112
+ import { AUTO_HEIGHT_MESSAGE_TYPE } from "./HtmlPreview/injectAutoHeightScript.mjs";
113
+ import HtmlPreviewIframe from "./HtmlPreview/Iframe.mjs";
114
+ import HtmlPreview from "./HtmlPreview/HtmlPreview.mjs";
109
115
  import PreviewGroup from "./Image/PreviewGroup.mjs";
110
116
  import Image from "./Image/index.mjs";
111
117
  import ImageSelect from "./ImageSelect/ImageSelect.mjs";
@@ -139,7 +145,6 @@ import MaskShadow from "./MaskShadow/MaskShadow.mjs";
139
145
  import { ScrollAreaContent, ScrollAreaCorner, ScrollAreaRoot, ScrollAreaScrollbar, ScrollAreaThumb, ScrollAreaViewport } from "./base-ui/ScrollArea/atoms.mjs";
140
146
  import { ScrollArea } from "./base-ui/ScrollArea/ScrollArea.mjs";
141
147
  import SearchBar from "./SearchBar/SearchBar.mjs";
142
- import Segmented from "./Segmented/Segmented.mjs";
143
148
  import Select from "./Select/Select.mjs";
144
149
  import SideNav from "./SideNav/SideNav.mjs";
145
150
  import SkeletonBlock from "./Skeleton/SkeletonBlock.mjs";
@@ -155,4 +160,4 @@ import ThemeSwitch from "./ThemeSwitch/ThemeSwitch.mjs";
155
160
  import { ToastHost, toast, useToast } from "./base-ui/Toast/imperative.mjs";
156
161
  import Toc from "./Toc/Toc.mjs";
157
162
  import { ErrorBoundary } from "react-error-boundary";
158
- export { A, Accordion, AccordionItem, ActionIcon, ActionIconGroup, Alert, AutoComplete, Avatar, AvatarGroup, Block, Burger, Button, CLASSNAMES, Center, Checkbox, CheckboxGroup, CodeDiff, CodeEditor, Collapse, ColorSwatches, ConfigProvider, ContextMenuHost, ContextMenuTrigger, CopyButton, DatePicker, DownloadButton, DraggablePanel, DraggablePanelBody, DraggablePanelContainer, DraggablePanelFooter, DraggablePanelHeader, DraggableSideNav, Drawer, Dropdown, DropdownMenu, DropdownMenuCheckboxItemIndicator, DropdownMenuCheckboxItemPrimitive, DropdownMenuGroup, DropdownMenuGroupLabel, DropdownMenuItem, DropdownMenuItemContent, DropdownMenuItemExtra, DropdownMenuItemIcon, DropdownMenuItemLabel, DropdownMenuPopup, DropdownMenuPortal, DropdownMenuPositioner, DropdownMenuRoot, DropdownMenuSeparator, DropdownMenuSubmenuArrow, DropdownMenuSubmenuRoot, DropdownMenuSubmenuTrigger, DropdownMenuTrigger, EditableText, EditorSlashMenu, EmojiPicker, Empty, ErrorBoundary, FileTypeIcon, FlexBasic_default as FlexBasic, FlexBasic_default as Flexbox, FluentEmoji, FontLoader, Footer, Form, FormGroup, FormItem, FormModal, FormSubmitFooter, FormTitle, Freeze, Grid, GroupAvatar, GuideCard, Header, Highlighter, Hotkey, HotkeyInput, I18nProvider, Icon, IconProvider, Image, ImageSelect, Input, InputNumber, InputOPT, InputPassword, KeyMapEnum, LOBE_THEME_APP_ID, Layout, LayoutFooter, LayoutHeader, LayoutMain, LayoutSidebar, LayoutSidebarInner, LayoutToc, List, ListItem, I18nProvider as LobeUIProvider, Markdown, MaskShadow, MaterialFileTypeIcon, Menu, Mermaid, Meta, Modal, ModalHost, ModalProvider, MotionComponent, MotionProvider, PatchDiff, Popover, PopoverArrow, PopoverArrowIcon, PopoverBackdrop, PopoverGroup, PopoverPopup, PopoverPortal, PopoverPositioner, PopoverProvider, PopoverRoot, PopoverTriggerElement, PopoverViewport, PreviewGroup, ScrollArea, ScrollAreaContent, ScrollAreaCorner, ScrollAreaRoot, ScrollAreaScrollbar, ScrollAreaThumb, ScrollAreaViewport, ScrollShadow, SearchBar, SearchResultCards, Segmented, Select, lobe_theme_default as ShikiLobeTheme, SideNav, Skeleton, SkeletonAvatar, SkeletonBlock, SkeletonButton, SkeletonParagraph, SkeletonTags, SkeletonTitle, SliderWithInput, Snippet, SortableList, SyntaxHighlighter, SyntaxMermaid, Tabs, Tag, Text, TextArea, ThemeProvider, ThemeSwitch, ToastHost, Toc, Tooltip, TooltipGroup, Typography, Video, closeContextMenu, combineKeys, copyToClipboard, createModal, createRawModal, findCustomThemeName, genCdnUrl, generateColorNeutralPalette, generateColorPalette, highlighterThemes, generateCustomStylish as lobeCustomStylish, generateCustomToken as lobeCustomToken, staticStylish as lobeStaticStylish, styles as menuSharedStyles, mermaidThemes, neutralColors, neutralColorsSwatches, placementMap, preprocessMarkdownContent, preventDefault, preventDefaultAndStopPropagation, primaryColors, primaryColorsSwatches, rehypeCustomFootnotes, rehypeKatexDir, rehypeStreamAnimated, remarkBr, remarkColor, remarkCustomFootnotes, remarkGfmPlus, remarkVideo, renderDropdownMenuItems, showContextMenu, stopPropagation, toFloatingUIPlacement, toast, updateContextMenuItems, useAppElement, useCdnFn, useModalContext, useMotionComponent, usePopoverContext, usePopoverPortalContainer, useToast, useTranslation };
163
+ export { A, Accordion, AccordionItem, ActionIcon, ActionIconGroup, Alert, AutoComplete, Avatar, AvatarGroup, Block, Burger, Button, CLASSNAMES, Center, Checkbox, CheckboxGroup, CodeDiff, CodeEditor, Collapse, ColorSwatches, ConfigProvider, ContextMenuHost, ContextMenuTrigger, CopyButton, DatePicker, DownloadButton, DraggablePanel, DraggablePanelBody, DraggablePanelContainer, DraggablePanelFooter, DraggablePanelHeader, DraggableSideNav, Drawer, Dropdown, DropdownMenu, DropdownMenuCheckboxItemIndicator, DropdownMenuCheckboxItemPrimitive, DropdownMenuGroup, DropdownMenuGroupLabel, DropdownMenuItem, DropdownMenuItemContent, DropdownMenuItemExtra, DropdownMenuItemIcon, DropdownMenuItemLabel, DropdownMenuPopup, DropdownMenuPortal, DropdownMenuPositioner, DropdownMenuRoot, DropdownMenuSeparator, DropdownMenuSubmenuArrow, DropdownMenuSubmenuRoot, DropdownMenuSubmenuTrigger, DropdownMenuTrigger, EditableText, EditorSlashMenu, EmojiPicker, Empty, ErrorBoundary, FileTypeIcon, FlexBasic_default as FlexBasic, FlexBasic_default as Flexbox, FluentEmoji, FontLoader, Footer, Form, FormGroup, FormItem, FormModal, FormSubmitFooter, FormTitle, Freeze, Grid, GroupAvatar, GuideCard, DEFAULT_HEIGHT as HTML_PREVIEW_DEFAULT_HEIGHT, DEFAULT_SANDBOX as HTML_PREVIEW_DEFAULT_SANDBOX, AUTO_HEIGHT_MESSAGE_TYPE as HTML_PREVIEW_RESIZE_MESSAGE, Header, Highlighter, Hotkey, HotkeyInput, HtmlPreview, HtmlPreviewIframe, I18nProvider, Icon, IconProvider, Image, ImageSelect, Input, InputNumber, InputOPT, InputPassword, KeyMapEnum, LOBE_THEME_APP_ID, Layout, LayoutFooter, LayoutHeader, LayoutMain, LayoutSidebar, LayoutSidebarInner, LayoutToc, List, ListItem, I18nProvider as LobeUIProvider, Markdown, MaskShadow, MaterialFileTypeIcon, Menu, Mermaid, Meta, Modal, ModalHost, ModalProvider, MotionComponent, MotionProvider, NeuralNetworkLoading, PatchDiff, Popover, PopoverArrow, PopoverArrowIcon, PopoverBackdrop, PopoverGroup, PopoverPopup, PopoverPortal, PopoverPositioner, PopoverProvider, PopoverRoot, PopoverTriggerElement, PopoverViewport, PreviewGroup, ScrollArea, ScrollAreaContent, ScrollAreaCorner, ScrollAreaRoot, ScrollAreaScrollbar, ScrollAreaThumb, ScrollAreaViewport, ScrollShadow, SearchBar, SearchResultCards, Segmented, Select, lobe_theme_default as ShikiLobeTheme, SideNav, Skeleton, SkeletonAvatar, SkeletonBlock, SkeletonButton, SkeletonParagraph, SkeletonTags, SkeletonTitle, SliderWithInput, Snippet, SortableList, SyntaxHighlighter, SyntaxMermaid, Tabs, Tag, Text, TextArea, ThemeProvider, ThemeSwitch, ToastHost, Toc, Tooltip, TooltipGroup, Typography, Video, closeContextMenu, combineKeys, copyToClipboard, createModal, createRawModal, findCustomThemeName, genCdnUrl, generateColorNeutralPalette, generateColorPalette, highlighterThemes, containsScript as htmlPreviewContainsScript, isFullHtmlDocument, isHtmlContentClosed, generateCustomStylish as lobeCustomStylish, generateCustomToken as lobeCustomToken, staticStylish as lobeStaticStylish, styles as menuSharedStyles, mermaidThemes, neutralColors, neutralColorsSwatches, placementMap, preprocessMarkdownContent, preventDefault, preventDefaultAndStopPropagation, primaryColors, primaryColorsSwatches, rehypeCustomFootnotes, rehypeKatexDir, rehypeStreamAnimated, remarkBr, remarkColor, remarkCustomFootnotes, remarkGfmPlus, remarkVideo, renderDropdownMenuItems, showContextMenu, stopPropagation, toFloatingUIPlacement, toast, updateContextMenuItems, useAppElement, useCdnFn, useModalContext, useMotionComponent, usePopoverContext, usePopoverPortalContainer, useToast, useTranslation };
@@ -1,6 +1,7 @@
1
1
  "use client";
2
2
  import { FALLBACK_LANG } from "../../Highlighter/const.mjs";
3
3
  import Highlighter from "../../Highlighter/Highlighter.mjs";
4
+ import HtmlPreview from "../../HtmlPreview/HtmlPreview.mjs";
4
5
  import Mermaid from "../../Mermaid/Mermaid.mjs";
5
6
  import Snippet from "../../Snippet/Snippet.mjs";
6
7
  import { jsx } from "react/jsx-runtime";
@@ -50,8 +51,20 @@ const PreMermaid = ({ animated, fullFeatured, children, className, style, varian
50
51
  children
51
52
  });
52
53
  };
54
+ const PreHtmlPreview = ({ animated, fullFeatured, children, className, style, variant = "filled", theme, ...rest }) => {
55
+ return /* @__PURE__ */ jsx(HtmlPreview, {
56
+ animated,
57
+ className: cx(styles.container, className),
58
+ fullFeatured,
59
+ style,
60
+ theme,
61
+ variant,
62
+ ...rest,
63
+ children
64
+ });
65
+ };
53
66
  Pre.displayName = "MdxPre";
54
67
  //#endregion
55
- export { PreMermaid, PreSingleLine, Pre as default };
68
+ export { PreHtmlPreview, PreMermaid, PreSingleLine, Pre as default };
56
69
 
57
70
  //# sourceMappingURL=Pre.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"Pre.mjs","names":[],"sources":["../../../src/mdx/mdxComponents/Pre.tsx"],"sourcesContent":["'use client';\n\nimport { createStaticStyles, cx } from 'antd-style';\nimport type { FC } from 'react';\n\nimport Highlighter, { type HighlighterProps } from '@/Highlighter';\nimport { FALLBACK_LANG } from '@/Highlighter/const';\nimport Mermaid, { type MermaidProps } from '@/Mermaid';\nimport Snippet, { type SnippetProps } from '@/Snippet';\n\nconst styles = createStaticStyles(({ css }) => ({\n container: css`\n overflow: hidden;\n margin-block: calc(var(--lobe-markdown-margin-multiple) * 0.5em);\n border-radius: calc(var(--lobe-markdown-border-radius) * 1px);\n box-shadow: 0 0 0 1px var(--lobe-markdown-border-color) inset;\n `,\n}));\n\nexport type PreProps = HighlighterProps;\n\nexport const Pre: FC<PreProps> = ({\n fullFeatured,\n fileName,\n allowChangeLanguage,\n language = FALLBACK_LANG,\n children,\n className,\n style,\n variant = 'filled',\n icon,\n theme,\n ...rest\n}) => {\n return (\n <Highlighter\n allowChangeLanguage={allowChangeLanguage}\n className={cx(styles.container, className)}\n fileName={fileName}\n fullFeatured={fullFeatured}\n icon={icon}\n language={language}\n style={style}\n theme={theme}\n variant={variant}\n {...rest}\n >\n {children}\n </Highlighter>\n );\n};\n\nexport const PreSingleLine: FC<SnippetProps> = ({\n language = FALLBACK_LANG,\n children,\n className,\n style,\n variant = 'filled',\n ...rest\n}) => {\n return (\n <Snippet\n className={cx(styles.container, className)}\n data-code-type=\"highlighter\"\n language={language}\n style={style}\n variant={variant}\n {...rest}\n >\n {children}\n </Snippet>\n );\n};\n\nexport const PreMermaid: FC<MermaidProps> = ({\n animated,\n fullFeatured,\n children,\n className,\n style,\n variant = 'filled',\n theme,\n ...rest\n}) => {\n return (\n <Mermaid\n animated={animated}\n className={cx(styles.container, className)}\n fullFeatured={fullFeatured}\n style={style}\n theme={theme}\n variant={variant}\n {...rest}\n >\n {children}\n </Mermaid>\n );\n};\n\nPre.displayName = 'MdxPre';\n\nexport default Pre;\n"],"mappings":";;;;;;;;AAUA,MAAM,SAAS,oBAAoB,EAAE,WAAW,EAC9C,WAAW,GAAG;;;;;KAMf,EAAE;AAIH,MAAa,OAAqB,EAChC,cACA,UACA,qBACA,WAAW,eACX,UACA,WACA,OACA,UAAU,UACV,MACA,OACA,GAAG,WACC;AACJ,QACE,oBAAC,aAAD;EACuB;EACrB,WAAW,GAAG,OAAO,WAAW,UAAU;EAChC;EACI;EACR;EACI;EACH;EACA;EACE;EACT,GAAI;EAEH;EACW,CAAA;;AAIlB,MAAa,iBAAmC,EAC9C,WAAW,eACX,UACA,WACA,OACA,UAAU,UACV,GAAG,WACC;AACJ,QACE,oBAAC,SAAD;EACE,WAAW,GAAG,OAAO,WAAW,UAAU;EAC1C,kBAAe;EACL;EACH;EACE;EACT,GAAI;EAEH;EACO,CAAA;;AAId,MAAa,cAAgC,EAC3C,UACA,cACA,UACA,WACA,OACA,UAAU,UACV,OACA,GAAG,WACC;AACJ,QACE,oBAAC,SAAD;EACY;EACV,WAAW,GAAG,OAAO,WAAW,UAAU;EAC5B;EACP;EACA;EACE;EACT,GAAI;EAEH;EACO,CAAA;;AAId,IAAI,cAAc"}
1
+ {"version":3,"file":"Pre.mjs","names":[],"sources":["../../../src/mdx/mdxComponents/Pre.tsx"],"sourcesContent":["'use client';\n\nimport { createStaticStyles, cx } from 'antd-style';\nimport type { FC } from 'react';\n\nimport Highlighter, { type HighlighterProps } from '@/Highlighter';\nimport { FALLBACK_LANG } from '@/Highlighter/const';\nimport HtmlPreview, { type HtmlPreviewProps } from '@/HtmlPreview';\nimport Mermaid, { type MermaidProps } from '@/Mermaid';\nimport Snippet, { type SnippetProps } from '@/Snippet';\n\nconst styles = createStaticStyles(({ css }) => ({\n container: css`\n overflow: hidden;\n margin-block: calc(var(--lobe-markdown-margin-multiple) * 0.5em);\n border-radius: calc(var(--lobe-markdown-border-radius) * 1px);\n box-shadow: 0 0 0 1px var(--lobe-markdown-border-color) inset;\n `,\n}));\n\nexport type PreProps = HighlighterProps;\n\nexport const Pre: FC<PreProps> = ({\n fullFeatured,\n fileName,\n allowChangeLanguage,\n language = FALLBACK_LANG,\n children,\n className,\n style,\n variant = 'filled',\n icon,\n theme,\n ...rest\n}) => {\n return (\n <Highlighter\n allowChangeLanguage={allowChangeLanguage}\n className={cx(styles.container, className)}\n fileName={fileName}\n fullFeatured={fullFeatured}\n icon={icon}\n language={language}\n style={style}\n theme={theme}\n variant={variant}\n {...rest}\n >\n {children}\n </Highlighter>\n );\n};\n\nexport const PreSingleLine: FC<SnippetProps> = ({\n language = FALLBACK_LANG,\n children,\n className,\n style,\n variant = 'filled',\n ...rest\n}) => {\n return (\n <Snippet\n className={cx(styles.container, className)}\n data-code-type=\"highlighter\"\n language={language}\n style={style}\n variant={variant}\n {...rest}\n >\n {children}\n </Snippet>\n );\n};\n\nexport const PreMermaid: FC<MermaidProps> = ({\n animated,\n fullFeatured,\n children,\n className,\n style,\n variant = 'filled',\n theme,\n ...rest\n}) => {\n return (\n <Mermaid\n animated={animated}\n className={cx(styles.container, className)}\n fullFeatured={fullFeatured}\n style={style}\n theme={theme}\n variant={variant}\n {...rest}\n >\n {children}\n </Mermaid>\n );\n};\n\nexport const PreHtmlPreview: FC<HtmlPreviewProps> = ({\n animated,\n fullFeatured,\n children,\n className,\n style,\n variant = 'filled',\n theme,\n ...rest\n}) => {\n return (\n <HtmlPreview\n animated={animated}\n className={cx(styles.container, className)}\n fullFeatured={fullFeatured}\n style={style}\n theme={theme}\n variant={variant}\n {...rest}\n >\n {children}\n </HtmlPreview>\n );\n};\n\nPre.displayName = 'MdxPre';\n\nexport default Pre;\n"],"mappings":";;;;;;;;;AAWA,MAAM,SAAS,oBAAoB,EAAE,WAAW,EAC9C,WAAW,GAAG;;;;;KAMf,EAAE;AAIH,MAAa,OAAqB,EAChC,cACA,UACA,qBACA,WAAW,eACX,UACA,WACA,OACA,UAAU,UACV,MACA,OACA,GAAG,WACC;AACJ,QACE,oBAAC,aAAD;EACuB;EACrB,WAAW,GAAG,OAAO,WAAW,UAAU;EAChC;EACI;EACR;EACI;EACH;EACA;EACE;EACT,GAAI;EAEH;EACW,CAAA;;AAIlB,MAAa,iBAAmC,EAC9C,WAAW,eACX,UACA,WACA,OACA,UAAU,UACV,GAAG,WACC;AACJ,QACE,oBAAC,SAAD;EACE,WAAW,GAAG,OAAO,WAAW,UAAU;EAC1C,kBAAe;EACL;EACH;EACE;EACT,GAAI;EAEH;EACO,CAAA;;AAId,MAAa,cAAgC,EAC3C,UACA,cACA,UACA,WACA,OACA,UAAU,UACV,OACA,GAAG,WACC;AACJ,QACE,oBAAC,SAAD;EACY;EACV,WAAW,GAAG,OAAO,WAAW,UAAU;EAC5B;EACP;EACA;EACE;EACT,GAAI;EAEH;EACO,CAAA;;AAId,MAAa,kBAAwC,EACnD,UACA,cACA,UACA,WACA,OACA,UAAU,UACV,OACA,GAAG,WACC;AACJ,QACE,oBAAC,aAAD;EACY;EACV,WAAW,GAAG,OAAO,WAAW,UAAU;EAC5B;EACP;EACA;EACE;EACT,GAAI;EAEH;EACW,CAAA;;AAIlB,IAAI,cAAc"}
@@ -0,0 +1,21 @@
1
+ //#region src/utils/isDeepEqual.ts
2
+ const isRecord = (value) => typeof value === "object" && value !== null;
3
+ const isDeepEqual = (a, b) => {
4
+ if (a === b) return true;
5
+ if (Array.isArray(a) || Array.isArray(b)) {
6
+ if (!Array.isArray(a) || !Array.isArray(b)) return false;
7
+ if (a.length !== b.length) return false;
8
+ for (let i = 0; i < a.length; i++) if (!isDeepEqual(a[i], b[i])) return false;
9
+ return true;
10
+ }
11
+ if (!isRecord(a) || !isRecord(b)) return false;
12
+ const keysA = Object.keys(a);
13
+ const keysB = Object.keys(b);
14
+ if (keysA.length !== keysB.length) return false;
15
+ for (const key of keysA) if (!isDeepEqual(a[key], b[key])) return false;
16
+ return true;
17
+ };
18
+ //#endregion
19
+ export { isDeepEqual };
20
+
21
+ //# sourceMappingURL=isDeepEqual.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isDeepEqual.mjs","names":[],"sources":["../../src/utils/isDeepEqual.ts"],"sourcesContent":["// Structural equality for prop/config-shaped values: primitives, plain\n// records, and arrays. Functions and class instances are compared by\n// reference (caller is expected to memoise callbacks via useCallback).\n// Lifted out of StreamdownRender so the same definition powers\n// `useStableValue` at the Markdown boundary — keep them in sync if you\n// extend the rules here.\nconst isRecord = (value: unknown): value is Record<string, unknown> =>\n typeof value === 'object' && value !== null;\n\nexport const isDeepEqual = (a: unknown, b: unknown): boolean => {\n if (a === b) return true;\n\n if (Array.isArray(a) || Array.isArray(b)) {\n if (!Array.isArray(a) || !Array.isArray(b)) return false;\n if (a.length !== b.length) return false;\n for (let i = 0; i < a.length; i++) {\n if (!isDeepEqual(a[i], b[i])) return false;\n }\n return true;\n }\n\n if (!isRecord(a) || !isRecord(b)) return false;\n\n const keysA = Object.keys(a);\n const keysB = Object.keys(b);\n if (keysA.length !== keysB.length) return false;\n\n for (const key of keysA) {\n if (!isDeepEqual(a[key], b[key])) return false;\n }\n\n return true;\n};\n"],"mappings":";AAMA,MAAM,YAAY,UAChB,OAAO,UAAU,YAAY,UAAU;AAEzC,MAAa,eAAe,GAAY,MAAwB;AAC9D,KAAI,MAAM,EAAG,QAAO;AAEpB,KAAI,MAAM,QAAQ,EAAE,IAAI,MAAM,QAAQ,EAAE,EAAE;AACxC,MAAI,CAAC,MAAM,QAAQ,EAAE,IAAI,CAAC,MAAM,QAAQ,EAAE,CAAE,QAAO;AACnD,MAAI,EAAE,WAAW,EAAE,OAAQ,QAAO;AAClC,OAAK,IAAI,IAAI,GAAG,IAAI,EAAE,QAAQ,IAC5B,KAAI,CAAC,YAAY,EAAE,IAAI,EAAE,GAAG,CAAE,QAAO;AAEvC,SAAO;;AAGT,KAAI,CAAC,SAAS,EAAE,IAAI,CAAC,SAAS,EAAE,CAAE,QAAO;CAEzC,MAAM,QAAQ,OAAO,KAAK,EAAE;CAC5B,MAAM,QAAQ,OAAO,KAAK,EAAE;AAC5B,KAAI,MAAM,WAAW,MAAM,OAAQ,QAAO;AAE1C,MAAK,MAAM,OAAO,MAChB,KAAI,CAAC,YAAY,EAAE,MAAM,EAAE,KAAK,CAAE,QAAO;AAG3C,QAAO"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/ui",
3
- "version": "5.10.3",
3
+ "version": "5.10.4",
4
4
  "description": "Lobe UI is an open-source UI component library for building AIGC web apps",
5
5
  "keywords": [
6
6
  "lobehub",