@windrun-huaiin/third-ui 15.1.1 → 16.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/LICENSE +1 -1
- package/dist/ai/ai-chat-composer.d.ts +2 -0
- package/dist/ai/ai-chat-composer.js +47 -0
- package/dist/ai/ai-chat-composer.mjs +45 -0
- package/dist/ai/ai-markdown.d.ts +2 -0
- package/dist/ai/ai-markdown.js +36 -0
- package/dist/ai/ai-markdown.mjs +34 -0
- package/dist/ai/ai-message-actions.d.ts +2 -0
- package/dist/ai/ai-message-actions.js +14 -0
- package/dist/ai/ai-message-actions.mjs +12 -0
- package/dist/ai/ai-message-bubble.d.ts +2 -0
- package/dist/ai/ai-message-bubble.js +66 -0
- package/dist/ai/ai-message-bubble.mjs +64 -0
- package/dist/ai/ai-message-content.d.ts +2 -0
- package/dist/ai/ai-message-content.js +63 -0
- package/dist/ai/ai-message-content.mjs +61 -0
- package/dist/ai/ai-message-list.d.ts +2 -0
- package/dist/ai/ai-message-list.js +24 -0
- package/dist/ai/ai-message-list.mjs +22 -0
- package/dist/ai/ai-message-meta.d.ts +2 -0
- package/dist/ai/ai-message-meta.js +38 -0
- package/dist/ai/ai-message-meta.mjs +36 -0
- package/dist/ai/ai-status-indicator.d.ts +2 -0
- package/dist/ai/ai-status-indicator.js +51 -0
- package/dist/ai/ai-status-indicator.mjs +49 -0
- package/dist/ai/index.d.ts +11 -0
- package/dist/ai/index.js +33 -0
- package/dist/ai/index.mjs +11 -0
- package/dist/ai/types.d.ts +110 -0
- package/dist/ai/use-ai-conversation.d.ts +13 -0
- package/dist/ai/use-ai-conversation.js +276 -0
- package/dist/ai/use-ai-conversation.mjs +274 -0
- package/dist/clerk/clerk-organization-client.js +2 -2
- package/dist/clerk/clerk-organization-client.mjs +2 -2
- package/dist/clerk/clerk-page-generator.d.ts +1 -1
- package/dist/clerk/clerk-user-client.js +2 -2
- package/dist/clerk/clerk-user-client.mjs +2 -2
- package/dist/clerk/fingerprint/fingerprint-provider.js +9 -9
- package/dist/clerk/fingerprint/fingerprint-provider.mjs +9 -9
- package/dist/fuma/base/custom-header.js +4 -4
- package/dist/fuma/base/custom-header.mjs +4 -4
- package/dist/fuma/mdx/banner.js +3 -3
- package/dist/fuma/mdx/banner.mjs +3 -3
- package/dist/fuma/mdx/fuma-github-info.js +3 -3
- package/dist/fuma/mdx/fuma-github-info.mjs +3 -3
- package/dist/fuma/mdx/gradient-button.js +3 -3
- package/dist/fuma/mdx/gradient-button.mjs +3 -3
- package/dist/fuma/mdx/index.d.ts +1 -0
- package/dist/fuma/mdx/index.js +2 -0
- package/dist/fuma/mdx/index.mjs +1 -0
- package/dist/fuma/mdx/markdown-component-map.d.ts +3 -0
- package/dist/fuma/mdx/markdown-component-map.js +73 -0
- package/dist/fuma/mdx/markdown-component-map.mjs +71 -0
- package/dist/fuma/mdx/mermaid.d.ts +2 -1
- package/dist/fuma/mdx/mermaid.js +130 -6
- package/dist/fuma/mdx/mermaid.mjs +130 -6
- package/dist/fuma/mdx/toc-base.js +4 -4
- package/dist/fuma/mdx/toc-base.mjs +4 -4
- package/dist/fuma/mdx/trophy-card.js +2 -2
- package/dist/fuma/mdx/trophy-card.mjs +2 -2
- package/dist/fuma/mdx/zia-card.js +3 -3
- package/dist/fuma/mdx/zia-card.mjs +3 -3
- package/dist/fuma/mdx/zia-file.js +3 -3
- package/dist/fuma/mdx/zia-file.mjs +3 -3
- package/dist/main/ads-alert-dialog.js +2 -2
- package/dist/main/ads-alert-dialog.mjs +2 -2
- package/dist/main/credit/credit-nav-button.js +2 -2
- package/dist/main/credit/credit-nav-button.mjs +2 -2
- package/dist/main/credit/credit-overview-client.js +4 -4
- package/dist/main/credit/credit-overview-client.mjs +4 -4
- package/dist/main/footer.js +2 -2
- package/dist/main/footer.mjs +2 -2
- package/dist/main/go-to-top.js +2 -2
- package/dist/main/go-to-top.mjs +2 -2
- package/dist/main/index.d.ts +1 -0
- package/dist/main/index.js +2 -0
- package/dist/main/index.mjs +1 -0
- package/dist/main/info-tooltip.d.ts +8 -0
- package/dist/main/info-tooltip.js +48 -0
- package/dist/main/info-tooltip.mjs +46 -0
- package/dist/main/pill-select/x-pill-select.js +2 -2
- package/dist/main/pill-select/x-pill-select.mjs +2 -2
- package/dist/main/pill-select/x-token-input.js +2 -2
- package/dist/main/pill-select/x-token-input.mjs +2 -2
- package/dist/main/x-button.js +3 -3
- package/dist/main/x-button.mjs +3 -3
- package/package.json +16 -3
- package/src/ai/ai-chat-composer.tsx +187 -0
- package/src/ai/ai-markdown.tsx +45 -0
- package/src/ai/ai-message-actions.tsx +16 -0
- package/src/ai/ai-message-bubble.tsx +138 -0
- package/src/ai/ai-message-content.tsx +149 -0
- package/src/ai/ai-message-list.tsx +59 -0
- package/src/ai/ai-message-meta.tsx +56 -0
- package/src/ai/ai-status-indicator.tsx +61 -0
- package/src/ai/index.ts +13 -0
- package/src/ai/types.ts +131 -0
- package/src/ai/use-ai-conversation.ts +422 -0
- package/src/clerk/clerk-organization-client.tsx +5 -5
- package/src/clerk/clerk-page-generator.tsx +1 -1
- package/src/clerk/clerk-user-client.tsx +4 -4
- package/src/clerk/fingerprint/fingerprint-provider.tsx +34 -22
- package/src/fuma/base/custom-header.tsx +5 -5
- package/src/fuma/mdx/banner.tsx +3 -3
- package/src/fuma/mdx/fuma-github-info.tsx +4 -4
- package/src/fuma/mdx/gradient-button.tsx +3 -3
- package/src/fuma/mdx/index.ts +2 -1
- package/src/fuma/mdx/markdown-component-map.tsx +174 -0
- package/src/fuma/mdx/mermaid.tsx +145 -10
- package/src/fuma/mdx/toc-base.tsx +5 -5
- package/src/fuma/mdx/trophy-card.tsx +2 -2
- package/src/fuma/mdx/zia-card.tsx +3 -3
- package/src/fuma/mdx/zia-file.tsx +3 -3
- package/src/main/ads-alert-dialog.tsx +5 -5
- package/src/main/credit/credit-nav-button.tsx +3 -3
- package/src/main/credit/credit-overview-client.tsx +15 -7
- package/src/main/features.tsx +5 -3
- package/src/main/footer.tsx +4 -5
- package/src/main/go-to-top.tsx +2 -2
- package/src/main/index.ts +2 -0
- package/src/main/info-tooltip.tsx +99 -0
- package/src/main/language-detector.tsx +4 -4
- package/src/main/pill-select/x-pill-select.tsx +2 -2
- package/src/main/pill-select/x-token-input.tsx +2 -2
- package/src/main/x-button.tsx +4 -4
|
@@ -3,8 +3,8 @@ import { __rest } from 'tslib';
|
|
|
3
3
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
4
4
|
import { useMemo, Fragment as Fragment$1, useState } from 'react';
|
|
5
5
|
import { cva } from 'class-variance-authority';
|
|
6
|
+
import { LanguagesIcon, ChevronDownIcon } from '@windrun-huaiin/base-ui/icons';
|
|
6
7
|
import Link from 'fumadocs-core/link';
|
|
7
|
-
import { globalLucideIcons } from '@windrun-huaiin/base-ui/components/server';
|
|
8
8
|
import { getLinks, BaseLinkItem } from 'fumadocs-ui/layouts/shared';
|
|
9
9
|
import { cn } from 'fumadocs-ui/utils/cn';
|
|
10
10
|
import { LargeSearchToggle, SearchToggle } from 'fumadocs-ui/components/layout/search-toggle';
|
|
@@ -57,7 +57,7 @@ function CustomHomeHeader({ nav = {}, i18n = false, links, githubUrl, themeSwitc
|
|
|
57
57
|
theme: themeSwitch.enabled !== false
|
|
58
58
|
? (_c = themeSwitch.component) !== null && _c !== void 0 ? _c : jsx(ThemeToggle, { mode: themeSwitch === null || themeSwitch === void 0 ? void 0 : themeSwitch.mode })
|
|
59
59
|
: null,
|
|
60
|
-
i18n: i18n ? (jsx(CompactLanguageToggle, { children: jsx(
|
|
60
|
+
i18n: i18n ? (jsx(CompactLanguageToggle, { children: jsx(LanguagesIcon, { className: "size-5" }) })) : null,
|
|
61
61
|
secondary: desktopSecondaryDisplayItems.length ? (jsx("ul", { className: "flex flex-row gap-2 items-center empty:hidden", children: desktopSecondaryDisplayItems.map((item, i) => (jsx(NavbarLinkItem, { item: item, className: cn(item.type === 'icon' && [
|
|
62
62
|
'-mx-1',
|
|
63
63
|
i === 0 && 'ms-0',
|
|
@@ -76,7 +76,7 @@ function CustomHomeHeader({ nav = {}, i18n = false, links, githubUrl, themeSwitc
|
|
|
76
76
|
secondary: secondaryMenuDisplayItems.length ? (jsx(Fragment, { children: secondaryMenuDisplayItems.map((item, i) => (jsx(MenuLinkItem, { item: item, className: "-me-1.5" }, i))) })) : null,
|
|
77
77
|
github: githubMobileMenuItem ? (jsx(MenuLinkItem, { item: githubMobileMenuItem, className: "-me-1.5" })) : null,
|
|
78
78
|
separator: jsx("div", { role: "separator", className: "flex-1" }),
|
|
79
|
-
i18n: i18n ? (jsxs(CompactLanguageToggle, { children: [jsx(
|
|
79
|
+
i18n: i18n ? (jsxs(CompactLanguageToggle, { children: [jsx(LanguagesIcon, { className: "size-5" }), jsx(LanguageToggleText, {}), jsx(ChevronDownIcon, { className: "size-3 text-fd-muted-foreground" })] })) : null,
|
|
80
80
|
theme: themeSwitch.enabled !== false
|
|
81
81
|
? (_d = themeSwitch.component) !== null && _d !== void 0 ? _d : jsx(ThemeToggle, { mode: themeSwitch === null || themeSwitch === void 0 ? void 0 : themeSwitch.mode })
|
|
82
82
|
: null,
|
|
@@ -91,7 +91,7 @@ function CustomHomeHeader({ nav = {}, i18n = false, links, githubUrl, themeSwitc
|
|
|
91
91
|
size: 'icon',
|
|
92
92
|
color: 'ghost',
|
|
93
93
|
className: 'group [&_svg]:size-5.5',
|
|
94
|
-
})), enableHover: nav.enableHoverToOpen, children: jsx(
|
|
94
|
+
})), enableHover: nav.enableHoverToOpen, children: jsx(ChevronDownIcon, { className: "transition-transform duration-300 group-data-[state=open]:rotate-180" }) }), jsxs(MenuContent, { className: "sm:flex-row sm:items-center sm:justify-end", children: [primaryMenuItems.map((item, i) => (jsx(MenuLinkItem, { item: item, className: "sm:hidden" }, i))), shouldRenderMobileUtilities ? (jsx("div", { className: "-ms-1.5 flex flex-row items-center gap-1.5 max-sm:mt-2", children: mobileMenuActionsOrder.map((action) => {
|
|
95
95
|
const node = renderMobileMenuAction(action);
|
|
96
96
|
if (!node)
|
|
97
97
|
return null;
|
package/dist/fuma/mdx/banner.js
CHANGED
|
@@ -5,7 +5,7 @@ var tslib = require('tslib');
|
|
|
5
5
|
var jsxRuntime = require('react/jsx-runtime');
|
|
6
6
|
var classVarianceAuthority = require('class-variance-authority');
|
|
7
7
|
var React = require('react');
|
|
8
|
-
var
|
|
8
|
+
var icons = require('@windrun-huaiin/base-ui/icons');
|
|
9
9
|
var utils = require('@windrun-huaiin/lib/utils');
|
|
10
10
|
|
|
11
11
|
const buttonVariants = classVarianceAuthority.cva('inline-flex items-center justify-center rounded-md p-2 text-sm font-medium transition-colors duration-100 disabled:pointer-events-none disabled:opacity-50', {
|
|
@@ -82,9 +82,9 @@ function Banner(_a) {
|
|
|
82
82
|
localStorage.setItem(globalKey, 'true');
|
|
83
83
|
}, className: utils.cn(buttonVariants({
|
|
84
84
|
color: 'ghost',
|
|
85
|
-
className: 'absolute
|
|
85
|
+
className: 'absolute inset-e-2 top-1/2 -translate-y-1/2 text-neutral-600 dark:text-neutral-400',
|
|
86
86
|
size: 'icon',
|
|
87
|
-
})), children: jsxRuntime.jsx(
|
|
87
|
+
})), children: jsxRuntime.jsx(icons.XIcon, {}) })) : null] })));
|
|
88
88
|
}
|
|
89
89
|
|
|
90
90
|
exports.Banner = Banner;
|
package/dist/fuma/mdx/banner.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import { __rest } from 'tslib';
|
|
|
3
3
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
4
4
|
import { cva } from 'class-variance-authority';
|
|
5
5
|
import { useState, useEffect } from 'react';
|
|
6
|
-
import {
|
|
6
|
+
import { XIcon } from '@windrun-huaiin/base-ui/icons';
|
|
7
7
|
import { cn } from '@windrun-huaiin/lib/utils';
|
|
8
8
|
|
|
9
9
|
const buttonVariants = cva('inline-flex items-center justify-center rounded-md p-2 text-sm font-medium transition-colors duration-100 disabled:pointer-events-none disabled:opacity-50', {
|
|
@@ -80,9 +80,9 @@ function Banner(_a) {
|
|
|
80
80
|
localStorage.setItem(globalKey, 'true');
|
|
81
81
|
}, className: cn(buttonVariants({
|
|
82
82
|
color: 'ghost',
|
|
83
|
-
className: 'absolute
|
|
83
|
+
className: 'absolute inset-e-2 top-1/2 -translate-y-1/2 text-neutral-600 dark:text-neutral-400',
|
|
84
84
|
size: 'icon',
|
|
85
|
-
})), children: jsx(
|
|
85
|
+
})), children: jsx(XIcon, {}) })) : null] })));
|
|
86
86
|
}
|
|
87
87
|
|
|
88
88
|
export { Banner };
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
var tslib = require('tslib');
|
|
5
5
|
var jsxRuntime = require('react/jsx-runtime');
|
|
6
6
|
var React = require('react');
|
|
7
|
-
var
|
|
7
|
+
var icons = require('@windrun-huaiin/base-ui/icons');
|
|
8
8
|
|
|
9
9
|
// Loading state component
|
|
10
10
|
function GitHubInfoSkeleton({ owner, repo, className }) {
|
|
@@ -12,12 +12,12 @@ function GitHubInfoSkeleton({ owner, repo, className }) {
|
|
|
12
12
|
}
|
|
13
13
|
// Error state component - graceful fallback
|
|
14
14
|
function GitHubInfoFallback({ owner, repo, className }) {
|
|
15
|
-
return (jsxRuntime.jsxs("a", { href: `https://github.com/${owner}/${repo}`, rel: "noreferrer noopener", target: "_blank", className: `flex flex-col gap-1.5 p-2 rounded-lg text-sm text-fd-foreground/80 transition-colors lg:flex-row lg:items-center hover:text-fd-accent-foreground hover:bg-fd-accent ${className}`, children: [jsxRuntime.jsxs("p", { className: "flex items-center gap-2 truncate", children: [jsxRuntime.jsxs("svg", { fill: "currentColor", viewBox: "0 0 24 24", className: "size-3.5", children: [jsxRuntime.jsx("title", { children: "GitHub" }), jsxRuntime.jsx("path", { d: "M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12" })] }), owner, "/", repo] }), jsxRuntime.jsxs("p", { className: "flex text-xs items-center gap-1 text-fd-muted-foreground", children: [jsxRuntime.jsx(
|
|
15
|
+
return (jsxRuntime.jsxs("a", { href: `https://github.com/${owner}/${repo}`, rel: "noreferrer noopener", target: "_blank", className: `flex flex-col gap-1.5 p-2 rounded-lg text-sm text-fd-foreground/80 transition-colors lg:flex-row lg:items-center hover:text-fd-accent-foreground hover:bg-fd-accent ${className}`, children: [jsxRuntime.jsxs("p", { className: "flex items-center gap-2 truncate", children: [jsxRuntime.jsxs("svg", { fill: "currentColor", viewBox: "0 0 24 24", className: "size-3.5", children: [jsxRuntime.jsx("title", { children: "GitHub" }), jsxRuntime.jsx("path", { d: "M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12" })] }), owner, "/", repo] }), jsxRuntime.jsxs("p", { className: "flex text-xs items-center gap-1 text-fd-muted-foreground", children: [jsxRuntime.jsx(icons.ExternalLinkIcon, { className: "size-3" }), "GitHub"] })] }));
|
|
16
16
|
}
|
|
17
17
|
// Success state component
|
|
18
18
|
function GitHubInfoSuccess({ owner, repo, stars, className }) {
|
|
19
19
|
const humanizedStars = humanizeNumber(stars);
|
|
20
|
-
return (jsxRuntime.jsxs("a", { href: `https://github.com/${owner}/${repo}`, rel: "noreferrer noopener", target: "_blank", className: `flex flex-col gap-1.5 p-2 rounded-lg text-sm text-fd-foreground/80 transition-colors lg:flex-row lg:items-center hover:text-fd-accent-foreground hover:bg-fd-accent ${className}`, children: [jsxRuntime.jsxs("p", { className: "flex items-center gap-2 truncate", children: [jsxRuntime.jsxs("svg", { fill: "currentColor", viewBox: "0 0 24 24", className: "size-3.5", children: [jsxRuntime.jsx("title", { children: "GitHub" }), jsxRuntime.jsx("path", { d: "M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12" })] }), owner, "/", repo] }), jsxRuntime.jsxs("p", { className: "flex text-xs items-center gap-1 text-fd-muted-foreground", children: [jsxRuntime.jsx(
|
|
20
|
+
return (jsxRuntime.jsxs("a", { href: `https://github.com/${owner}/${repo}`, rel: "noreferrer noopener", target: "_blank", className: `flex flex-col gap-1.5 p-2 rounded-lg text-sm text-fd-foreground/80 transition-colors lg:flex-row lg:items-center hover:text-fd-accent-foreground hover:bg-fd-accent ${className}`, children: [jsxRuntime.jsxs("p", { className: "flex items-center gap-2 truncate", children: [jsxRuntime.jsxs("svg", { fill: "currentColor", viewBox: "0 0 24 24", className: "size-3.5", children: [jsxRuntime.jsx("title", { children: "GitHub" }), jsxRuntime.jsx("path", { d: "M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12" })] }), owner, "/", repo] }), jsxRuntime.jsxs("p", { className: "flex text-xs items-center gap-1 text-fd-muted-foreground", children: [jsxRuntime.jsx(icons.StarIcon, { className: "size-3" }), humanizedStars] })] }));
|
|
21
21
|
}
|
|
22
22
|
/**
|
|
23
23
|
* Humanize number display
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { __awaiter } from 'tslib';
|
|
3
3
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
4
4
|
import { useState, useEffect } from 'react';
|
|
5
|
-
import {
|
|
5
|
+
import { ExternalLinkIcon, StarIcon } from '@windrun-huaiin/base-ui/icons';
|
|
6
6
|
|
|
7
7
|
// Loading state component
|
|
8
8
|
function GitHubInfoSkeleton({ owner, repo, className }) {
|
|
@@ -10,12 +10,12 @@ function GitHubInfoSkeleton({ owner, repo, className }) {
|
|
|
10
10
|
}
|
|
11
11
|
// Error state component - graceful fallback
|
|
12
12
|
function GitHubInfoFallback({ owner, repo, className }) {
|
|
13
|
-
return (jsxs("a", { href: `https://github.com/${owner}/${repo}`, rel: "noreferrer noopener", target: "_blank", className: `flex flex-col gap-1.5 p-2 rounded-lg text-sm text-fd-foreground/80 transition-colors lg:flex-row lg:items-center hover:text-fd-accent-foreground hover:bg-fd-accent ${className}`, children: [jsxs("p", { className: "flex items-center gap-2 truncate", children: [jsxs("svg", { fill: "currentColor", viewBox: "0 0 24 24", className: "size-3.5", children: [jsx("title", { children: "GitHub" }), jsx("path", { d: "M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12" })] }), owner, "/", repo] }), jsxs("p", { className: "flex text-xs items-center gap-1 text-fd-muted-foreground", children: [jsx(
|
|
13
|
+
return (jsxs("a", { href: `https://github.com/${owner}/${repo}`, rel: "noreferrer noopener", target: "_blank", className: `flex flex-col gap-1.5 p-2 rounded-lg text-sm text-fd-foreground/80 transition-colors lg:flex-row lg:items-center hover:text-fd-accent-foreground hover:bg-fd-accent ${className}`, children: [jsxs("p", { className: "flex items-center gap-2 truncate", children: [jsxs("svg", { fill: "currentColor", viewBox: "0 0 24 24", className: "size-3.5", children: [jsx("title", { children: "GitHub" }), jsx("path", { d: "M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12" })] }), owner, "/", repo] }), jsxs("p", { className: "flex text-xs items-center gap-1 text-fd-muted-foreground", children: [jsx(ExternalLinkIcon, { className: "size-3" }), "GitHub"] })] }));
|
|
14
14
|
}
|
|
15
15
|
// Success state component
|
|
16
16
|
function GitHubInfoSuccess({ owner, repo, stars, className }) {
|
|
17
17
|
const humanizedStars = humanizeNumber(stars);
|
|
18
|
-
return (jsxs("a", { href: `https://github.com/${owner}/${repo}`, rel: "noreferrer noopener", target: "_blank", className: `flex flex-col gap-1.5 p-2 rounded-lg text-sm text-fd-foreground/80 transition-colors lg:flex-row lg:items-center hover:text-fd-accent-foreground hover:bg-fd-accent ${className}`, children: [jsxs("p", { className: "flex items-center gap-2 truncate", children: [jsxs("svg", { fill: "currentColor", viewBox: "0 0 24 24", className: "size-3.5", children: [jsx("title", { children: "GitHub" }), jsx("path", { d: "M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12" })] }), owner, "/", repo] }), jsxs("p", { className: "flex text-xs items-center gap-1 text-fd-muted-foreground", children: [jsx(
|
|
18
|
+
return (jsxs("a", { href: `https://github.com/${owner}/${repo}`, rel: "noreferrer noopener", target: "_blank", className: `flex flex-col gap-1.5 p-2 rounded-lg text-sm text-fd-foreground/80 transition-colors lg:flex-row lg:items-center hover:text-fd-accent-foreground hover:bg-fd-accent ${className}`, children: [jsxs("p", { className: "flex items-center gap-2 truncate", children: [jsxs("svg", { fill: "currentColor", viewBox: "0 0 24 24", className: "size-3.5", children: [jsx("title", { children: "GitHub" }), jsx("path", { d: "M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12" })] }), owner, "/", repo] }), jsxs("p", { className: "flex text-xs items-center gap-1 text-fd-muted-foreground", children: [jsx(StarIcon, { className: "size-3" }), humanizedStars] })] }));
|
|
19
19
|
}
|
|
20
20
|
/**
|
|
21
21
|
* Humanize number display
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
var tslib = require('tslib');
|
|
5
5
|
var jsxRuntime = require('react/jsx-runtime');
|
|
6
6
|
var utils = require('@windrun-huaiin/lib/utils');
|
|
7
|
-
var
|
|
7
|
+
var icons = require('@windrun-huaiin/base-ui/icons');
|
|
8
8
|
var lib = require('@windrun-huaiin/base-ui/lib');
|
|
9
9
|
var Link = require('next/link');
|
|
10
10
|
var React = require('react');
|
|
@@ -54,7 +54,7 @@ function GradientButton({ title, icon, iconForcePosition, align = 'left', disabl
|
|
|
54
54
|
const iconProvided = icon !== undefined;
|
|
55
55
|
const iconNode = (() => {
|
|
56
56
|
if (isLoading) {
|
|
57
|
-
return jsxRuntime.jsx(
|
|
57
|
+
return jsxRuntime.jsx(icons.Loader2Icon, { className: utils.cn(finalIconClass, 'animate-spin') });
|
|
58
58
|
}
|
|
59
59
|
if (iconProvided) {
|
|
60
60
|
if (icon === null || icon === false) {
|
|
@@ -67,7 +67,7 @@ function GradientButton({ title, icon, iconForcePosition, align = 'left', disabl
|
|
|
67
67
|
}
|
|
68
68
|
return icon;
|
|
69
69
|
}
|
|
70
|
-
return jsxRuntime.jsx(
|
|
70
|
+
return jsxRuntime.jsx(icons.ArrowRightIcon, { className: utils.cn(finalIconClass) });
|
|
71
71
|
})();
|
|
72
72
|
const shouldRenderIcon = iconNode !== null && iconNode !== undefined;
|
|
73
73
|
const iconPosition = iconForcePosition !== null && iconForcePosition !== void 0 ? iconForcePosition : (onClick ? 'left' : 'right');
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { __awaiter } from 'tslib';
|
|
3
3
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
4
4
|
import { cn } from '@windrun-huaiin/lib/utils';
|
|
5
|
-
import {
|
|
5
|
+
import { Loader2Icon, ArrowRightIcon } from '@windrun-huaiin/base-ui/icons';
|
|
6
6
|
import { themeIconColor, themeBgColor, themeBorderColor, themeMainBgColor, themeButtonGradientClass, themeButtonGradientHoverClass } from '@windrun-huaiin/base-ui/lib';
|
|
7
7
|
import Link from 'next/link';
|
|
8
8
|
import React__default, { useState } from 'react';
|
|
@@ -52,7 +52,7 @@ function GradientButton({ title, icon, iconForcePosition, align = 'left', disabl
|
|
|
52
52
|
const iconProvided = icon !== undefined;
|
|
53
53
|
const iconNode = (() => {
|
|
54
54
|
if (isLoading) {
|
|
55
|
-
return jsx(
|
|
55
|
+
return jsx(Loader2Icon, { className: cn(finalIconClass, 'animate-spin') });
|
|
56
56
|
}
|
|
57
57
|
if (iconProvided) {
|
|
58
58
|
if (icon === null || icon === false) {
|
|
@@ -65,7 +65,7 @@ function GradientButton({ title, icon, iconForcePosition, align = 'left', disabl
|
|
|
65
65
|
}
|
|
66
66
|
return icon;
|
|
67
67
|
}
|
|
68
|
-
return jsx(
|
|
68
|
+
return jsx(ArrowRightIcon, { className: cn(finalIconClass) });
|
|
69
69
|
})();
|
|
70
70
|
const shouldRenderIcon = iconNode !== null && iconNode !== undefined;
|
|
71
71
|
const iconPosition = iconForcePosition !== null && iconForcePosition !== void 0 ? iconForcePosition : (onClick ? 'left' : 'right');
|
package/dist/fuma/mdx/index.d.ts
CHANGED
package/dist/fuma/mdx/index.js
CHANGED
|
@@ -14,6 +14,7 @@ var tocFooterWrapper = require('./toc-footer-wrapper.js');
|
|
|
14
14
|
var tocClerkPortable = require('./toc-clerk-portable.js');
|
|
15
15
|
var banner = require('./banner.js');
|
|
16
16
|
var sunoEmbed = require('./suno-embed.js');
|
|
17
|
+
var markdownComponentMap = require('./markdown-component-map.js');
|
|
17
18
|
|
|
18
19
|
|
|
19
20
|
|
|
@@ -36,3 +37,4 @@ exports.PortableClerkTOCPopover = tocClerkPortable.PortableClerkTOCPopover;
|
|
|
36
37
|
exports.PortableClerkTOCScrollArea = tocClerkPortable.PortableClerkTOCScrollArea;
|
|
37
38
|
exports.Banner = banner.Banner;
|
|
38
39
|
exports.SunoEmbed = sunoEmbed.SunoEmbed;
|
|
40
|
+
exports.baseMarkdownComponents = markdownComponentMap.baseMarkdownComponents;
|
package/dist/fuma/mdx/index.mjs
CHANGED
|
@@ -12,3 +12,4 @@ export { TocFooterWrapper } from './toc-footer-wrapper.mjs';
|
|
|
12
12
|
export { PortableClerkTOC, PortableClerkTOCItems, PortableClerkTOCPopover, PortableClerkTOCScrollArea } from './toc-clerk-portable.mjs';
|
|
13
13
|
export { Banner } from './banner.mjs';
|
|
14
14
|
export { SunoEmbed } from './suno-embed.mjs';
|
|
15
|
+
export { baseMarkdownComponents } from './markdown-component-map.mjs';
|
|
@@ -0,0 +1,73 @@
|
|
|
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('./image-zoom.js');
|
|
8
|
+
|
|
9
|
+
function normalizeMarkdownProps(props) {
|
|
10
|
+
const { class: legacyClassName, className } = props, restProps = tslib.__rest(props, ["class", "className"]);
|
|
11
|
+
return Object.assign(Object.assign({}, restProps), { className: utils.cn(typeof legacyClassName === 'string' ? legacyClassName : undefined, className) });
|
|
12
|
+
}
|
|
13
|
+
const baseMarkdownComponents = Object.assign(Object.assign({}, defaultMdxComponents), { a: (_a) => {
|
|
14
|
+
var _b, _c;
|
|
15
|
+
var { className } = _a, props = tslib.__rest(_a, ["className"]);
|
|
16
|
+
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' })));
|
|
17
|
+
}, blockquote: (_a) => {
|
|
18
|
+
var { className } = _a, props = tslib.__rest(_a, ["className"]);
|
|
19
|
+
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) })));
|
|
20
|
+
}, code: (_a) => {
|
|
21
|
+
var { className } = _a, props = tslib.__rest(_a, ["className"]);
|
|
22
|
+
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) })));
|
|
23
|
+
}, h1: (_a) => {
|
|
24
|
+
var { className } = _a, props = tslib.__rest(_a, ["className"]);
|
|
25
|
+
return (jsxRuntime.jsx("h1", Object.assign({}, normalizeMarkdownProps(props), { className: utils.cn('text-2xl font-semibold tracking-tight', normalizeMarkdownProps(props).className, className) })));
|
|
26
|
+
}, h2: (_a) => {
|
|
27
|
+
var { className } = _a, props = tslib.__rest(_a, ["className"]);
|
|
28
|
+
return (jsxRuntime.jsx("h2", Object.assign({}, normalizeMarkdownProps(props), { className: utils.cn('text-xl font-semibold tracking-tight', normalizeMarkdownProps(props).className, className) })));
|
|
29
|
+
}, h3: (_a) => {
|
|
30
|
+
var { className } = _a, props = tslib.__rest(_a, ["className"]);
|
|
31
|
+
return (jsxRuntime.jsx("h3", Object.assign({}, normalizeMarkdownProps(props), { className: utils.cn('text-lg font-semibold', normalizeMarkdownProps(props).className, className) })));
|
|
32
|
+
}, h4: (_a) => {
|
|
33
|
+
var { className } = _a, props = tslib.__rest(_a, ["className"]);
|
|
34
|
+
return (jsxRuntime.jsx("h4", Object.assign({}, normalizeMarkdownProps(props), { className: utils.cn('text-base font-semibold', normalizeMarkdownProps(props).className, className) })));
|
|
35
|
+
}, h5: (_a) => {
|
|
36
|
+
var { className } = _a, props = tslib.__rest(_a, ["className"]);
|
|
37
|
+
return (jsxRuntime.jsx("h5", Object.assign({}, normalizeMarkdownProps(props), { className: utils.cn('text-sm font-semibold', normalizeMarkdownProps(props).className, className) })));
|
|
38
|
+
}, h6: (_a) => {
|
|
39
|
+
var { className } = _a, props = tslib.__rest(_a, ["className"]);
|
|
40
|
+
return (jsxRuntime.jsx("h6", Object.assign({}, normalizeMarkdownProps(props), { className: utils.cn('text-sm font-semibold', normalizeMarkdownProps(props).className, className) })));
|
|
41
|
+
}, hr: (_a) => {
|
|
42
|
+
var { className } = _a, props = tslib.__rest(_a, ["className"]);
|
|
43
|
+
return (jsxRuntime.jsx("hr", Object.assign({}, normalizeMarkdownProps(props), { className: utils.cn('border-border', normalizeMarkdownProps(props).className, className) })));
|
|
44
|
+
}, img: (_a) => {
|
|
45
|
+
var { className, alt, src } = _a, props = tslib.__rest(_a, ["className", "alt", "src"]);
|
|
46
|
+
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) })));
|
|
47
|
+
}, li: (_a) => {
|
|
48
|
+
var { className } = _a, props = tslib.__rest(_a, ["className"]);
|
|
49
|
+
return (jsxRuntime.jsx("li", Object.assign({}, normalizeMarkdownProps(props), { className: utils.cn('leading-7', normalizeMarkdownProps(props).className, className) })));
|
|
50
|
+
}, ol: (_a) => {
|
|
51
|
+
var { className } = _a, props = tslib.__rest(_a, ["className"]);
|
|
52
|
+
return (jsxRuntime.jsx("ol", Object.assign({}, normalizeMarkdownProps(props), { className: utils.cn('list-decimal space-y-2 pl-6', normalizeMarkdownProps(props).className, className) })));
|
|
53
|
+
}, p: (_a) => {
|
|
54
|
+
var { className } = _a, props = tslib.__rest(_a, ["className"]);
|
|
55
|
+
return (jsxRuntime.jsx("p", Object.assign({}, normalizeMarkdownProps(props), { className: utils.cn('leading-7', normalizeMarkdownProps(props).className, className) })));
|
|
56
|
+
}, pre: (_a) => {
|
|
57
|
+
var { className } = _a, props = tslib.__rest(_a, ["className"]);
|
|
58
|
+
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) })));
|
|
59
|
+
}, table: (_a) => {
|
|
60
|
+
var { className } = _a, props = tslib.__rest(_a, ["className"]);
|
|
61
|
+
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) })) }));
|
|
62
|
+
}, td: (_a) => {
|
|
63
|
+
var { className } = _a, props = tslib.__rest(_a, ["className"]);
|
|
64
|
+
return (jsxRuntime.jsx("td", Object.assign({}, normalizeMarkdownProps(props), { className: utils.cn('border border-border px-3 py-2 align-top', normalizeMarkdownProps(props).className, className) })));
|
|
65
|
+
}, th: (_a) => {
|
|
66
|
+
var { className } = _a, props = tslib.__rest(_a, ["className"]);
|
|
67
|
+
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) })));
|
|
68
|
+
}, ul: (_a) => {
|
|
69
|
+
var { className } = _a, props = tslib.__rest(_a, ["className"]);
|
|
70
|
+
return (jsxRuntime.jsx("ul", Object.assign({}, normalizeMarkdownProps(props), { className: utils.cn('list-disc space-y-2 pl-6', normalizeMarkdownProps(props).className, className) })));
|
|
71
|
+
} });
|
|
72
|
+
|
|
73
|
+
exports.baseMarkdownComponents = baseMarkdownComponents;
|
|
@@ -0,0 +1,71 @@
|
|
|
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 './image-zoom.mjs';
|
|
6
|
+
|
|
7
|
+
function normalizeMarkdownProps(props) {
|
|
8
|
+
const { class: legacyClassName, className } = props, restProps = __rest(props, ["class", "className"]);
|
|
9
|
+
return Object.assign(Object.assign({}, restProps), { className: cn(typeof legacyClassName === 'string' ? legacyClassName : undefined, className) });
|
|
10
|
+
}
|
|
11
|
+
const baseMarkdownComponents = Object.assign(Object.assign({}, defaultMdxComponents), { a: (_a) => {
|
|
12
|
+
var _b, _c;
|
|
13
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
14
|
+
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' })));
|
|
15
|
+
}, blockquote: (_a) => {
|
|
16
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
17
|
+
return (jsx("blockquote", Object.assign({}, normalizeMarkdownProps(props), { className: cn('border-l-2 border-border pl-4 text-muted-foreground', normalizeMarkdownProps(props).className, className) })));
|
|
18
|
+
}, code: (_a) => {
|
|
19
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
20
|
+
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) })));
|
|
21
|
+
}, h1: (_a) => {
|
|
22
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
23
|
+
return (jsx("h1", Object.assign({}, normalizeMarkdownProps(props), { className: cn('text-2xl font-semibold tracking-tight', normalizeMarkdownProps(props).className, className) })));
|
|
24
|
+
}, h2: (_a) => {
|
|
25
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
26
|
+
return (jsx("h2", Object.assign({}, normalizeMarkdownProps(props), { className: cn('text-xl font-semibold tracking-tight', normalizeMarkdownProps(props).className, className) })));
|
|
27
|
+
}, h3: (_a) => {
|
|
28
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
29
|
+
return (jsx("h3", Object.assign({}, normalizeMarkdownProps(props), { className: cn('text-lg font-semibold', normalizeMarkdownProps(props).className, className) })));
|
|
30
|
+
}, h4: (_a) => {
|
|
31
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
32
|
+
return (jsx("h4", Object.assign({}, normalizeMarkdownProps(props), { className: cn('text-base font-semibold', normalizeMarkdownProps(props).className, className) })));
|
|
33
|
+
}, h5: (_a) => {
|
|
34
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
35
|
+
return (jsx("h5", Object.assign({}, normalizeMarkdownProps(props), { className: cn('text-sm font-semibold', normalizeMarkdownProps(props).className, className) })));
|
|
36
|
+
}, h6: (_a) => {
|
|
37
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
38
|
+
return (jsx("h6", Object.assign({}, normalizeMarkdownProps(props), { className: cn('text-sm font-semibold', normalizeMarkdownProps(props).className, className) })));
|
|
39
|
+
}, hr: (_a) => {
|
|
40
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
41
|
+
return (jsx("hr", Object.assign({}, normalizeMarkdownProps(props), { className: cn('border-border', normalizeMarkdownProps(props).className, className) })));
|
|
42
|
+
}, img: (_a) => {
|
|
43
|
+
var { className, alt, src } = _a, props = __rest(_a, ["className", "alt", "src"]);
|
|
44
|
+
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) })));
|
|
45
|
+
}, li: (_a) => {
|
|
46
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
47
|
+
return (jsx("li", Object.assign({}, normalizeMarkdownProps(props), { className: cn('leading-7', normalizeMarkdownProps(props).className, className) })));
|
|
48
|
+
}, ol: (_a) => {
|
|
49
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
50
|
+
return (jsx("ol", Object.assign({}, normalizeMarkdownProps(props), { className: cn('list-decimal space-y-2 pl-6', normalizeMarkdownProps(props).className, className) })));
|
|
51
|
+
}, p: (_a) => {
|
|
52
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
53
|
+
return (jsx("p", Object.assign({}, normalizeMarkdownProps(props), { className: cn('leading-7', normalizeMarkdownProps(props).className, className) })));
|
|
54
|
+
}, pre: (_a) => {
|
|
55
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
56
|
+
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) })));
|
|
57
|
+
}, table: (_a) => {
|
|
58
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
59
|
+
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) })) }));
|
|
60
|
+
}, td: (_a) => {
|
|
61
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
62
|
+
return (jsx("td", Object.assign({}, normalizeMarkdownProps(props), { className: cn('border border-border px-3 py-2 align-top', normalizeMarkdownProps(props).className, className) })));
|
|
63
|
+
}, th: (_a) => {
|
|
64
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
65
|
+
return (jsx("th", Object.assign({}, normalizeMarkdownProps(props), { className: cn('border border-border px-3 py-2 text-left font-medium', normalizeMarkdownProps(props).className, className) })));
|
|
66
|
+
}, ul: (_a) => {
|
|
67
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
68
|
+
return (jsx("ul", Object.assign({}, normalizeMarkdownProps(props), { className: cn('list-disc space-y-2 pl-6', normalizeMarkdownProps(props).className, className) })));
|
|
69
|
+
} });
|
|
70
|
+
|
|
71
|
+
export { baseMarkdownComponents };
|
|
@@ -3,10 +3,11 @@ interface MermaidProps {
|
|
|
3
3
|
title?: string;
|
|
4
4
|
watermarkEnabled?: boolean;
|
|
5
5
|
watermarkText?: string;
|
|
6
|
+
handDrawn?: boolean;
|
|
6
7
|
/**
|
|
7
8
|
* enable preview dialog by clicking the chart, default is true
|
|
8
9
|
*/
|
|
9
10
|
enablePreview?: boolean;
|
|
10
11
|
}
|
|
11
|
-
export declare function Mermaid({ chart, title, watermarkEnabled, watermarkText, enablePreview }: MermaidProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export declare function Mermaid({ chart, title, watermarkEnabled, watermarkText, handDrawn, enablePreview }: MermaidProps): import("react/jsx-runtime").JSX.Element;
|
|
12
13
|
export {};
|