@windrun-huaiin/third-ui 29.0.0 → 29.0.1
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/fuma/server/site-mdx-base.js +11 -1
- package/dist/fuma/server/site-mdx-base.mjs +11 -1
- package/dist/fuma/server/site-mdx-fallbacks.js +1 -1
- package/dist/fuma/server/site-mdx-fallbacks.mjs +1 -1
- package/dist/main/money-price/money-price-button.js +1 -1
- package/dist/main/money-price/money-price-button.mjs +1 -1
- package/package.json +1 -1
- package/src/fuma/server/site-mdx-base.tsx +19 -2
- package/src/fuma/server/site-mdx-fallbacks.tsx +1 -1
- package/src/main/money-price/money-price-button.tsx +1 -1
- package/dist/fuma/base/site-layout.js +0 -72
- package/dist/fuma/base/site-layout.mjs +0 -65
- package/dist/fuma/mdx/gradient-button.d.ts +0 -20
- package/dist/fuma/mdx/gradient-button.js +0 -96
- package/dist/fuma/mdx/gradient-button.mjs +0 -94
- package/dist/lib/site-docs-helper.d.ts +0 -51
- package/dist/lib/site-docs-helper.js +0 -68
- package/dist/lib/site-docs-helper.mjs +0 -66
- package/dist/main/ai-prompt-textarea.d.ts +0 -72
- package/dist/main/ai-prompt-textarea.js +0 -114
- package/dist/main/ai-prompt-textarea.mjs +0 -112
- package/dist/main/x-button.d.ts +0 -39
- package/dist/main/x-button.js +0 -102
- package/dist/main/x-button.mjs +0 -100
- package/dist/main/x-toggle-button.d.ts +0 -32
- package/dist/main/x-toggle-button.js +0 -95
- package/dist/main/x-toggle-button.mjs +0 -74
|
@@ -22,13 +22,23 @@ const defaultFumaUiComponents = {
|
|
|
22
22
|
Tab: tabs.Tab,
|
|
23
23
|
Tabs: tabs.Tabs,
|
|
24
24
|
};
|
|
25
|
+
function withIconComponentAliases(components) {
|
|
26
|
+
return Object.assign(Object.assign({}, components), Object.fromEntries(Object.entries(components).flatMap(([name, component]) => {
|
|
27
|
+
if (!/^[A-Z]/.test(name))
|
|
28
|
+
return [];
|
|
29
|
+
if (name.endsWith('Icon')) {
|
|
30
|
+
return [[name.slice(0, -4), component]];
|
|
31
|
+
}
|
|
32
|
+
return [[`${name}Icon`, component]];
|
|
33
|
+
})));
|
|
34
|
+
}
|
|
25
35
|
function createSiteMdxBaseComponents(options = {}) {
|
|
26
36
|
return Object.assign(Object.assign(Object.assign(Object.assign({}, defaultFumaUiComponents), { SiteX: siteX.SiteX }), base.createBaseMdxComponents(options.imageFallbackSrc)), widgets.createWidgetMdxComponents(options.cdnBaseUrl, options.imageFallbackSrc));
|
|
27
37
|
}
|
|
28
38
|
function createSiteMdxComponents(options = {}) {
|
|
29
39
|
const { additionalComponents, baseOptions, features = [], } = options;
|
|
30
40
|
return function getMDXComponents(components) {
|
|
31
|
-
return siteMdxFallbacks.withMissingMdxComponentFallback(Object.assign(Object.assign(Object.assign(Object.assign({}, createSiteMdxBaseComponents(baseOptions)), features.reduce((acc, feature) => (Object.assign(Object.assign({}, acc), feature)), {})), additionalComponents), components));
|
|
41
|
+
return siteMdxFallbacks.withMissingMdxComponentFallback(withIconComponentAliases(Object.assign(Object.assign(Object.assign(Object.assign({}, createSiteMdxBaseComponents(baseOptions)), features.reduce((acc, feature) => (Object.assign(Object.assign({}, acc), feature)), {})), additionalComponents), components)));
|
|
32
42
|
};
|
|
33
43
|
}
|
|
34
44
|
|
|
@@ -20,13 +20,23 @@ const defaultFumaUiComponents = {
|
|
|
20
20
|
Tab,
|
|
21
21
|
Tabs,
|
|
22
22
|
};
|
|
23
|
+
function withIconComponentAliases(components) {
|
|
24
|
+
return Object.assign(Object.assign({}, components), Object.fromEntries(Object.entries(components).flatMap(([name, component]) => {
|
|
25
|
+
if (!/^[A-Z]/.test(name))
|
|
26
|
+
return [];
|
|
27
|
+
if (name.endsWith('Icon')) {
|
|
28
|
+
return [[name.slice(0, -4), component]];
|
|
29
|
+
}
|
|
30
|
+
return [[`${name}Icon`, component]];
|
|
31
|
+
})));
|
|
32
|
+
}
|
|
23
33
|
function createSiteMdxBaseComponents(options = {}) {
|
|
24
34
|
return Object.assign(Object.assign(Object.assign(Object.assign({}, defaultFumaUiComponents), { SiteX }), createBaseMdxComponents(options.imageFallbackSrc)), createWidgetMdxComponents(options.cdnBaseUrl, options.imageFallbackSrc));
|
|
25
35
|
}
|
|
26
36
|
function createSiteMdxComponents(options = {}) {
|
|
27
37
|
const { additionalComponents, baseOptions, features = [], } = options;
|
|
28
38
|
return function getMDXComponents(components) {
|
|
29
|
-
return withMissingMdxComponentFallback(Object.assign(Object.assign(Object.assign(Object.assign({}, createSiteMdxBaseComponents(baseOptions)), features.reduce((acc, feature) => (Object.assign(Object.assign({}, acc), feature)), {})), additionalComponents), components));
|
|
39
|
+
return withMissingMdxComponentFallback(withIconComponentAliases(Object.assign(Object.assign(Object.assign(Object.assign({}, createSiteMdxBaseComponents(baseOptions)), features.reduce((acc, feature) => (Object.assign(Object.assign({}, acc), feature)), {})), additionalComponents), components)));
|
|
30
40
|
};
|
|
31
41
|
}
|
|
32
42
|
|
|
@@ -25,7 +25,7 @@ function MissingMdxFeatureBlock(_a) {
|
|
|
25
25
|
return (jsxRuntime.jsxs("div", { className: [
|
|
26
26
|
'my-4 rounded-xl border border-red-300 bg-red-50/80 p-4 text-sm text-red-950 shadow-sm dark:border-red-800/80 dark:bg-red-950/30 dark:text-red-100',
|
|
27
27
|
className,
|
|
28
|
-
].filter(Boolean).join(' '), children: [jsxRuntime.jsxs("div", { className: "mb-2 flex flex-wrap items-center gap-2 font-medium", children: [jsxRuntime.jsx("span", { children: "MDX feature not enabled" }), jsxRuntime.jsx("code", { className: "rounded bg-red-100 px-1.5 py-0.5 text-xs dark:bg-red-900/60", children: feature }), jsxRuntime.jsx("code", { className: "rounded bg-red-100 px-1.5 py-0.5 text-xs dark:bg-red-900/60", children: component })] }), displayProps.length > 0 && (jsxRuntime.jsx("div", { className: "mb-2 flex flex-wrap gap-1.5 text-xs", children: displayProps.map(([key, value]) => (jsxRuntime.jsxs("span", { className: "rounded-md border border-red-200 bg-white/60 px-1.5 py-0.5 font-mono dark:border-red-900/70 dark:bg-black/20", children: [key, "=", value] }, key))) })), jsxRuntime.jsx("div", { className: "whitespace-pre-wrap break-
|
|
28
|
+
].filter(Boolean).join(' '), children: [jsxRuntime.jsxs("div", { className: "mb-2 flex flex-wrap items-center gap-2 font-medium", children: [jsxRuntime.jsx("span", { children: "MDX feature not enabled" }), jsxRuntime.jsx("code", { className: "rounded bg-red-100 px-1.5 py-0.5 text-xs dark:bg-red-900/60", children: feature }), jsxRuntime.jsx("code", { className: "rounded bg-red-100 px-1.5 py-0.5 text-xs dark:bg-red-900/60", children: component })] }), displayProps.length > 0 && (jsxRuntime.jsx("div", { className: "mb-2 flex flex-wrap gap-1.5 text-xs", children: displayProps.map(([key, value]) => (jsxRuntime.jsxs("span", { className: "rounded-md border border-red-200 bg-white/60 px-1.5 py-0.5 font-mono dark:border-red-900/70 dark:bg-black/20", children: [key, "=", value] }, key))) })), jsxRuntime.jsx("div", { className: "whitespace-pre-wrap wrap-break-word rounded-lg border border-red-200 bg-white/70 p-3 font-mono text-xs text-red-900 dark:border-red-900/70 dark:bg-black/20 dark:text-red-100", children: renderChildren(children) })] }));
|
|
29
29
|
}
|
|
30
30
|
function MissingMdxFeatureInline(_a) {
|
|
31
31
|
var { feature, component, children, className } = _a, props = tslib.__rest(_a, ["feature", "component", "children", "className"]);
|
|
@@ -23,7 +23,7 @@ function MissingMdxFeatureBlock(_a) {
|
|
|
23
23
|
return (jsxs("div", { className: [
|
|
24
24
|
'my-4 rounded-xl border border-red-300 bg-red-50/80 p-4 text-sm text-red-950 shadow-sm dark:border-red-800/80 dark:bg-red-950/30 dark:text-red-100',
|
|
25
25
|
className,
|
|
26
|
-
].filter(Boolean).join(' '), children: [jsxs("div", { className: "mb-2 flex flex-wrap items-center gap-2 font-medium", children: [jsx("span", { children: "MDX feature not enabled" }), jsx("code", { className: "rounded bg-red-100 px-1.5 py-0.5 text-xs dark:bg-red-900/60", children: feature }), jsx("code", { className: "rounded bg-red-100 px-1.5 py-0.5 text-xs dark:bg-red-900/60", children: component })] }), displayProps.length > 0 && (jsx("div", { className: "mb-2 flex flex-wrap gap-1.5 text-xs", children: displayProps.map(([key, value]) => (jsxs("span", { className: "rounded-md border border-red-200 bg-white/60 px-1.5 py-0.5 font-mono dark:border-red-900/70 dark:bg-black/20", children: [key, "=", value] }, key))) })), jsx("div", { className: "whitespace-pre-wrap break-
|
|
26
|
+
].filter(Boolean).join(' '), children: [jsxs("div", { className: "mb-2 flex flex-wrap items-center gap-2 font-medium", children: [jsx("span", { children: "MDX feature not enabled" }), jsx("code", { className: "rounded bg-red-100 px-1.5 py-0.5 text-xs dark:bg-red-900/60", children: feature }), jsx("code", { className: "rounded bg-red-100 px-1.5 py-0.5 text-xs dark:bg-red-900/60", children: component })] }), displayProps.length > 0 && (jsx("div", { className: "mb-2 flex flex-wrap gap-1.5 text-xs", children: displayProps.map(([key, value]) => (jsxs("span", { className: "rounded-md border border-red-200 bg-white/60 px-1.5 py-0.5 font-mono dark:border-red-900/70 dark:bg-black/20", children: [key, "=", value] }, key))) })), jsx("div", { className: "whitespace-pre-wrap wrap-break-word rounded-lg border border-red-200 bg-white/70 p-3 font-mono text-xs text-red-900 dark:border-red-900/70 dark:bg-black/20 dark:text-red-100", children: renderChildren(children) })] }));
|
|
27
27
|
}
|
|
28
28
|
function MissingMdxFeatureInline(_a) {
|
|
29
29
|
var { feature, component, children, className } = _a, props = __rest(_a, ["feature", "component", "children", "className"]);
|
|
@@ -11,7 +11,7 @@ var React = require('react');
|
|
|
11
11
|
function MoneyPriceButton({ planKey, userContext, billingType, onAuth, onAction, texts, isProcessing = false, isAnyProcessing = false, isInitLoading = false, enableSubscriptionUpgrade = true }) {
|
|
12
12
|
const [isLoading, setIsLoading] = React.useState(false);
|
|
13
13
|
if (isInitLoading) {
|
|
14
|
-
return (jsxRuntime.jsx("div", { className: "relative w-full h-11 md:h-12 mt-4 md:mt-auto overflow-hidden rounded-full bg-gray-100/70 dark:bg-gray-800/40 animate-pulse transition-opacity duration-300 ease-out", "aria-hidden": "true", "data-plan-button-placeholder": planKey, children: jsxRuntime.jsx("div", { className: "absolute inset-0 bg-
|
|
14
|
+
return (jsxRuntime.jsx("div", { className: "relative w-full h-11 md:h-12 mt-4 md:mt-auto overflow-hidden rounded-full bg-gray-100/70 dark:bg-gray-800/40 animate-pulse transition-opacity duration-300 ease-out", "aria-hidden": "true", "data-plan-button-placeholder": planKey, children: jsxRuntime.jsx("div", { className: "absolute inset-0 bg-linear-to-r from-transparent via-white/50 to-transparent dark:via-white/10" }) }));
|
|
15
15
|
}
|
|
16
16
|
const { isAuthenticated, subscriptionStatus } = userContext;
|
|
17
17
|
const subscriptionBilling = userContext.subscriptionType;
|
|
@@ -9,7 +9,7 @@ import { useState } from 'react';
|
|
|
9
9
|
function MoneyPriceButton({ planKey, userContext, billingType, onAuth, onAction, texts, isProcessing = false, isAnyProcessing = false, isInitLoading = false, enableSubscriptionUpgrade = true }) {
|
|
10
10
|
const [isLoading, setIsLoading] = useState(false);
|
|
11
11
|
if (isInitLoading) {
|
|
12
|
-
return (jsx("div", { className: "relative w-full h-11 md:h-12 mt-4 md:mt-auto overflow-hidden rounded-full bg-gray-100/70 dark:bg-gray-800/40 animate-pulse transition-opacity duration-300 ease-out", "aria-hidden": "true", "data-plan-button-placeholder": planKey, children: jsx("div", { className: "absolute inset-0 bg-
|
|
12
|
+
return (jsx("div", { className: "relative w-full h-11 md:h-12 mt-4 md:mt-auto overflow-hidden rounded-full bg-gray-100/70 dark:bg-gray-800/40 animate-pulse transition-opacity duration-300 ease-out", "aria-hidden": "true", "data-plan-button-placeholder": planKey, children: jsx("div", { className: "absolute inset-0 bg-linear-to-r from-transparent via-white/50 to-transparent dark:via-white/10" }) }));
|
|
13
13
|
}
|
|
14
14
|
const { isAuthenticated, subscriptionStatus } = userContext;
|
|
15
15
|
const subscriptionBilling = userContext.subscriptionType;
|
package/package.json
CHANGED
|
@@ -35,6 +35,23 @@ const defaultFumaUiComponents: MDXComponents = {
|
|
|
35
35
|
Tabs,
|
|
36
36
|
};
|
|
37
37
|
|
|
38
|
+
function withIconComponentAliases(components: MDXComponents): MDXComponents {
|
|
39
|
+
return {
|
|
40
|
+
...components,
|
|
41
|
+
...Object.fromEntries(
|
|
42
|
+
Object.entries(components).flatMap(([name, component]) => {
|
|
43
|
+
if (!/^[A-Z]/.test(name)) return [];
|
|
44
|
+
|
|
45
|
+
if (name.endsWith('Icon')) {
|
|
46
|
+
return [[name.slice(0, -4), component] as const];
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
return [[`${name}Icon`, component] as const];
|
|
50
|
+
}),
|
|
51
|
+
),
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
|
|
38
55
|
export function createSiteMdxBaseComponents(
|
|
39
56
|
options: SiteMdxBaseOptions = {},
|
|
40
57
|
): MDXComponents {
|
|
@@ -56,11 +73,11 @@ export function createSiteMdxComponents(
|
|
|
56
73
|
} = options;
|
|
57
74
|
|
|
58
75
|
return function getMDXComponents(components?: MDXComponents): MDXComponents {
|
|
59
|
-
return withMissingMdxComponentFallback({
|
|
76
|
+
return withMissingMdxComponentFallback(withIconComponentAliases({
|
|
60
77
|
...createSiteMdxBaseComponents(baseOptions),
|
|
61
78
|
...features.reduce<MDXComponents>((acc, feature) => ({ ...acc, ...feature }), {}),
|
|
62
79
|
...additionalComponents,
|
|
63
80
|
...components,
|
|
64
|
-
});
|
|
81
|
+
}));
|
|
65
82
|
};
|
|
66
83
|
}
|
|
@@ -68,7 +68,7 @@ export function MissingMdxFeatureBlock({
|
|
|
68
68
|
))}
|
|
69
69
|
</div>
|
|
70
70
|
)}
|
|
71
|
-
<div className="whitespace-pre-wrap break-
|
|
71
|
+
<div className="whitespace-pre-wrap wrap-break-word rounded-lg border border-red-200 bg-white/70 p-3 font-mono text-xs text-red-900 dark:border-red-900/70 dark:bg-black/20 dark:text-red-100">
|
|
72
72
|
{renderChildren(children)}
|
|
73
73
|
</div>
|
|
74
74
|
</div>
|
|
@@ -27,7 +27,7 @@ export function MoneyPriceButton({
|
|
|
27
27
|
aria-hidden="true"
|
|
28
28
|
data-plan-button-placeholder={planKey}
|
|
29
29
|
>
|
|
30
|
-
<div className="absolute inset-0 bg-
|
|
30
|
+
<div className="absolute inset-0 bg-linear-to-r from-transparent via-white/50 to-transparent dark:via-white/10" />
|
|
31
31
|
</div>
|
|
32
32
|
);
|
|
33
33
|
}
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var tslib = require('tslib');
|
|
4
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
5
|
-
var next = require('fumadocs-ui/provider/next');
|
|
6
|
-
var docs = require('fumadocs-ui/layouts/docs');
|
|
7
|
-
var customHomeLayout = require('./custom-home-layout.js');
|
|
8
|
-
|
|
9
|
-
function normalizeNavItems(items) {
|
|
10
|
-
if (!items)
|
|
11
|
-
return undefined;
|
|
12
|
-
return items.map((item) => {
|
|
13
|
-
var _a;
|
|
14
|
-
if (item.type === 'menu') {
|
|
15
|
-
return Object.assign(Object.assign({}, item), { items: (_a = normalizeNavItems(item.items)) !== null && _a !== void 0 ? _a : [] });
|
|
16
|
-
}
|
|
17
|
-
return item;
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
function createSiteNavLink(item, context) {
|
|
21
|
-
return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ type: 'main', text: item.text }, (item.description ? { description: item.description } : {})), { url: context.resolveUrl(item.path) }), (item.external ? { external: item.external } : {})), (item.prefetch !== undefined ? { prefetch: item.prefetch } : {})), (item.icon || item.className
|
|
22
|
-
? {
|
|
23
|
-
menu: Object.assign(Object.assign({}, (item.icon ? { banner: item.icon } : {})), (item.className ? { className: item.className } : {})),
|
|
24
|
-
}
|
|
25
|
-
: {}));
|
|
26
|
-
}
|
|
27
|
-
function createSiteNavGroup(item, context, options) {
|
|
28
|
-
var _a;
|
|
29
|
-
return Object.assign(Object.assign(Object.assign({ type: 'menu', text: item.text }, (item.path ? { url: context.resolveUrl(item.path) } : {})), (item.prefetch !== undefined ? { prefetch: item.prefetch } : {})), { items: [
|
|
30
|
-
...(item.landing
|
|
31
|
-
? [
|
|
32
|
-
Object.assign(Object.assign({}, createSiteNavLink(item.landing, context)), { menu: Object.assign(Object.assign({}, ((options === null || options === void 0 ? void 0 : options.featuredBanner) ? { banner: options.featuredBanner } : {})), { className: (_a = options === null || options === void 0 ? void 0 : options.featuredClassName) !== null && _a !== void 0 ? _a : 'md:row-span-2' }) }),
|
|
33
|
-
]
|
|
34
|
-
: []),
|
|
35
|
-
...item.items.map((child) => createSiteNavLink(child, context)),
|
|
36
|
-
] });
|
|
37
|
-
}
|
|
38
|
-
function createSiteBaseLayoutConfig(options) {
|
|
39
|
-
var _a;
|
|
40
|
-
return Object.assign(Object.assign({ nav: {
|
|
41
|
-
url: options.homeUrl,
|
|
42
|
-
title: options.title,
|
|
43
|
-
transparentMode: (_a = options.transparentMode) !== null && _a !== void 0 ? _a : 'none',
|
|
44
|
-
} }, (options.i18n ? { i18n: options.i18n } : {})), (options.githubUrl ? { githubUrl: options.githubUrl } : {}));
|
|
45
|
-
}
|
|
46
|
-
function toHomeLayoutOptions(config) {
|
|
47
|
-
return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, (config.nav ? { nav: config.nav } : {})), (config.i18n ? { i18n: config.i18n } : {})), (config.githubUrl ? { githubUrl: config.githubUrl } : {})), (config.links ? { links: normalizeNavItems(config.links) } : {})), (config.searchToggle ? { searchToggle: config.searchToggle } : {})), (config.themeSwitch ? { themeSwitch: config.themeSwitch } : {}));
|
|
48
|
-
}
|
|
49
|
-
function toDocsLayoutOptions(config) {
|
|
50
|
-
return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, (config.nav ? { nav: config.nav } : {})), (config.i18n ? { i18n: config.i18n } : {})), (config.githubUrl ? { githubUrl: config.githubUrl } : {})), (config.links ? { links: normalizeNavItems(config.links) } : {})), (config.searchToggle ? { searchToggle: config.searchToggle } : {})), (config.themeSwitch ? { themeSwitch: config.themeSwitch } : {})), (config.sidebar ? { sidebar: config.sidebar } : {})), { tree: config.tree });
|
|
51
|
-
}
|
|
52
|
-
function DocsRootProvider({ i18n, children }) {
|
|
53
|
-
return jsxRuntime.jsx(next.RootProvider, { i18n: i18n, children: children });
|
|
54
|
-
}
|
|
55
|
-
function SiteHomeLayout({ locale, config, children, }) {
|
|
56
|
-
const { actionOrders, banner, bannerHeight, defaultLocale, floatingNav, footer, goToTop, headerHeight, headerPaddingTop, localePrefixAsNeeded, navbarClassName, showBanner, showFooter, showGoToTop } = config, baseConfig = tslib.__rest(config, ["actionOrders", "banner", "bannerHeight", "defaultLocale", "floatingNav", "footer", "goToTop", "headerHeight", "headerPaddingTop", "localePrefixAsNeeded", "navbarClassName", "showBanner", "showFooter", "showGoToTop"]);
|
|
57
|
-
const options = toHomeLayoutOptions(baseConfig);
|
|
58
|
-
const layoutProps = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ locale,
|
|
59
|
-
options }, (actionOrders ? { actionOrders } : {})), (banner ? { banner } : {})), (bannerHeight != null ? { bannerHeight } : {})), (defaultLocale ? { defaultLocale } : {})), (floatingNav != null ? { floatingNav } : {})), (footer ? { footer } : {})), (goToTop ? { goToTop } : {})), (headerHeight != null ? { headerHeight } : {})), (headerPaddingTop != null ? { headerPaddingTop } : {})), (localePrefixAsNeeded != null ? { localePrefixAsNeeded } : {})), (navbarClassName ? { navbarClassName } : {})), (showBanner != null ? { showBanner } : {})), (showFooter != null ? { showFooter } : {})), (showGoToTop != null ? { showGoToTop } : {}));
|
|
60
|
-
return jsxRuntime.jsx(customHomeLayout.CustomHomeLayout, Object.assign({}, layoutProps, { children: children }));
|
|
61
|
-
}
|
|
62
|
-
function SiteDocsLayout({ config, children, }) {
|
|
63
|
-
const options = toDocsLayoutOptions(config);
|
|
64
|
-
return jsxRuntime.jsx(docs.DocsLayout, Object.assign({}, options, { children: children }));
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
exports.DocsRootProvider = DocsRootProvider;
|
|
68
|
-
exports.SiteDocsLayout = SiteDocsLayout;
|
|
69
|
-
exports.SiteHomeLayout = SiteHomeLayout;
|
|
70
|
-
exports.createSiteBaseLayoutConfig = createSiteBaseLayoutConfig;
|
|
71
|
-
exports.createSiteNavGroup = createSiteNavGroup;
|
|
72
|
-
exports.createSiteNavLink = createSiteNavLink;
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import { __rest } from 'tslib';
|
|
2
|
-
import { jsx } from 'react/jsx-runtime';
|
|
3
|
-
import { RootProvider } from 'fumadocs-ui/provider/next';
|
|
4
|
-
import { DocsLayout } from 'fumadocs-ui/layouts/docs';
|
|
5
|
-
import { CustomHomeLayout } from './custom-home-layout.mjs';
|
|
6
|
-
|
|
7
|
-
function normalizeNavItems(items) {
|
|
8
|
-
if (!items)
|
|
9
|
-
return undefined;
|
|
10
|
-
return items.map((item) => {
|
|
11
|
-
var _a;
|
|
12
|
-
if (item.type === 'menu') {
|
|
13
|
-
return Object.assign(Object.assign({}, item), { items: (_a = normalizeNavItems(item.items)) !== null && _a !== void 0 ? _a : [] });
|
|
14
|
-
}
|
|
15
|
-
return item;
|
|
16
|
-
});
|
|
17
|
-
}
|
|
18
|
-
function createSiteNavLink(item, context) {
|
|
19
|
-
return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ type: 'main', text: item.text }, (item.description ? { description: item.description } : {})), { url: context.resolveUrl(item.path) }), (item.external ? { external: item.external } : {})), (item.prefetch !== undefined ? { prefetch: item.prefetch } : {})), (item.icon || item.className
|
|
20
|
-
? {
|
|
21
|
-
menu: Object.assign(Object.assign({}, (item.icon ? { banner: item.icon } : {})), (item.className ? { className: item.className } : {})),
|
|
22
|
-
}
|
|
23
|
-
: {}));
|
|
24
|
-
}
|
|
25
|
-
function createSiteNavGroup(item, context, options) {
|
|
26
|
-
var _a;
|
|
27
|
-
return Object.assign(Object.assign(Object.assign({ type: 'menu', text: item.text }, (item.path ? { url: context.resolveUrl(item.path) } : {})), (item.prefetch !== undefined ? { prefetch: item.prefetch } : {})), { items: [
|
|
28
|
-
...(item.landing
|
|
29
|
-
? [
|
|
30
|
-
Object.assign(Object.assign({}, createSiteNavLink(item.landing, context)), { menu: Object.assign(Object.assign({}, ((options === null || options === void 0 ? void 0 : options.featuredBanner) ? { banner: options.featuredBanner } : {})), { className: (_a = options === null || options === void 0 ? void 0 : options.featuredClassName) !== null && _a !== void 0 ? _a : 'md:row-span-2' }) }),
|
|
31
|
-
]
|
|
32
|
-
: []),
|
|
33
|
-
...item.items.map((child) => createSiteNavLink(child, context)),
|
|
34
|
-
] });
|
|
35
|
-
}
|
|
36
|
-
function createSiteBaseLayoutConfig(options) {
|
|
37
|
-
var _a;
|
|
38
|
-
return Object.assign(Object.assign({ nav: {
|
|
39
|
-
url: options.homeUrl,
|
|
40
|
-
title: options.title,
|
|
41
|
-
transparentMode: (_a = options.transparentMode) !== null && _a !== void 0 ? _a : 'none',
|
|
42
|
-
} }, (options.i18n ? { i18n: options.i18n } : {})), (options.githubUrl ? { githubUrl: options.githubUrl } : {}));
|
|
43
|
-
}
|
|
44
|
-
function toHomeLayoutOptions(config) {
|
|
45
|
-
return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, (config.nav ? { nav: config.nav } : {})), (config.i18n ? { i18n: config.i18n } : {})), (config.githubUrl ? { githubUrl: config.githubUrl } : {})), (config.links ? { links: normalizeNavItems(config.links) } : {})), (config.searchToggle ? { searchToggle: config.searchToggle } : {})), (config.themeSwitch ? { themeSwitch: config.themeSwitch } : {}));
|
|
46
|
-
}
|
|
47
|
-
function toDocsLayoutOptions(config) {
|
|
48
|
-
return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, (config.nav ? { nav: config.nav } : {})), (config.i18n ? { i18n: config.i18n } : {})), (config.githubUrl ? { githubUrl: config.githubUrl } : {})), (config.links ? { links: normalizeNavItems(config.links) } : {})), (config.searchToggle ? { searchToggle: config.searchToggle } : {})), (config.themeSwitch ? { themeSwitch: config.themeSwitch } : {})), (config.sidebar ? { sidebar: config.sidebar } : {})), { tree: config.tree });
|
|
49
|
-
}
|
|
50
|
-
function DocsRootProvider({ i18n, children }) {
|
|
51
|
-
return jsx(RootProvider, { i18n: i18n, children: children });
|
|
52
|
-
}
|
|
53
|
-
function SiteHomeLayout({ locale, config, children, }) {
|
|
54
|
-
const { actionOrders, banner, bannerHeight, defaultLocale, floatingNav, footer, goToTop, headerHeight, headerPaddingTop, localePrefixAsNeeded, navbarClassName, showBanner, showFooter, showGoToTop } = config, baseConfig = __rest(config, ["actionOrders", "banner", "bannerHeight", "defaultLocale", "floatingNav", "footer", "goToTop", "headerHeight", "headerPaddingTop", "localePrefixAsNeeded", "navbarClassName", "showBanner", "showFooter", "showGoToTop"]);
|
|
55
|
-
const options = toHomeLayoutOptions(baseConfig);
|
|
56
|
-
const layoutProps = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ locale,
|
|
57
|
-
options }, (actionOrders ? { actionOrders } : {})), (banner ? { banner } : {})), (bannerHeight != null ? { bannerHeight } : {})), (defaultLocale ? { defaultLocale } : {})), (floatingNav != null ? { floatingNav } : {})), (footer ? { footer } : {})), (goToTop ? { goToTop } : {})), (headerHeight != null ? { headerHeight } : {})), (headerPaddingTop != null ? { headerPaddingTop } : {})), (localePrefixAsNeeded != null ? { localePrefixAsNeeded } : {})), (navbarClassName ? { navbarClassName } : {})), (showBanner != null ? { showBanner } : {})), (showFooter != null ? { showFooter } : {})), (showGoToTop != null ? { showGoToTop } : {}));
|
|
58
|
-
return jsx(CustomHomeLayout, Object.assign({}, layoutProps, { children: children }));
|
|
59
|
-
}
|
|
60
|
-
function SiteDocsLayout({ config, children, }) {
|
|
61
|
-
const options = toDocsLayoutOptions(config);
|
|
62
|
-
return jsx(DocsLayout, Object.assign({}, options, { children: children }));
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
export { DocsRootProvider, SiteDocsLayout, SiteHomeLayout, createSiteBaseLayoutConfig, createSiteNavGroup, createSiteNavLink };
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
type GradientButtonVariant = 'default' | 'soft' | 'subtle';
|
|
3
|
-
export interface GradientButtonProps {
|
|
4
|
-
title: React.ReactNode;
|
|
5
|
-
icon?: React.ReactNode;
|
|
6
|
-
iconForcePosition?: 'left' | 'right';
|
|
7
|
-
align?: 'left' | 'center' | 'right';
|
|
8
|
-
disabled?: boolean;
|
|
9
|
-
className?: string;
|
|
10
|
-
iconClassName?: string;
|
|
11
|
-
href?: string;
|
|
12
|
-
openInNewTab?: boolean;
|
|
13
|
-
preserveReferrer?: boolean;
|
|
14
|
-
onClick?: () => void | Promise<void>;
|
|
15
|
-
loadingText?: React.ReactNode;
|
|
16
|
-
preventDoubleClick?: boolean;
|
|
17
|
-
variant?: GradientButtonVariant;
|
|
18
|
-
}
|
|
19
|
-
export declare function GradientButton({ title, icon, iconForcePosition, align, disabled, className, href, openInNewTab, preserveReferrer, onClick, loadingText, preventDoubleClick, iconClassName, variant, }: GradientButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
20
|
-
export {};
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
'use strict';
|
|
3
|
-
|
|
4
|
-
var tslib = require('tslib');
|
|
5
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
6
|
-
var utils = require('@windrun-huaiin/lib/utils');
|
|
7
|
-
var icons = require('@windrun-huaiin/base-ui/icons');
|
|
8
|
-
var lib = require('@windrun-huaiin/base-ui/lib');
|
|
9
|
-
var Link = require('next/link');
|
|
10
|
-
var React = require('react');
|
|
11
|
-
|
|
12
|
-
function GradientButton({ title, icon, iconForcePosition, align = 'left', disabled = false, className = "", href, openInNewTab = true, preserveReferrer = false, onClick, loadingText, preventDoubleClick = true, iconClassName, variant = 'default', }) {
|
|
13
|
-
const [isLoading, setIsLoading] = React.useState(false);
|
|
14
|
-
const actualLoadingText = loadingText || (title === null || title === void 0 ? void 0 : title.toString().trim()) || 'Loading...';
|
|
15
|
-
const defaultIconClass = "h-4 w-4";
|
|
16
|
-
const finalIconClass = utils.cn(variant === 'default' ? 'text-white' : lib.themeIconColor, iconClassName || defaultIconClass);
|
|
17
|
-
// set justify class according to alignment
|
|
18
|
-
const getAlignmentClass = () => {
|
|
19
|
-
switch (align) {
|
|
20
|
-
case 'center':
|
|
21
|
-
return 'justify-center';
|
|
22
|
-
case 'right':
|
|
23
|
-
return 'justify-end';
|
|
24
|
-
default: // 'left'
|
|
25
|
-
return 'justify-start';
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
|
-
const handleClick = (e) => tslib.__awaiter(this, void 0, void 0, function* () {
|
|
29
|
-
if (disabled || isLoading) {
|
|
30
|
-
e.preventDefault();
|
|
31
|
-
return;
|
|
32
|
-
}
|
|
33
|
-
if (onClick) {
|
|
34
|
-
e.preventDefault();
|
|
35
|
-
if (preventDoubleClick) {
|
|
36
|
-
setIsLoading(true);
|
|
37
|
-
}
|
|
38
|
-
try {
|
|
39
|
-
yield onClick();
|
|
40
|
-
}
|
|
41
|
-
catch (error) {
|
|
42
|
-
console.error('GradientButton onClick error:', error);
|
|
43
|
-
}
|
|
44
|
-
finally {
|
|
45
|
-
if (preventDoubleClick) {
|
|
46
|
-
setIsLoading(false);
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
});
|
|
51
|
-
const isDisabled = disabled || isLoading;
|
|
52
|
-
const displayTitle = isLoading ? actualLoadingText : title;
|
|
53
|
-
// icon
|
|
54
|
-
const iconProvided = icon !== undefined;
|
|
55
|
-
const iconNode = (() => {
|
|
56
|
-
if (isLoading) {
|
|
57
|
-
return jsxRuntime.jsx(icons.Loader2Icon, { className: utils.cn(finalIconClass, 'animate-spin') });
|
|
58
|
-
}
|
|
59
|
-
if (iconProvided) {
|
|
60
|
-
if (icon === null || icon === false) {
|
|
61
|
-
return null;
|
|
62
|
-
}
|
|
63
|
-
if (React.isValidElement(icon)) {
|
|
64
|
-
return React.cloneElement(icon, {
|
|
65
|
-
className: utils.cn(finalIconClass, icon.props.className),
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
return icon;
|
|
69
|
-
}
|
|
70
|
-
return jsxRuntime.jsx(icons.ArrowRightIcon, { className: utils.cn(finalIconClass) });
|
|
71
|
-
})();
|
|
72
|
-
const shouldRenderIcon = iconNode !== null && iconNode !== undefined;
|
|
73
|
-
const iconPosition = iconForcePosition !== null && iconForcePosition !== void 0 ? iconForcePosition : (onClick ? 'left' : 'right');
|
|
74
|
-
const buttonContent = iconPosition === 'left' ? (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [shouldRenderIcon ? jsxRuntime.jsx("span", { children: iconNode }) : null, jsxRuntime.jsx("span", { className: utils.cn(shouldRenderIcon && 'ml-1'), children: displayTitle })] })) : (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("span", { children: displayTitle }), shouldRenderIcon ? jsxRuntime.jsx("span", { className: "ml-1", children: iconNode }) : null] }));
|
|
75
|
-
const alignmentClass = align === 'right'
|
|
76
|
-
? 'justify-end'
|
|
77
|
-
: align === 'center'
|
|
78
|
-
? 'justify-center'
|
|
79
|
-
: 'justify-start';
|
|
80
|
-
// Base styles extracted from Button component + size="lg" (h-11 px-8)
|
|
81
|
-
// Removed [&_svg] constraints
|
|
82
|
-
const baseButtonStyles = "inline-flex items-center gap-2 whitespace-nowrap h-11 px-8 ring-offset-background focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50";
|
|
83
|
-
const variantClassName = variant === 'soft'
|
|
84
|
-
? utils.cn(lib.themeBgColor, lib.themeIconColor, lib.themeBorderColor, 'border shadow-sm hover:shadow-md hover:brightness-95')
|
|
85
|
-
: variant === 'subtle'
|
|
86
|
-
? utils.cn(lib.themeMainBgColor, lib.themeIconColor, 'border border-neutral-200 shadow-sm hover:shadow-md hover:bg-neutral-50 dark:border-neutral-800 dark:hover:bg-neutral-800')
|
|
87
|
-
: utils.cn(lib.themeButtonGradientClass, lib.themeButtonGradientHoverClass, 'text-white shadow-lg hover:shadow-xl');
|
|
88
|
-
const buttonClassName = utils.cn(baseButtonStyles, variantClassName, 'text-base font-bold transition-all duration-300 rounded-full', alignmentClass, isDisabled && 'opacity-50 cursor-not-allowed', className);
|
|
89
|
-
return (jsxRuntime.jsx("div", { className: `flex flex-row gap-3 ${getAlignmentClass()}`, children: onClick ? (
|
|
90
|
-
// for click
|
|
91
|
-
jsxRuntime.jsx("button", { type: "button", className: buttonClassName, onClick: handleClick, disabled: isDisabled, children: buttonContent })) : (
|
|
92
|
-
// for Link
|
|
93
|
-
jsxRuntime.jsx(Link, Object.assign({ href: href || "#", className: utils.cn(buttonClassName, "no-underline hover:no-underline") }, (openInNewTab ? { target: "_blank", rel: preserveReferrer ? 'noopener' : 'noopener noreferrer' } : {}), { onClick: isDisabled ? (e) => e.preventDefault() : undefined, "aria-disabled": isDisabled, children: buttonContent }))) }));
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
exports.GradientButton = GradientButton;
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { __awaiter } from 'tslib';
|
|
3
|
-
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
4
|
-
import { cn } from '@windrun-huaiin/lib/utils';
|
|
5
|
-
import { Loader2Icon, ArrowRightIcon } from '@windrun-huaiin/base-ui/icons';
|
|
6
|
-
import { themeIconColor, themeBgColor, themeBorderColor, themeMainBgColor, themeButtonGradientClass, themeButtonGradientHoverClass } from '@windrun-huaiin/base-ui/lib';
|
|
7
|
-
import Link from 'next/link';
|
|
8
|
-
import React__default, { useState } from 'react';
|
|
9
|
-
|
|
10
|
-
function GradientButton({ title, icon, iconForcePosition, align = 'left', disabled = false, className = "", href, openInNewTab = true, preserveReferrer = false, onClick, loadingText, preventDoubleClick = true, iconClassName, variant = 'default', }) {
|
|
11
|
-
const [isLoading, setIsLoading] = useState(false);
|
|
12
|
-
const actualLoadingText = loadingText || (title === null || title === void 0 ? void 0 : title.toString().trim()) || 'Loading...';
|
|
13
|
-
const defaultIconClass = "h-4 w-4";
|
|
14
|
-
const finalIconClass = cn(variant === 'default' ? 'text-white' : themeIconColor, iconClassName || defaultIconClass);
|
|
15
|
-
// set justify class according to alignment
|
|
16
|
-
const getAlignmentClass = () => {
|
|
17
|
-
switch (align) {
|
|
18
|
-
case 'center':
|
|
19
|
-
return 'justify-center';
|
|
20
|
-
case 'right':
|
|
21
|
-
return 'justify-end';
|
|
22
|
-
default: // 'left'
|
|
23
|
-
return 'justify-start';
|
|
24
|
-
}
|
|
25
|
-
};
|
|
26
|
-
const handleClick = (e) => __awaiter(this, void 0, void 0, function* () {
|
|
27
|
-
if (disabled || isLoading) {
|
|
28
|
-
e.preventDefault();
|
|
29
|
-
return;
|
|
30
|
-
}
|
|
31
|
-
if (onClick) {
|
|
32
|
-
e.preventDefault();
|
|
33
|
-
if (preventDoubleClick) {
|
|
34
|
-
setIsLoading(true);
|
|
35
|
-
}
|
|
36
|
-
try {
|
|
37
|
-
yield onClick();
|
|
38
|
-
}
|
|
39
|
-
catch (error) {
|
|
40
|
-
console.error('GradientButton onClick error:', error);
|
|
41
|
-
}
|
|
42
|
-
finally {
|
|
43
|
-
if (preventDoubleClick) {
|
|
44
|
-
setIsLoading(false);
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
const isDisabled = disabled || isLoading;
|
|
50
|
-
const displayTitle = isLoading ? actualLoadingText : title;
|
|
51
|
-
// icon
|
|
52
|
-
const iconProvided = icon !== undefined;
|
|
53
|
-
const iconNode = (() => {
|
|
54
|
-
if (isLoading) {
|
|
55
|
-
return jsx(Loader2Icon, { className: cn(finalIconClass, 'animate-spin') });
|
|
56
|
-
}
|
|
57
|
-
if (iconProvided) {
|
|
58
|
-
if (icon === null || icon === false) {
|
|
59
|
-
return null;
|
|
60
|
-
}
|
|
61
|
-
if (React__default.isValidElement(icon)) {
|
|
62
|
-
return React__default.cloneElement(icon, {
|
|
63
|
-
className: cn(finalIconClass, icon.props.className),
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
return icon;
|
|
67
|
-
}
|
|
68
|
-
return jsx(ArrowRightIcon, { className: cn(finalIconClass) });
|
|
69
|
-
})();
|
|
70
|
-
const shouldRenderIcon = iconNode !== null && iconNode !== undefined;
|
|
71
|
-
const iconPosition = iconForcePosition !== null && iconForcePosition !== void 0 ? iconForcePosition : (onClick ? 'left' : 'right');
|
|
72
|
-
const buttonContent = iconPosition === 'left' ? (jsxs(Fragment, { children: [shouldRenderIcon ? jsx("span", { children: iconNode }) : null, jsx("span", { className: cn(shouldRenderIcon && 'ml-1'), children: displayTitle })] })) : (jsxs(Fragment, { children: [jsx("span", { children: displayTitle }), shouldRenderIcon ? jsx("span", { className: "ml-1", children: iconNode }) : null] }));
|
|
73
|
-
const alignmentClass = align === 'right'
|
|
74
|
-
? 'justify-end'
|
|
75
|
-
: align === 'center'
|
|
76
|
-
? 'justify-center'
|
|
77
|
-
: 'justify-start';
|
|
78
|
-
// Base styles extracted from Button component + size="lg" (h-11 px-8)
|
|
79
|
-
// Removed [&_svg] constraints
|
|
80
|
-
const baseButtonStyles = "inline-flex items-center gap-2 whitespace-nowrap h-11 px-8 ring-offset-background focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50";
|
|
81
|
-
const variantClassName = variant === 'soft'
|
|
82
|
-
? cn(themeBgColor, themeIconColor, themeBorderColor, 'border shadow-sm hover:shadow-md hover:brightness-95')
|
|
83
|
-
: variant === 'subtle'
|
|
84
|
-
? cn(themeMainBgColor, themeIconColor, 'border border-neutral-200 shadow-sm hover:shadow-md hover:bg-neutral-50 dark:border-neutral-800 dark:hover:bg-neutral-800')
|
|
85
|
-
: cn(themeButtonGradientClass, themeButtonGradientHoverClass, 'text-white shadow-lg hover:shadow-xl');
|
|
86
|
-
const buttonClassName = cn(baseButtonStyles, variantClassName, 'text-base font-bold transition-all duration-300 rounded-full', alignmentClass, isDisabled && 'opacity-50 cursor-not-allowed', className);
|
|
87
|
-
return (jsx("div", { className: `flex flex-row gap-3 ${getAlignmentClass()}`, children: onClick ? (
|
|
88
|
-
// for click
|
|
89
|
-
jsx("button", { type: "button", className: buttonClassName, onClick: handleClick, disabled: isDisabled, children: buttonContent })) : (
|
|
90
|
-
// for Link
|
|
91
|
-
jsx(Link, Object.assign({ href: href || "#", className: cn(buttonClassName, "no-underline hover:no-underline") }, (openInNewTab ? { target: "_blank", rel: preserveReferrer ? 'noopener' : 'noopener noreferrer' } : {}), { onClick: isDisabled ? (e) => e.preventDefault() : undefined, "aria-disabled": isDisabled, children: buttonContent }))) }));
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
export { GradientButton };
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import type { MDXComponents } from 'mdx/types';
|
|
2
|
-
import { createConfiguredLocalMdSourceFactory } from '@windrun-huaiin/fumadocs-local-md/server/source';
|
|
3
|
-
import { type FumaDocsCompilerFeatureOptions } from '@windrun-huaiin/fumadocs-local-md/presets/fuma-docs/base';
|
|
4
|
-
import { createCommonDocsSchema, createCommonMetaSchema } from './fuma-schema-check-util';
|
|
5
|
-
import { type SiteMdxFeatureComponents } from '../fuma/server/site-mdx-base';
|
|
6
|
-
type SourceFactory = ReturnType<typeof createConfiguredLocalMdSourceFactory>;
|
|
7
|
-
interface SiteDocsAppConfig {
|
|
8
|
-
i18n: {
|
|
9
|
-
defaultLocale: string;
|
|
10
|
-
locales: readonly string[];
|
|
11
|
-
localePrefixAsNeeded: boolean;
|
|
12
|
-
};
|
|
13
|
-
style: {
|
|
14
|
-
cdnBaseUrl?: string;
|
|
15
|
-
placeHolder: {
|
|
16
|
-
image?: string;
|
|
17
|
-
};
|
|
18
|
-
watermark?: {
|
|
19
|
-
enabled: boolean;
|
|
20
|
-
text: string;
|
|
21
|
-
};
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
export interface CreateSiteDocsHelperOptions<SourceKey extends string> {
|
|
25
|
-
appConfig: SiteDocsAppConfig;
|
|
26
|
-
sourceKeys?: readonly SourceKey[];
|
|
27
|
-
sourceRootDir?: string;
|
|
28
|
-
appRoot?: string;
|
|
29
|
-
sourceFeatures?: FumaDocsCompilerFeatureOptions[];
|
|
30
|
-
mdxFeatures?: SiteMdxFeatureComponents[];
|
|
31
|
-
additionalComponents?: MDXComponents;
|
|
32
|
-
frontmatterSchema?: ReturnType<typeof createCommonDocsSchema>;
|
|
33
|
-
metaSchema?: ReturnType<typeof createCommonMetaSchema>;
|
|
34
|
-
}
|
|
35
|
-
export declare function createSiteDocsHelper<SourceKey extends string>(options: CreateSiteDocsHelperOptions<SourceKey>): {
|
|
36
|
-
i18n: I18nConfig;
|
|
37
|
-
buildConfig: any;
|
|
38
|
-
sourceFactory: any;
|
|
39
|
-
getContentSource: (sourceKey: SourceKey, overrides?: Parameters<SourceFactory["getCachedSource"]>[1]) => Promise<any>;
|
|
40
|
-
getMDXComponents: (components?: MDXComponents) => MDXComponents;
|
|
41
|
-
useMDXComponents: (components?: MDXComponents) => MDXComponents;
|
|
42
|
-
createSourceSharedConfig(): {
|
|
43
|
-
i18n: I18nConfig;
|
|
44
|
-
frontmatterSchema: import("zod").ZodObject<any, import("zod/v4/core").$strip>;
|
|
45
|
-
metaSchema: import("zod").ZodObject<any, import("zod/v4/core").$strip>;
|
|
46
|
-
sourceRootDir: string | undefined;
|
|
47
|
-
appRoot: string;
|
|
48
|
-
icon(icon: string | undefined): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | undefined;
|
|
49
|
-
};
|
|
50
|
-
};
|
|
51
|
-
export {};
|