@windrun-huaiin/third-ui 26.0.0 → 27.0.0
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/ai/ai-prompt-textarea.d.ts +72 -0
- package/dist/ai/ai-prompt-textarea.js +114 -0
- package/dist/ai/ai-prompt-textarea.mjs +112 -0
- package/dist/ai/index.d.ts +1 -0
- package/dist/ai/index.js +2 -0
- package/dist/ai/index.mjs +1 -0
- package/dist/clerk/clerk-provider-client.js +0 -1
- package/dist/clerk/clerk-provider-client.mjs +0 -1
- package/dist/clerk/fingerprint/fingerprint-client.js +0 -4
- package/dist/clerk/fingerprint/fingerprint-client.mjs +0 -4
- package/dist/clerk/fingerprint/use-fingerprint.js +0 -6
- package/dist/clerk/fingerprint/use-fingerprint.mjs +0 -6
- package/dist/clerk/signin-with-fingerprint-client.js +0 -9
- package/dist/clerk/signin-with-fingerprint-client.mjs +0 -9
- package/dist/clerk/signup-button-with-fingerprint-client.js +0 -16
- package/dist/clerk/signup-button-with-fingerprint-client.mjs +0 -16
- package/dist/clerk/signup-with-fingerprint-client.js +0 -9
- package/dist/clerk/signup-with-fingerprint-client.mjs +0 -9
- package/dist/fuma/base/custom-header.js +10 -8
- package/dist/fuma/base/custom-header.mjs +10 -8
- package/dist/fuma/base/custom-home-layout.d.ts +1 -0
- package/dist/fuma/base/index.d.ts +1 -0
- package/dist/fuma/base/index.js +4 -0
- package/dist/fuma/base/index.mjs +1 -0
- package/dist/fuma/base/nav-config.d.ts +10 -0
- package/dist/fuma/base/nav-config.js +32 -0
- package/dist/fuma/base/nav-config.mjs +28 -0
- package/dist/fuma/base/site-layout.d.ts +4 -0
- package/dist/fuma/base/site-layout.js +2 -2
- package/dist/fuma/base/site-layout.mjs +2 -2
- package/dist/fuma/fuma-page-genarator.d.ts +1 -1
- package/dist/fuma/fuma-page-genarator.js +60 -5
- package/dist/fuma/fuma-page-genarator.mjs +60 -5
- package/dist/fuma/llm-copy-handler.js +0 -9
- package/dist/fuma/llm-copy-handler.mjs +0 -9
- package/dist/fuma/mdx/index.d.ts +0 -1
- package/dist/fuma/mdx/index.js +0 -2
- package/dist/fuma/mdx/index.mjs +0 -1
- package/dist/fuma/mdx/suno-embed.js +3 -1
- package/dist/fuma/mdx/suno-embed.mjs +3 -1
- package/dist/fuma/mdx/toc-base.js +0 -1
- package/dist/fuma/mdx/toc-base.mjs +0 -1
- package/dist/fuma/server/features/widgets.js +5 -1
- package/dist/fuma/server/features/widgets.mjs +5 -1
- package/dist/lib/site-docs-helper.d.ts +51 -0
- package/dist/lib/site-docs-helper.js +68 -0
- package/dist/lib/site-docs-helper.mjs +66 -0
- package/dist/main/alert-dialog/index.js +14 -0
- package/dist/main/alert-dialog/index.mjs +5 -0
- package/dist/main/buttons/gradient-button.d.ts +20 -0
- package/dist/main/buttons/gradient-button.js +88 -0
- package/dist/main/buttons/gradient-button.mjs +86 -0
- package/dist/main/buttons/index.d.ts +3 -0
- package/dist/main/buttons/index.js +12 -0
- package/dist/main/buttons/index.mjs +4 -0
- package/dist/main/buttons/x-button.d.ts +39 -0
- package/dist/main/buttons/x-button.js +92 -0
- package/dist/main/buttons/x-button.mjs +90 -0
- package/dist/main/buttons/x-toggle-button.d.ts +32 -0
- package/dist/main/buttons/x-toggle-button.js +95 -0
- package/dist/main/buttons/x-toggle-button.mjs +74 -0
- package/dist/main/credit/credit-overview-client.js +3 -2
- package/dist/main/credit/credit-overview-client.mjs +3 -2
- package/dist/main/credit/index.d.ts +4 -0
- package/dist/main/credit/index.js +10 -0
- package/dist/main/credit/index.mjs +3 -0
- package/dist/main/credit/server.d.ts +2 -0
- package/dist/main/credit/server.js +7 -0
- package/dist/main/credit/server.mjs +1 -0
- package/dist/main/cta.js +4 -2
- package/dist/main/cta.mjs +4 -2
- package/dist/main/hero/index.d.ts +2 -0
- package/dist/main/hero/index.js +10 -0
- package/dist/main/hero/index.mjs +3 -0
- package/dist/main/home/server.d.ts +7 -0
- package/dist/main/home/server.js +19 -0
- package/dist/main/home/server.mjs +7 -0
- package/dist/main/index.d.ts +0 -15
- package/dist/main/index.js +0 -43
- package/dist/main/index.mjs +0 -21
- package/dist/main/loading/index.d.ts +1 -0
- package/dist/main/loading/index.js +9 -0
- package/dist/main/loading/index.mjs +2 -0
- package/dist/main/loading-frame/index.d.ts +1 -0
- package/dist/main/loading-frame/index.js +9 -0
- package/dist/main/loading-frame/index.mjs +2 -0
- package/dist/main/money-price/index.d.ts +4 -0
- package/dist/main/money-price/index.js +15 -0
- package/dist/main/money-price/index.mjs +4 -0
- package/dist/main/money-price/money-price-button.d.ts +1 -1
- package/dist/main/money-price/money-price-button.js +10 -7
- package/dist/main/money-price/money-price-button.mjs +10 -7
- package/dist/main/money-price/money-price-interactive.js +9 -8
- package/dist/main/money-price/money-price-interactive.mjs +9 -8
- package/dist/main/money-price/money-price-types.d.ts +1 -0
- package/dist/main/money-price/server.d.ts +5 -0
- package/dist/main/money-price/server.js +18 -0
- package/dist/main/money-price/server.mjs +4 -0
- package/package.json +54 -4
- package/src/ai/index.ts +1 -0
- package/src/clerk/clerk-provider-client.tsx +1 -3
- package/src/clerk/fingerprint/fingerprint-client.ts +0 -4
- package/src/clerk/fingerprint/use-fingerprint.ts +0 -6
- package/src/clerk/signin-with-fingerprint-client.tsx +0 -10
- package/src/clerk/signup-button-with-fingerprint-client.tsx +0 -17
- package/src/clerk/signup-with-fingerprint-client.tsx +0 -10
- package/src/fuma/base/custom-header.tsx +12 -8
- package/src/fuma/base/custom-home-layout.tsx +7 -4
- package/src/fuma/base/index.ts +1 -0
- package/src/fuma/base/nav-config.ts +81 -0
- package/src/fuma/base/site-layout.tsx +6 -0
- package/src/fuma/fuma-banner-suit.tsx +1 -1
- package/src/fuma/fuma-page-genarator.tsx +60 -7
- package/src/fuma/llm-copy-handler.ts +0 -11
- package/src/fuma/mdx/index.ts +0 -1
- package/src/fuma/mdx/suno-embed.tsx +1 -1
- package/src/fuma/mdx/toc-base.tsx +0 -1
- package/src/fuma/mdx/toc-footer-wrapper.tsx +2 -2
- package/src/fuma/server/features/widgets.tsx +1 -1
- package/src/lib/server.ts +1 -1
- package/src/{fuma/mdx → main/buttons}/gradient-button.tsx +10 -21
- package/src/main/buttons/index.ts +5 -0
- package/src/main/{x-button.tsx → buttons/x-button.tsx} +28 -42
- package/src/main/credit/credit-overview-client.tsx +1 -1
- package/src/main/credit/index.ts +11 -0
- package/src/main/credit/server.ts +7 -0
- package/src/main/cta.tsx +1 -1
- package/src/main/hero/index.ts +4 -0
- package/src/main/home/server.ts +7 -0
- package/src/main/index.ts +1 -20
- package/src/main/language-detector.tsx +0 -1
- package/src/main/loading/index.ts +3 -0
- package/src/main/loading-frame/index.ts +3 -0
- package/src/main/money-price/index.ts +18 -0
- package/src/main/money-price/money-price-button.tsx +12 -6
- package/src/main/money-price/money-price-interactive.tsx +17 -10
- package/src/main/money-price/money-price-types.ts +1 -0
- package/src/main/money-price/server.ts +22 -0
- package/dist/fuma/mdx/features.d.ts +0 -8
- package/dist/fuma/mdx/features.js +0 -92
- package/dist/fuma/mdx/features.mjs +0 -85
- package/dist/fuma/mdx/image-grid.d.ts +0 -6
- package/dist/fuma/mdx/image-grid.js +0 -17
- package/dist/fuma/mdx/image-grid.mjs +0 -15
- package/dist/fuma/mdx/image-zoom.d.ts +0 -22
- package/dist/fuma/mdx/image-zoom.js +0 -39
- package/dist/fuma/mdx/image-zoom.mjs +0 -37
- package/dist/fuma/mdx/markdown-component-map.d.ts +0 -3
- package/dist/fuma/mdx/markdown-component-map.js +0 -79
- package/dist/fuma/mdx/markdown-component-map.mjs +0 -77
- package/dist/fuma/mdx/math.d.ts +0 -17
- package/dist/fuma/mdx/math.js +0 -60
- package/dist/fuma/mdx/math.mjs +0 -57
- package/dist/fuma/mdx/mermaid.d.ts +0 -13
- package/dist/fuma/mdx/mermaid.js +0 -360
- package/dist/fuma/mdx/mermaid.mjs +0 -358
- package/dist/fuma/mdx/site-mdx-components.d.ts +0 -13
- package/dist/fuma/mdx/site-mdx-components.js +0 -19
- package/dist/fuma/mdx/site-mdx-components.mjs +0 -17
- package/dist/fuma/mdx/site-mdx-presets.d.ts +0 -13
- package/dist/fuma/mdx/site-mdx-presets.js +0 -49
- package/dist/fuma/mdx/site-mdx-presets.mjs +0 -45
- package/dist/fuma/server/optional-features.d.ts +0 -6
- package/dist/fuma/server/optional-features.js +0 -17
- package/dist/fuma/server/optional-features.mjs +0 -6
- package/dist/fuma/server/site-mdx-components.d.ts +0 -13
- package/dist/fuma/server/site-mdx-components.js +0 -18
- package/dist/fuma/server/site-mdx-components.mjs +0 -16
- package/dist/fuma/server/site-mdx-presets.d.ts +0 -195
- package/dist/fuma/server/site-mdx-presets.js +0 -55
- package/dist/fuma/server/site-mdx-presets.mjs +0 -52
- /package/src/{main → ai}/ai-prompt-textarea.tsx +0 -0
- /package/src/main/{x-toggle-button.tsx → buttons/x-toggle-button.tsx} +0 -0
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var tslib = require('tslib');
|
|
4
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
5
|
-
var utils = require('@windrun-huaiin/lib/utils');
|
|
6
|
-
var defaultMdxComponents = require('fumadocs-ui/mdx');
|
|
7
|
-
var imageZoom = require('../heavy/image-zoom.js');
|
|
8
|
-
require('katex');
|
|
9
|
-
require('@windrun-huaiin/base-ui/icons');
|
|
10
|
-
require('next-themes');
|
|
11
|
-
require('roughjs');
|
|
12
|
-
require('react');
|
|
13
|
-
require('@windrun-huaiin/base-ui/lib');
|
|
14
|
-
|
|
15
|
-
function normalizeMarkdownProps(props) {
|
|
16
|
-
const { class: legacyClassName, className } = props, restProps = tslib.__rest(props, ["class", "className"]);
|
|
17
|
-
return Object.assign(Object.assign({}, restProps), { className: utils.cn(typeof legacyClassName === 'string' ? legacyClassName : undefined, className) });
|
|
18
|
-
}
|
|
19
|
-
const baseMarkdownComponents = Object.assign(Object.assign({}, defaultMdxComponents), { a: (_a) => {
|
|
20
|
-
var _b, _c;
|
|
21
|
-
var { className } = _a, props = tslib.__rest(_a, ["className"]);
|
|
22
|
-
return (jsxRuntime.jsx("a", Object.assign({}, normalizeMarkdownProps(props), { className: utils.cn('underline underline-offset-4 transition hover:opacity-80', normalizeMarkdownProps(props).className, className), target: (_b = props.target) !== null && _b !== void 0 ? _b : '_blank', rel: (_c = props.rel) !== null && _c !== void 0 ? _c : 'noreferrer noopener' })));
|
|
23
|
-
}, blockquote: (_a) => {
|
|
24
|
-
var { className } = _a, props = tslib.__rest(_a, ["className"]);
|
|
25
|
-
return (jsxRuntime.jsx("blockquote", Object.assign({}, normalizeMarkdownProps(props), { className: utils.cn('border-l-2 border-border pl-4 text-muted-foreground', normalizeMarkdownProps(props).className, className) })));
|
|
26
|
-
}, code: (_a) => {
|
|
27
|
-
var { className } = _a, props = tslib.__rest(_a, ["className"]);
|
|
28
|
-
return (jsxRuntime.jsx("code", Object.assign({}, normalizeMarkdownProps(props), { className: utils.cn('rounded-md bg-muted px-1.5 py-0.5 font-mono text-[0.9em]', normalizeMarkdownProps(props).className, className) })));
|
|
29
|
-
}, h1: (_a) => {
|
|
30
|
-
var { className } = _a, props = tslib.__rest(_a, ["className"]);
|
|
31
|
-
return (jsxRuntime.jsx("h1", Object.assign({}, normalizeMarkdownProps(props), { className: utils.cn('text-2xl font-semibold tracking-tight', normalizeMarkdownProps(props).className, className) })));
|
|
32
|
-
}, h2: (_a) => {
|
|
33
|
-
var { className } = _a, props = tslib.__rest(_a, ["className"]);
|
|
34
|
-
return (jsxRuntime.jsx("h2", Object.assign({}, normalizeMarkdownProps(props), { className: utils.cn('text-xl font-semibold tracking-tight', normalizeMarkdownProps(props).className, className) })));
|
|
35
|
-
}, h3: (_a) => {
|
|
36
|
-
var { className } = _a, props = tslib.__rest(_a, ["className"]);
|
|
37
|
-
return (jsxRuntime.jsx("h3", Object.assign({}, normalizeMarkdownProps(props), { className: utils.cn('text-lg font-semibold', normalizeMarkdownProps(props).className, className) })));
|
|
38
|
-
}, h4: (_a) => {
|
|
39
|
-
var { className } = _a, props = tslib.__rest(_a, ["className"]);
|
|
40
|
-
return (jsxRuntime.jsx("h4", Object.assign({}, normalizeMarkdownProps(props), { className: utils.cn('text-base font-semibold', normalizeMarkdownProps(props).className, className) })));
|
|
41
|
-
}, h5: (_a) => {
|
|
42
|
-
var { className } = _a, props = tslib.__rest(_a, ["className"]);
|
|
43
|
-
return (jsxRuntime.jsx("h5", Object.assign({}, normalizeMarkdownProps(props), { className: utils.cn('text-sm font-semibold', normalizeMarkdownProps(props).className, className) })));
|
|
44
|
-
}, h6: (_a) => {
|
|
45
|
-
var { className } = _a, props = tslib.__rest(_a, ["className"]);
|
|
46
|
-
return (jsxRuntime.jsx("h6", Object.assign({}, normalizeMarkdownProps(props), { className: utils.cn('text-sm font-semibold', normalizeMarkdownProps(props).className, className) })));
|
|
47
|
-
}, hr: (_a) => {
|
|
48
|
-
var { className } = _a, props = tslib.__rest(_a, ["className"]);
|
|
49
|
-
return (jsxRuntime.jsx("hr", Object.assign({}, normalizeMarkdownProps(props), { className: utils.cn('border-border', normalizeMarkdownProps(props).className, className) })));
|
|
50
|
-
}, img: (_a) => {
|
|
51
|
-
var { className, alt, src } = _a, props = tslib.__rest(_a, ["className", "alt", "src"]);
|
|
52
|
-
return (jsxRuntime.jsx(imageZoom.ImageZoom, Object.assign({}, normalizeMarkdownProps(props), { alt: typeof alt === 'string' ? alt : '', src: typeof src === 'string' ? src : '', className: utils.cn('overflow-hidden rounded-2xl', normalizeMarkdownProps(props).className, className) })));
|
|
53
|
-
}, li: (_a) => {
|
|
54
|
-
var { className } = _a, props = tslib.__rest(_a, ["className"]);
|
|
55
|
-
return (jsxRuntime.jsx("li", Object.assign({}, normalizeMarkdownProps(props), { className: utils.cn('leading-7', normalizeMarkdownProps(props).className, className) })));
|
|
56
|
-
}, ol: (_a) => {
|
|
57
|
-
var { className } = _a, props = tslib.__rest(_a, ["className"]);
|
|
58
|
-
return (jsxRuntime.jsx("ol", Object.assign({}, normalizeMarkdownProps(props), { className: utils.cn('list-decimal space-y-2 pl-6', normalizeMarkdownProps(props).className, className) })));
|
|
59
|
-
}, p: (_a) => {
|
|
60
|
-
var { className } = _a, props = tslib.__rest(_a, ["className"]);
|
|
61
|
-
return (jsxRuntime.jsx("p", Object.assign({}, normalizeMarkdownProps(props), { className: utils.cn('leading-7', normalizeMarkdownProps(props).className, className) })));
|
|
62
|
-
}, pre: (_a) => {
|
|
63
|
-
var { className } = _a, props = tslib.__rest(_a, ["className"]);
|
|
64
|
-
return (jsxRuntime.jsx("pre", Object.assign({}, normalizeMarkdownProps(props), { className: utils.cn('overflow-x-auto rounded-2xl border border-border bg-muted px-4 py-3 text-sm', normalizeMarkdownProps(props).className, className) })));
|
|
65
|
-
}, table: (_a) => {
|
|
66
|
-
var { className } = _a, props = tslib.__rest(_a, ["className"]);
|
|
67
|
-
return (jsxRuntime.jsx("div", { className: "overflow-x-auto", children: jsxRuntime.jsx("table", Object.assign({}, normalizeMarkdownProps(props), { className: utils.cn('w-full border-collapse text-sm', normalizeMarkdownProps(props).className, className) })) }));
|
|
68
|
-
}, td: (_a) => {
|
|
69
|
-
var { className } = _a, props = tslib.__rest(_a, ["className"]);
|
|
70
|
-
return (jsxRuntime.jsx("td", Object.assign({}, normalizeMarkdownProps(props), { className: utils.cn('border border-border px-3 py-2 align-top', normalizeMarkdownProps(props).className, className) })));
|
|
71
|
-
}, th: (_a) => {
|
|
72
|
-
var { className } = _a, props = tslib.__rest(_a, ["className"]);
|
|
73
|
-
return (jsxRuntime.jsx("th", Object.assign({}, normalizeMarkdownProps(props), { className: utils.cn('border border-border px-3 py-2 text-left font-medium', normalizeMarkdownProps(props).className, className) })));
|
|
74
|
-
}, ul: (_a) => {
|
|
75
|
-
var { className } = _a, props = tslib.__rest(_a, ["className"]);
|
|
76
|
-
return (jsxRuntime.jsx("ul", Object.assign({}, normalizeMarkdownProps(props), { className: utils.cn('list-disc space-y-2 pl-6', normalizeMarkdownProps(props).className, className) })));
|
|
77
|
-
} });
|
|
78
|
-
|
|
79
|
-
exports.baseMarkdownComponents = baseMarkdownComponents;
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import { __rest } from 'tslib';
|
|
2
|
-
import { jsx } from 'react/jsx-runtime';
|
|
3
|
-
import { cn } from '@windrun-huaiin/lib/utils';
|
|
4
|
-
import defaultMdxComponents from 'fumadocs-ui/mdx';
|
|
5
|
-
import { ImageZoom } from '../heavy/image-zoom.mjs';
|
|
6
|
-
import 'katex';
|
|
7
|
-
import '@windrun-huaiin/base-ui/icons';
|
|
8
|
-
import 'next-themes';
|
|
9
|
-
import 'roughjs';
|
|
10
|
-
import 'react';
|
|
11
|
-
import '@windrun-huaiin/base-ui/lib';
|
|
12
|
-
|
|
13
|
-
function normalizeMarkdownProps(props) {
|
|
14
|
-
const { class: legacyClassName, className } = props, restProps = __rest(props, ["class", "className"]);
|
|
15
|
-
return Object.assign(Object.assign({}, restProps), { className: cn(typeof legacyClassName === 'string' ? legacyClassName : undefined, className) });
|
|
16
|
-
}
|
|
17
|
-
const baseMarkdownComponents = Object.assign(Object.assign({}, defaultMdxComponents), { a: (_a) => {
|
|
18
|
-
var _b, _c;
|
|
19
|
-
var { className } = _a, props = __rest(_a, ["className"]);
|
|
20
|
-
return (jsx("a", Object.assign({}, normalizeMarkdownProps(props), { className: cn('underline underline-offset-4 transition hover:opacity-80', normalizeMarkdownProps(props).className, className), target: (_b = props.target) !== null && _b !== void 0 ? _b : '_blank', rel: (_c = props.rel) !== null && _c !== void 0 ? _c : 'noreferrer noopener' })));
|
|
21
|
-
}, blockquote: (_a) => {
|
|
22
|
-
var { className } = _a, props = __rest(_a, ["className"]);
|
|
23
|
-
return (jsx("blockquote", Object.assign({}, normalizeMarkdownProps(props), { className: cn('border-l-2 border-border pl-4 text-muted-foreground', normalizeMarkdownProps(props).className, className) })));
|
|
24
|
-
}, code: (_a) => {
|
|
25
|
-
var { className } = _a, props = __rest(_a, ["className"]);
|
|
26
|
-
return (jsx("code", Object.assign({}, normalizeMarkdownProps(props), { className: cn('rounded-md bg-muted px-1.5 py-0.5 font-mono text-[0.9em]', normalizeMarkdownProps(props).className, className) })));
|
|
27
|
-
}, h1: (_a) => {
|
|
28
|
-
var { className } = _a, props = __rest(_a, ["className"]);
|
|
29
|
-
return (jsx("h1", Object.assign({}, normalizeMarkdownProps(props), { className: cn('text-2xl font-semibold tracking-tight', normalizeMarkdownProps(props).className, className) })));
|
|
30
|
-
}, h2: (_a) => {
|
|
31
|
-
var { className } = _a, props = __rest(_a, ["className"]);
|
|
32
|
-
return (jsx("h2", Object.assign({}, normalizeMarkdownProps(props), { className: cn('text-xl font-semibold tracking-tight', normalizeMarkdownProps(props).className, className) })));
|
|
33
|
-
}, h3: (_a) => {
|
|
34
|
-
var { className } = _a, props = __rest(_a, ["className"]);
|
|
35
|
-
return (jsx("h3", Object.assign({}, normalizeMarkdownProps(props), { className: cn('text-lg font-semibold', normalizeMarkdownProps(props).className, className) })));
|
|
36
|
-
}, h4: (_a) => {
|
|
37
|
-
var { className } = _a, props = __rest(_a, ["className"]);
|
|
38
|
-
return (jsx("h4", Object.assign({}, normalizeMarkdownProps(props), { className: cn('text-base font-semibold', normalizeMarkdownProps(props).className, className) })));
|
|
39
|
-
}, h5: (_a) => {
|
|
40
|
-
var { className } = _a, props = __rest(_a, ["className"]);
|
|
41
|
-
return (jsx("h5", Object.assign({}, normalizeMarkdownProps(props), { className: cn('text-sm font-semibold', normalizeMarkdownProps(props).className, className) })));
|
|
42
|
-
}, h6: (_a) => {
|
|
43
|
-
var { className } = _a, props = __rest(_a, ["className"]);
|
|
44
|
-
return (jsx("h6", Object.assign({}, normalizeMarkdownProps(props), { className: cn('text-sm font-semibold', normalizeMarkdownProps(props).className, className) })));
|
|
45
|
-
}, hr: (_a) => {
|
|
46
|
-
var { className } = _a, props = __rest(_a, ["className"]);
|
|
47
|
-
return (jsx("hr", Object.assign({}, normalizeMarkdownProps(props), { className: cn('border-border', normalizeMarkdownProps(props).className, className) })));
|
|
48
|
-
}, img: (_a) => {
|
|
49
|
-
var { className, alt, src } = _a, props = __rest(_a, ["className", "alt", "src"]);
|
|
50
|
-
return (jsx(ImageZoom, Object.assign({}, normalizeMarkdownProps(props), { alt: typeof alt === 'string' ? alt : '', src: typeof src === 'string' ? src : '', className: cn('overflow-hidden rounded-2xl', normalizeMarkdownProps(props).className, className) })));
|
|
51
|
-
}, li: (_a) => {
|
|
52
|
-
var { className } = _a, props = __rest(_a, ["className"]);
|
|
53
|
-
return (jsx("li", Object.assign({}, normalizeMarkdownProps(props), { className: cn('leading-7', normalizeMarkdownProps(props).className, className) })));
|
|
54
|
-
}, ol: (_a) => {
|
|
55
|
-
var { className } = _a, props = __rest(_a, ["className"]);
|
|
56
|
-
return (jsx("ol", Object.assign({}, normalizeMarkdownProps(props), { className: cn('list-decimal space-y-2 pl-6', normalizeMarkdownProps(props).className, className) })));
|
|
57
|
-
}, p: (_a) => {
|
|
58
|
-
var { className } = _a, props = __rest(_a, ["className"]);
|
|
59
|
-
return (jsx("p", Object.assign({}, normalizeMarkdownProps(props), { className: cn('leading-7', normalizeMarkdownProps(props).className, className) })));
|
|
60
|
-
}, pre: (_a) => {
|
|
61
|
-
var { className } = _a, props = __rest(_a, ["className"]);
|
|
62
|
-
return (jsx("pre", Object.assign({}, normalizeMarkdownProps(props), { className: cn('overflow-x-auto rounded-2xl border border-border bg-muted px-4 py-3 text-sm', normalizeMarkdownProps(props).className, className) })));
|
|
63
|
-
}, table: (_a) => {
|
|
64
|
-
var { className } = _a, props = __rest(_a, ["className"]);
|
|
65
|
-
return (jsx("div", { className: "overflow-x-auto", children: jsx("table", Object.assign({}, normalizeMarkdownProps(props), { className: cn('w-full border-collapse text-sm', normalizeMarkdownProps(props).className, className) })) }));
|
|
66
|
-
}, td: (_a) => {
|
|
67
|
-
var { className } = _a, props = __rest(_a, ["className"]);
|
|
68
|
-
return (jsx("td", Object.assign({}, normalizeMarkdownProps(props), { className: cn('border border-border px-3 py-2 align-top', normalizeMarkdownProps(props).className, className) })));
|
|
69
|
-
}, th: (_a) => {
|
|
70
|
-
var { className } = _a, props = __rest(_a, ["className"]);
|
|
71
|
-
return (jsx("th", Object.assign({}, normalizeMarkdownProps(props), { className: cn('border border-border px-3 py-2 text-left font-medium', normalizeMarkdownProps(props).className, className) })));
|
|
72
|
-
}, ul: (_a) => {
|
|
73
|
-
var { className } = _a, props = __rest(_a, ["className"]);
|
|
74
|
-
return (jsx("ul", Object.assign({}, normalizeMarkdownProps(props), { className: cn('list-disc space-y-2 pl-6', normalizeMarkdownProps(props).className, className) })));
|
|
75
|
-
} });
|
|
76
|
-
|
|
77
|
-
export { baseMarkdownComponents };
|
package/dist/fuma/mdx/math.d.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
-
type MathSourceProps = {
|
|
3
|
-
children?: ReactNode;
|
|
4
|
-
math?: string;
|
|
5
|
-
formula?: string;
|
|
6
|
-
};
|
|
7
|
-
type Align = 'left' | 'center' | 'right';
|
|
8
|
-
export type MathBlockProps = Omit<HTMLAttributes<HTMLDivElement>, 'children'> & MathSourceProps & {
|
|
9
|
-
title?: ReactNode;
|
|
10
|
-
titleAlign?: Align;
|
|
11
|
-
};
|
|
12
|
-
export type InlineMathProps = Omit<HTMLAttributes<HTMLSpanElement>, 'children'> & MathSourceProps & {
|
|
13
|
-
align?: Align;
|
|
14
|
-
};
|
|
15
|
-
export declare function MathBlock({ title, titleAlign, children, math, formula, className, ...props }: MathBlockProps): import("react/jsx-runtime").JSX.Element;
|
|
16
|
-
export declare function InlineMath({ children, math, formula, align, className, ...props }: InlineMathProps): import("react/jsx-runtime").JSX.Element;
|
|
17
|
-
export {};
|
package/dist/fuma/mdx/math.js
DELETED
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var tslib = require('tslib');
|
|
4
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
5
|
-
var katex = require('katex');
|
|
6
|
-
var utils = require('@windrun-huaiin/lib/utils');
|
|
7
|
-
|
|
8
|
-
const alignClassMap = {
|
|
9
|
-
left: 'text-left justify-start',
|
|
10
|
-
center: 'text-center justify-center',
|
|
11
|
-
right: 'text-right justify-end',
|
|
12
|
-
};
|
|
13
|
-
const textAlignClassMap = {
|
|
14
|
-
left: 'text-left',
|
|
15
|
-
center: 'text-center',
|
|
16
|
-
right: 'text-right',
|
|
17
|
-
};
|
|
18
|
-
function getMathSource({ children, math, formula }) {
|
|
19
|
-
if (typeof math === 'string' && math.trim() !== '')
|
|
20
|
-
return math.trim();
|
|
21
|
-
if (typeof formula === 'string' && formula.trim() !== '')
|
|
22
|
-
return formula.trim();
|
|
23
|
-
if (typeof children === 'string' && children.trim() !== '')
|
|
24
|
-
return children.trim();
|
|
25
|
-
if (Array.isArray(children)) {
|
|
26
|
-
const text = children
|
|
27
|
-
.map((item) => (typeof item === 'string' ? item : ''))
|
|
28
|
-
.join('')
|
|
29
|
-
.trim();
|
|
30
|
-
if (text !== '')
|
|
31
|
-
return text;
|
|
32
|
-
}
|
|
33
|
-
return '';
|
|
34
|
-
}
|
|
35
|
-
function renderMath(source, displayMode) {
|
|
36
|
-
if (source === '')
|
|
37
|
-
return '';
|
|
38
|
-
return katex.renderToString(source, {
|
|
39
|
-
displayMode,
|
|
40
|
-
throwOnError: false,
|
|
41
|
-
output: 'html',
|
|
42
|
-
strict: 'ignore',
|
|
43
|
-
trust: false,
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
function MathBlock(_a) {
|
|
47
|
-
var { title, titleAlign = 'center', children, math, formula, className } = _a, props = tslib.__rest(_a, ["title", "titleAlign", "children", "math", "formula", "className"]);
|
|
48
|
-
const source = getMathSource({ children, math, formula });
|
|
49
|
-
const html = renderMath(source, true);
|
|
50
|
-
return (jsxRuntime.jsxs("div", Object.assign({}, props, { className: utils.cn('not-prose my-6 overflow-x-auto rounded-xl border bg-fd-card p-4 text-fd-card-foreground', className), children: [title ? (jsxRuntime.jsx("div", { className: utils.cn('mb-3 text-sm font-medium text-fd-muted-foreground', alignClassMap[titleAlign].split(' ')[0]), children: title })) : null, html ? (jsxRuntime.jsx("div", { className: "min-w-fit [&_.katex-display]:my-0 [&_.katex-display]:overflow-x-auto [&_.katex-display]:overflow-y-hidden", dangerouslySetInnerHTML: { __html: html } })) : (jsxRuntime.jsx("div", { className: "text-sm text-fd-muted-foreground", children: "Empty math block." }))] })));
|
|
51
|
-
}
|
|
52
|
-
function InlineMath(_a) {
|
|
53
|
-
var { children, math, formula, align = 'center', className } = _a, props = tslib.__rest(_a, ["children", "math", "formula", "align", "className"]);
|
|
54
|
-
const source = getMathSource({ children, math, formula });
|
|
55
|
-
const html = renderMath(source, false);
|
|
56
|
-
return (jsxRuntime.jsx("span", Object.assign({}, props, { className: utils.cn('mx-1 inline-flex max-w-full align-middle rounded-md bg-neutral-200 px-2 py-0.5 text-sm leading-none dark:bg-white/20 [&_.katex]:text-inherit', textAlignClassMap[align], className), children: jsxRuntime.jsx("span", { dangerouslySetInnerHTML: { __html: html } }) })));
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
exports.InlineMath = InlineMath;
|
|
60
|
-
exports.MathBlock = MathBlock;
|
package/dist/fuma/mdx/math.mjs
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { __rest } from 'tslib';
|
|
2
|
-
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
|
-
import katex from 'katex';
|
|
4
|
-
import { cn } from '@windrun-huaiin/lib/utils';
|
|
5
|
-
|
|
6
|
-
const alignClassMap = {
|
|
7
|
-
left: 'text-left justify-start',
|
|
8
|
-
center: 'text-center justify-center',
|
|
9
|
-
right: 'text-right justify-end',
|
|
10
|
-
};
|
|
11
|
-
const textAlignClassMap = {
|
|
12
|
-
left: 'text-left',
|
|
13
|
-
center: 'text-center',
|
|
14
|
-
right: 'text-right',
|
|
15
|
-
};
|
|
16
|
-
function getMathSource({ children, math, formula }) {
|
|
17
|
-
if (typeof math === 'string' && math.trim() !== '')
|
|
18
|
-
return math.trim();
|
|
19
|
-
if (typeof formula === 'string' && formula.trim() !== '')
|
|
20
|
-
return formula.trim();
|
|
21
|
-
if (typeof children === 'string' && children.trim() !== '')
|
|
22
|
-
return children.trim();
|
|
23
|
-
if (Array.isArray(children)) {
|
|
24
|
-
const text = children
|
|
25
|
-
.map((item) => (typeof item === 'string' ? item : ''))
|
|
26
|
-
.join('')
|
|
27
|
-
.trim();
|
|
28
|
-
if (text !== '')
|
|
29
|
-
return text;
|
|
30
|
-
}
|
|
31
|
-
return '';
|
|
32
|
-
}
|
|
33
|
-
function renderMath(source, displayMode) {
|
|
34
|
-
if (source === '')
|
|
35
|
-
return '';
|
|
36
|
-
return katex.renderToString(source, {
|
|
37
|
-
displayMode,
|
|
38
|
-
throwOnError: false,
|
|
39
|
-
output: 'html',
|
|
40
|
-
strict: 'ignore',
|
|
41
|
-
trust: false,
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
function MathBlock(_a) {
|
|
45
|
-
var { title, titleAlign = 'center', children, math, formula, className } = _a, props = __rest(_a, ["title", "titleAlign", "children", "math", "formula", "className"]);
|
|
46
|
-
const source = getMathSource({ children, math, formula });
|
|
47
|
-
const html = renderMath(source, true);
|
|
48
|
-
return (jsxs("div", Object.assign({}, props, { className: cn('not-prose my-6 overflow-x-auto rounded-xl border bg-fd-card p-4 text-fd-card-foreground', className), children: [title ? (jsx("div", { className: cn('mb-3 text-sm font-medium text-fd-muted-foreground', alignClassMap[titleAlign].split(' ')[0]), children: title })) : null, html ? (jsx("div", { className: "min-w-fit [&_.katex-display]:my-0 [&_.katex-display]:overflow-x-auto [&_.katex-display]:overflow-y-hidden", dangerouslySetInnerHTML: { __html: html } })) : (jsx("div", { className: "text-sm text-fd-muted-foreground", children: "Empty math block." }))] })));
|
|
49
|
-
}
|
|
50
|
-
function InlineMath(_a) {
|
|
51
|
-
var { children, math, formula, align = 'center', className } = _a, props = __rest(_a, ["children", "math", "formula", "align", "className"]);
|
|
52
|
-
const source = getMathSource({ children, math, formula });
|
|
53
|
-
const html = renderMath(source, false);
|
|
54
|
-
return (jsx("span", Object.assign({}, props, { className: cn('mx-1 inline-flex max-w-full align-middle rounded-md bg-neutral-200 px-2 py-0.5 text-sm leading-none dark:bg-white/20 [&_.katex]:text-inherit', textAlignClassMap[align], className), children: jsx("span", { dangerouslySetInnerHTML: { __html: html } }) })));
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
export { InlineMath, MathBlock };
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
interface MermaidProps {
|
|
2
|
-
chart: string;
|
|
3
|
-
title?: string;
|
|
4
|
-
watermarkEnabled?: boolean;
|
|
5
|
-
watermarkText?: string;
|
|
6
|
-
handDrawn?: boolean;
|
|
7
|
-
/**
|
|
8
|
-
* enable preview dialog by clicking the chart, default is true
|
|
9
|
-
*/
|
|
10
|
-
enablePreview?: boolean;
|
|
11
|
-
}
|
|
12
|
-
export declare function Mermaid({ chart, title, watermarkEnabled, watermarkText, handDrawn, enablePreview }: MermaidProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
-
export {};
|