@windrun-huaiin/third-ui 5.10.3 → 5.11.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/mdx/index.d.mts +2 -2
- package/dist/fuma/mdx/index.d.ts +2 -2
- package/dist/fuma/mdx/index.js +215 -92
- package/dist/fuma/mdx/index.js.map +1 -1
- package/dist/fuma/mdx/index.mjs +215 -92
- package/dist/fuma/mdx/index.mjs.map +1 -1
- package/dist/fuma/server.js +45 -57
- package/dist/fuma/server.js.map +1 -1
- package/dist/fuma/server.mjs +43 -55
- package/dist/fuma/server.mjs.map +1 -1
- package/dist/fuma.css +2 -35
- package/dist/main/index.d.mts +73 -1
- package/dist/main/index.d.ts +73 -1
- package/dist/main/index.js +149 -39
- package/dist/main/index.js.map +1 -1
- package/dist/main/index.mjs +147 -38
- package/dist/main/index.mjs.map +1 -1
- package/package.json +2 -1
- package/src/fuma/mdx/banner.tsx +175 -0
- package/src/fuma/mdx/fuma-banner-suit.tsx +21 -7
- package/src/main/ai-prompt-textarea.tsx +259 -0
- package/src/main/index.ts +2 -1
- package/src/styles/fuma.css +2 -35
|
@@ -68,8 +68,8 @@ interface GradientButtonProps {
|
|
|
68
68
|
}
|
|
69
69
|
declare function GradientButton({ title, icon, align, disabled, className, href, openInNewTab, onClick, loadingText, preventDoubleClick, }: GradientButtonProps): react_jsx_runtime.JSX.Element;
|
|
70
70
|
|
|
71
|
-
declare function FumaBannerSuit({
|
|
72
|
-
|
|
71
|
+
declare function FumaBannerSuit({ showBanner }: {
|
|
72
|
+
showBanner: boolean;
|
|
73
73
|
}): react_jsx_runtime.JSX.Element;
|
|
74
74
|
|
|
75
75
|
interface FumaGithubInfoProps {
|
package/dist/fuma/mdx/index.d.ts
CHANGED
|
@@ -68,8 +68,8 @@ interface GradientButtonProps {
|
|
|
68
68
|
}
|
|
69
69
|
declare function GradientButton({ title, icon, align, disabled, className, href, openInNewTab, onClick, loadingText, preventDoubleClick, }: GradientButtonProps): react_jsx_runtime.JSX.Element;
|
|
70
70
|
|
|
71
|
-
declare function FumaBannerSuit({
|
|
72
|
-
|
|
71
|
+
declare function FumaBannerSuit({ showBanner }: {
|
|
72
|
+
showBanner: boolean;
|
|
73
73
|
}): react_jsx_runtime.JSX.Element;
|
|
74
74
|
|
|
75
75
|
interface FumaGithubInfoProps {
|
package/dist/fuma/mdx/index.js
CHANGED
|
@@ -3096,46 +3096,10 @@ function getElementRef(element) {
|
|
|
3096
3096
|
return element.props.ref || element.ref;
|
|
3097
3097
|
}
|
|
3098
3098
|
|
|
3099
|
-
// ../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.mjs
|
|
3100
|
-
var import_clsx2 = require("clsx");
|
|
3101
|
-
var falsyToString = (value) => typeof value === "boolean" ? `${value}` : value === 0 ? "0" : value;
|
|
3102
|
-
var cx = import_clsx2.clsx;
|
|
3103
|
-
var cva = (base, config) => (props) => {
|
|
3104
|
-
var _config_compoundVariants;
|
|
3105
|
-
if ((config === null || config === void 0 ? void 0 : config.variants) == null) return cx(base, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);
|
|
3106
|
-
const { variants, defaultVariants } = config;
|
|
3107
|
-
const getVariantClassNames = Object.keys(variants).map((variant) => {
|
|
3108
|
-
const variantProp = props === null || props === void 0 ? void 0 : props[variant];
|
|
3109
|
-
const defaultVariantProp = defaultVariants === null || defaultVariants === void 0 ? void 0 : defaultVariants[variant];
|
|
3110
|
-
if (variantProp === null) return null;
|
|
3111
|
-
const variantKey = falsyToString(variantProp) || falsyToString(defaultVariantProp);
|
|
3112
|
-
return variants[variant][variantKey];
|
|
3113
|
-
});
|
|
3114
|
-
const propsWithoutUndefined = props && Object.entries(props).reduce((acc, param) => {
|
|
3115
|
-
let [key, value] = param;
|
|
3116
|
-
if (value === void 0) {
|
|
3117
|
-
return acc;
|
|
3118
|
-
}
|
|
3119
|
-
acc[key] = value;
|
|
3120
|
-
return acc;
|
|
3121
|
-
}, {});
|
|
3122
|
-
const getCompoundVariantClassNames = config === null || config === void 0 ? void 0 : (_config_compoundVariants = config.compoundVariants) === null || _config_compoundVariants === void 0 ? void 0 : _config_compoundVariants.reduce((acc, param) => {
|
|
3123
|
-
let _a = param, { class: cvClass, className: cvClassName } = _a, compoundVariantOptions = __objRest(_a, ["class", "className"]);
|
|
3124
|
-
return Object.entries(compoundVariantOptions).every((param2) => {
|
|
3125
|
-
let [key, value] = param2;
|
|
3126
|
-
return Array.isArray(value) ? value.includes(__spreadValues(__spreadValues({}, defaultVariants), propsWithoutUndefined)[key]) : __spreadValues(__spreadValues({}, defaultVariants), propsWithoutUndefined)[key] === value;
|
|
3127
|
-
}) ? [
|
|
3128
|
-
...acc,
|
|
3129
|
-
cvClass,
|
|
3130
|
-
cvClassName
|
|
3131
|
-
] : acc;
|
|
3132
|
-
}, []);
|
|
3133
|
-
return cx(base, getVariantClassNames, getCompoundVariantClassNames, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);
|
|
3134
|
-
};
|
|
3135
|
-
|
|
3136
3099
|
// ../base-ui/src/ui/button.tsx
|
|
3100
|
+
var import_class_variance_authority = require("class-variance-authority");
|
|
3137
3101
|
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
3138
|
-
var buttonVariants = cva(
|
|
3102
|
+
var buttonVariants = (0, import_class_variance_authority.cva)(
|
|
3139
3103
|
"inline-flex items-center gap-2 whitespace-nowrap rounded-md text-sm ring-offset-background transition-colors focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
|
|
3140
3104
|
{
|
|
3141
3105
|
variants: {
|
|
@@ -3385,28 +3349,187 @@ function LastUpdatedDate({ date }) {
|
|
|
3385
3349
|
}
|
|
3386
3350
|
|
|
3387
3351
|
// src/fuma/mdx/fuma-banner-suit.tsx
|
|
3388
|
-
var import_banner = require("fumadocs-ui/components/banner");
|
|
3389
3352
|
var import_next_intl = require("next-intl");
|
|
3353
|
+
|
|
3354
|
+
// src/fuma/mdx/banner.tsx
|
|
3355
|
+
var import_class_variance_authority2 = require("class-variance-authority");
|
|
3356
|
+
var import_react39 = require("react");
|
|
3390
3357
|
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
3391
|
-
|
|
3358
|
+
var buttonVariants2 = (0, import_class_variance_authority2.cva)(
|
|
3359
|
+
"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",
|
|
3360
|
+
{
|
|
3361
|
+
variants: {
|
|
3362
|
+
color: {
|
|
3363
|
+
primary: "bg-primary text-primary-foreground hover:bg-primary/80",
|
|
3364
|
+
outline: "border hover:bg-accent hover:text-accent-foreground",
|
|
3365
|
+
ghost: "hover:bg-accent hover:text-accent-foreground",
|
|
3366
|
+
secondary: "border bg-secondary text-secondary-foreground hover:bg-accent hover:text-accent-foreground"
|
|
3367
|
+
},
|
|
3368
|
+
size: {
|
|
3369
|
+
sm: "gap-1 px-2 py-1.5 text-xs",
|
|
3370
|
+
icon: "p-1.5 [&_svg]:size-5",
|
|
3371
|
+
"icon-sm": "p-1.5 [&_svg]:size-4.5"
|
|
3372
|
+
}
|
|
3373
|
+
}
|
|
3374
|
+
}
|
|
3375
|
+
);
|
|
3376
|
+
function Banner(_a) {
|
|
3377
|
+
var _b = _a, {
|
|
3378
|
+
id,
|
|
3379
|
+
variant = "rainbow",
|
|
3380
|
+
changeLayout = true,
|
|
3381
|
+
height = 3
|
|
3382
|
+
} = _b, props = __objRest(_b, [
|
|
3383
|
+
"id",
|
|
3384
|
+
"variant",
|
|
3385
|
+
"changeLayout",
|
|
3386
|
+
"height"
|
|
3387
|
+
]);
|
|
3388
|
+
const [open, setOpen] = (0, import_react39.useState)(true);
|
|
3389
|
+
const globalKey = id ? `nd-banner-${id}` : null;
|
|
3390
|
+
const bannerHeight = `${height}rem`;
|
|
3391
|
+
const headerStartHeight = `${height + 5.5}rem`;
|
|
3392
|
+
(0, import_react39.useEffect)(() => {
|
|
3393
|
+
if (globalKey) setOpen(localStorage.getItem(globalKey) !== "true");
|
|
3394
|
+
}, [globalKey]);
|
|
3395
|
+
if (!open) return null;
|
|
3396
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
|
|
3397
|
+
"div",
|
|
3398
|
+
__spreadProps(__spreadValues({
|
|
3399
|
+
id
|
|
3400
|
+
}, props), {
|
|
3401
|
+
className: cn(
|
|
3402
|
+
"flex flex-row items-center justify-center px-4 text-center text-sm font-medium",
|
|
3403
|
+
"bg-neutral-100 dark:bg-neutral-900",
|
|
3404
|
+
!open && "hidden",
|
|
3405
|
+
props.className
|
|
3406
|
+
),
|
|
3407
|
+
style: {
|
|
3408
|
+
// 将 fuma.css 中的 .sticky.top-0.z-40 样式完全移到这里
|
|
3409
|
+
position: "fixed",
|
|
3410
|
+
top: 0,
|
|
3411
|
+
left: 0,
|
|
3412
|
+
width: "100vw",
|
|
3413
|
+
zIndex: 1001,
|
|
3414
|
+
height: bannerHeight,
|
|
3415
|
+
minHeight: bannerHeight,
|
|
3416
|
+
maxHeight: bannerHeight,
|
|
3417
|
+
margin: 0,
|
|
3418
|
+
borderRadius: 0
|
|
3419
|
+
},
|
|
3420
|
+
children: [
|
|
3421
|
+
globalKey ? /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("style", { children: `.${globalKey} #${id} { display: none; }` }) : null,
|
|
3422
|
+
globalKey ? /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
3423
|
+
"script",
|
|
3424
|
+
{
|
|
3425
|
+
dangerouslySetInnerHTML: {
|
|
3426
|
+
__html: `if (localStorage.getItem('${globalKey}') === 'true') document.documentElement.classList.add('${globalKey}');`
|
|
3427
|
+
}
|
|
3428
|
+
}
|
|
3429
|
+
) : null,
|
|
3430
|
+
variant === "rainbow" ? rainbowLayer : null,
|
|
3431
|
+
props.children,
|
|
3432
|
+
id ? /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
3433
|
+
"button",
|
|
3434
|
+
{
|
|
3435
|
+
type: "button",
|
|
3436
|
+
"aria-label": "Close Banner",
|
|
3437
|
+
onClick: () => {
|
|
3438
|
+
setOpen(false);
|
|
3439
|
+
if (globalKey) localStorage.setItem(globalKey, "true");
|
|
3440
|
+
},
|
|
3441
|
+
className: cn(
|
|
3442
|
+
buttonVariants2({
|
|
3443
|
+
color: "ghost",
|
|
3444
|
+
className: "absolute end-2 top-1/2 -translate-y-1/2 text-neutral-600 dark:text-neutral-400",
|
|
3445
|
+
size: "icon"
|
|
3446
|
+
})
|
|
3447
|
+
),
|
|
3448
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(globalLucideIcons.X, {})
|
|
3449
|
+
}
|
|
3450
|
+
) : null
|
|
3451
|
+
]
|
|
3452
|
+
})
|
|
3453
|
+
);
|
|
3454
|
+
}
|
|
3455
|
+
var maskImage = "linear-gradient(to bottom,white,transparent), radial-gradient(circle at top center, white, transparent)";
|
|
3456
|
+
var rainbowLayer = /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(import_jsx_runtime42.Fragment, { children: [
|
|
3457
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
3458
|
+
"div",
|
|
3459
|
+
{
|
|
3460
|
+
className: "absolute inset-0 z-[-1]",
|
|
3461
|
+
style: {
|
|
3462
|
+
maskImage,
|
|
3463
|
+
maskComposite: "intersect",
|
|
3464
|
+
animation: "fd-moving-banner 16s linear infinite",
|
|
3465
|
+
"--start": "rgba(0,87,255,0.5)",
|
|
3466
|
+
"--mid": "rgba(255,0,166,0.77)",
|
|
3467
|
+
"--end": "rgba(255,77,0,0.4)",
|
|
3468
|
+
"--via": "rgba(164,255,68,0.4)",
|
|
3469
|
+
animationDirection: "reverse",
|
|
3470
|
+
backgroundImage: "repeating-linear-gradient(60deg, var(--end), var(--start) 2%, var(--start) 5%, transparent 8%, transparent 14%, var(--via) 18%, var(--via) 22%, var(--mid) 28%, var(--mid) 30%, var(--via) 34%, var(--via) 36%, transparent, var(--end) calc(50% - 12px))",
|
|
3471
|
+
backgroundSize: "200% 100%",
|
|
3472
|
+
mixBlendMode: "difference"
|
|
3473
|
+
}
|
|
3474
|
+
}
|
|
3475
|
+
),
|
|
3476
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
3477
|
+
"div",
|
|
3478
|
+
{
|
|
3479
|
+
className: "absolute inset-0 z-[-1]",
|
|
3480
|
+
style: {
|
|
3481
|
+
maskImage,
|
|
3482
|
+
maskComposite: "intersect",
|
|
3483
|
+
animation: "fd-moving-banner 20s linear infinite",
|
|
3484
|
+
"--start": "rgba(255,120,120,0.5)",
|
|
3485
|
+
"--mid": "rgba(36,188,255,0.4)",
|
|
3486
|
+
"--end": "rgba(64,0,255,0.51)",
|
|
3487
|
+
"--via": "rgba(255,89,0,0.56)",
|
|
3488
|
+
backgroundImage: "repeating-linear-gradient(45deg, var(--end), var(--start) 4%, var(--start) 8%, transparent 9%, transparent 14%, var(--mid) 16%, var(--mid) 20%, transparent, var(--via) 36%, var(--via) 40%, transparent 42%, var(--end) 46%, var(--end) calc(50% - 16.8px))",
|
|
3489
|
+
backgroundSize: "200% 100%",
|
|
3490
|
+
mixBlendMode: "color-dodge"
|
|
3491
|
+
}
|
|
3492
|
+
}
|
|
3493
|
+
),
|
|
3494
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("style", { children: `@keyframes fd-moving-banner {
|
|
3495
|
+
from { background-position: 0% 0; }
|
|
3496
|
+
to { background-position: 100% 0; }
|
|
3497
|
+
}` })
|
|
3498
|
+
] });
|
|
3499
|
+
|
|
3500
|
+
// src/fuma/mdx/fuma-banner-suit.tsx
|
|
3501
|
+
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
3502
|
+
function FumaBannerSuit({ showBanner }) {
|
|
3392
3503
|
const t = (0, import_next_intl.useTranslations)("home");
|
|
3393
|
-
|
|
3504
|
+
const heightValue = showBanner ? 3 : 0.5;
|
|
3505
|
+
const height = `${heightValue}rem`;
|
|
3506
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_jsx_runtime43.Fragment, { children: showBanner ? /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(Banner, { variant: "rainbow", changeLayout: true, height: heightValue, children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("p", { className: "text-xl", children: t("banner") }) }) : /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
3507
|
+
"div",
|
|
3508
|
+
{
|
|
3509
|
+
className: "fixed top-0 left-0 w-screen z-[1001] m-0 rounded-none bg-neutral-100 dark:bg-neutral-900",
|
|
3510
|
+
style: {
|
|
3511
|
+
height,
|
|
3512
|
+
minHeight: height,
|
|
3513
|
+
maxHeight: height
|
|
3514
|
+
}
|
|
3515
|
+
}
|
|
3516
|
+
) });
|
|
3394
3517
|
}
|
|
3395
3518
|
|
|
3396
3519
|
// src/fuma/mdx/fuma-github-info.tsx
|
|
3397
|
-
var
|
|
3398
|
-
var
|
|
3520
|
+
var import_react40 = require("react");
|
|
3521
|
+
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
3399
3522
|
function GitHubInfoSkeleton({ owner, repo, className }) {
|
|
3400
|
-
return /* @__PURE__ */ (0,
|
|
3401
|
-
/* @__PURE__ */ (0,
|
|
3402
|
-
/* @__PURE__ */ (0,
|
|
3403
|
-
/* @__PURE__ */ (0,
|
|
3523
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: `flex flex-col gap-1.5 p-2 rounded-lg text-sm text-fd-foreground/80 lg:flex-row lg:items-center animate-pulse ${className}`, children: [
|
|
3524
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
3525
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { className: "size-3.5 bg-fd-muted rounded" }),
|
|
3526
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { className: "h-4 bg-fd-muted rounded w-20" })
|
|
3404
3527
|
] }),
|
|
3405
|
-
/* @__PURE__ */ (0,
|
|
3528
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { className: "h-3 bg-fd-muted rounded w-8" })
|
|
3406
3529
|
] });
|
|
3407
3530
|
}
|
|
3408
3531
|
function GitHubInfoFallback({ owner, repo, className }) {
|
|
3409
|
-
return /* @__PURE__ */ (0,
|
|
3532
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
|
|
3410
3533
|
"a",
|
|
3411
3534
|
{
|
|
3412
3535
|
href: `https://github.com/${owner}/${repo}`,
|
|
@@ -3414,17 +3537,17 @@ function GitHubInfoFallback({ owner, repo, className }) {
|
|
|
3414
3537
|
target: "_blank",
|
|
3415
3538
|
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}`,
|
|
3416
3539
|
children: [
|
|
3417
|
-
/* @__PURE__ */ (0,
|
|
3418
|
-
/* @__PURE__ */ (0,
|
|
3419
|
-
/* @__PURE__ */ (0,
|
|
3420
|
-
/* @__PURE__ */ (0,
|
|
3540
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("p", { className: "flex items-center gap-2 truncate", children: [
|
|
3541
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("svg", { fill: "currentColor", viewBox: "0 0 24 24", className: "size-3.5", children: [
|
|
3542
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("title", { children: "GitHub" }),
|
|
3543
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.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" })
|
|
3421
3544
|
] }),
|
|
3422
3545
|
owner,
|
|
3423
3546
|
"/",
|
|
3424
3547
|
repo
|
|
3425
3548
|
] }),
|
|
3426
|
-
/* @__PURE__ */ (0,
|
|
3427
|
-
/* @__PURE__ */ (0,
|
|
3549
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("p", { className: "flex text-xs items-center gap-1 text-fd-muted-foreground", children: [
|
|
3550
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(globalLucideIcons.ExternalLink, { className: "size-3" }),
|
|
3428
3551
|
"GitHub"
|
|
3429
3552
|
] })
|
|
3430
3553
|
]
|
|
@@ -3438,7 +3561,7 @@ function GitHubInfoSuccess({
|
|
|
3438
3561
|
className
|
|
3439
3562
|
}) {
|
|
3440
3563
|
const humanizedStars = humanizeNumber(stars);
|
|
3441
|
-
return /* @__PURE__ */ (0,
|
|
3564
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
|
|
3442
3565
|
"a",
|
|
3443
3566
|
{
|
|
3444
3567
|
href: `https://github.com/${owner}/${repo}`,
|
|
@@ -3446,17 +3569,17 @@ function GitHubInfoSuccess({
|
|
|
3446
3569
|
target: "_blank",
|
|
3447
3570
|
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}`,
|
|
3448
3571
|
children: [
|
|
3449
|
-
/* @__PURE__ */ (0,
|
|
3450
|
-
/* @__PURE__ */ (0,
|
|
3451
|
-
/* @__PURE__ */ (0,
|
|
3452
|
-
/* @__PURE__ */ (0,
|
|
3572
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("p", { className: "flex items-center gap-2 truncate", children: [
|
|
3573
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("svg", { fill: "currentColor", viewBox: "0 0 24 24", className: "size-3.5", children: [
|
|
3574
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("title", { children: "GitHub" }),
|
|
3575
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.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" })
|
|
3453
3576
|
] }),
|
|
3454
3577
|
owner,
|
|
3455
3578
|
"/",
|
|
3456
3579
|
repo
|
|
3457
3580
|
] }),
|
|
3458
|
-
/* @__PURE__ */ (0,
|
|
3459
|
-
/* @__PURE__ */ (0,
|
|
3581
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("p", { className: "flex text-xs items-center gap-1 text-fd-muted-foreground", children: [
|
|
3582
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(globalLucideIcons.Star, { className: "size-3" }),
|
|
3460
3583
|
humanizedStars
|
|
3461
3584
|
] })
|
|
3462
3585
|
]
|
|
@@ -3478,10 +3601,10 @@ function humanizeNumber(num) {
|
|
|
3478
3601
|
return num.toString();
|
|
3479
3602
|
}
|
|
3480
3603
|
function FumaGithubInfo({ owner, repo, token, className }) {
|
|
3481
|
-
const [data, setData] = (0,
|
|
3482
|
-
const [loading, setLoading] = (0,
|
|
3483
|
-
const [error, setError] = (0,
|
|
3484
|
-
(0,
|
|
3604
|
+
const [data, setData] = (0, import_react40.useState)(null);
|
|
3605
|
+
const [loading, setLoading] = (0, import_react40.useState)(true);
|
|
3606
|
+
const [error, setError] = (0, import_react40.useState)(null);
|
|
3607
|
+
(0, import_react40.useEffect)(() => {
|
|
3485
3608
|
const fetchRepoData = () => __async(null, null, function* () {
|
|
3486
3609
|
try {
|
|
3487
3610
|
setLoading(true);
|
|
@@ -3525,12 +3648,12 @@ function FumaGithubInfo({ owner, repo, token, className }) {
|
|
|
3525
3648
|
fetchRepoData();
|
|
3526
3649
|
}, [owner, repo, token]);
|
|
3527
3650
|
if (loading) {
|
|
3528
|
-
return /* @__PURE__ */ (0,
|
|
3651
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(GitHubInfoSkeleton, { owner, repo, className });
|
|
3529
3652
|
}
|
|
3530
3653
|
if (error || !data) {
|
|
3531
|
-
return /* @__PURE__ */ (0,
|
|
3654
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(GitHubInfoFallback, { owner, repo, className });
|
|
3532
3655
|
}
|
|
3533
|
-
return /* @__PURE__ */ (0,
|
|
3656
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
3534
3657
|
GitHubInfoSuccess,
|
|
3535
3658
|
{
|
|
3536
3659
|
owner,
|
|
@@ -3543,7 +3666,7 @@ function FumaGithubInfo({ owner, repo, token, className }) {
|
|
|
3543
3666
|
|
|
3544
3667
|
// src/fuma/mdx/site-x.tsx
|
|
3545
3668
|
var import_next_intl2 = require("next-intl");
|
|
3546
|
-
var
|
|
3669
|
+
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
3547
3670
|
function SiteX(_a) {
|
|
3548
3671
|
var _b = _a, { type, namespace, tKey, className } = _b, props = __objRest(_b, ["type", "namespace", "tKey", "className"]);
|
|
3549
3672
|
let ns = namespace;
|
|
@@ -3557,7 +3680,7 @@ function SiteX(_a) {
|
|
|
3557
3680
|
const t = (0, import_next_intl2.useTranslations)(ns);
|
|
3558
3681
|
const text = t(key, { defaultValue: type === "site" ? "Site----" : "----@example.com" });
|
|
3559
3682
|
if (type === "site") {
|
|
3560
|
-
return /* @__PURE__ */ (0,
|
|
3683
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
3561
3684
|
"strong",
|
|
3562
3685
|
__spreadProps(__spreadValues({}, props), {
|
|
3563
3686
|
className: cn(
|
|
@@ -3569,7 +3692,7 @@ function SiteX(_a) {
|
|
|
3569
3692
|
);
|
|
3570
3693
|
}
|
|
3571
3694
|
if (type === "email") {
|
|
3572
|
-
return /* @__PURE__ */ (0,
|
|
3695
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
3573
3696
|
"a",
|
|
3574
3697
|
__spreadProps(__spreadValues({}, props), {
|
|
3575
3698
|
href: `mailto:${text}`,
|
|
@@ -3585,16 +3708,16 @@ function SiteX(_a) {
|
|
|
3585
3708
|
}
|
|
3586
3709
|
|
|
3587
3710
|
// src/fuma/mdx/zia-file.tsx
|
|
3588
|
-
var
|
|
3711
|
+
var import_react41 = require("react");
|
|
3589
3712
|
var import_collapsible = require("fumadocs-ui/components/ui/collapsible");
|
|
3590
3713
|
var import_link5 = __toESM(require("next/link"));
|
|
3591
|
-
var
|
|
3714
|
+
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
3592
3715
|
var itemVariants = "flex flex-row items-center gap-2 rounded-md px-2 py-1.5 text-sm hover:bg-fd-accent hover:text-fd-accent-foreground [&_svg]:size-4";
|
|
3593
3716
|
var anotionClass = "ms-2 px-2 py-0.5 rounded text-xs font-semibold bg-fd-accent/80 text-fd-accent-foreground dark:bg-white/20 dark:text-white";
|
|
3594
3717
|
function ZiaFile(_a) {
|
|
3595
3718
|
var _b = _a, {
|
|
3596
3719
|
name,
|
|
3597
|
-
icon = /* @__PURE__ */ (0,
|
|
3720
|
+
icon = /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(globalLucideIcons.File, {}),
|
|
3598
3721
|
className,
|
|
3599
3722
|
anotion,
|
|
3600
3723
|
href
|
|
@@ -3608,16 +3731,16 @@ function ZiaFile(_a) {
|
|
|
3608
3731
|
const validHref = typeof href === "string" && href.trim() !== "";
|
|
3609
3732
|
const validAnotion = typeof anotion === "string" && anotion.trim() !== "";
|
|
3610
3733
|
if (validHref) {
|
|
3611
|
-
return /* @__PURE__ */ (0,
|
|
3734
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_link5.default, { href, className: cn(itemVariants, className), children: [
|
|
3612
3735
|
icon,
|
|
3613
|
-
/* @__PURE__ */ (0,
|
|
3614
|
-
validAnotion && /* @__PURE__ */ (0,
|
|
3736
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { children: name }),
|
|
3737
|
+
validAnotion && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: anotionClass, children: anotion })
|
|
3615
3738
|
] });
|
|
3616
3739
|
}
|
|
3617
|
-
return /* @__PURE__ */ (0,
|
|
3740
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", __spreadProps(__spreadValues({ className: cn(itemVariants, className) }, rest), { children: [
|
|
3618
3741
|
icon,
|
|
3619
|
-
/* @__PURE__ */ (0,
|
|
3620
|
-
validAnotion && /* @__PURE__ */ (0,
|
|
3742
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { children: name }),
|
|
3743
|
+
validAnotion && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: anotionClass, children: anotion })
|
|
3621
3744
|
] }));
|
|
3622
3745
|
}
|
|
3623
3746
|
function ZiaFolder(_a) {
|
|
@@ -3634,26 +3757,26 @@ function ZiaFolder(_a) {
|
|
|
3634
3757
|
"className",
|
|
3635
3758
|
"children"
|
|
3636
3759
|
]);
|
|
3637
|
-
const [open, setOpen] = (0,
|
|
3760
|
+
const [open, setOpen] = (0, import_react41.useState)(defaultOpen);
|
|
3638
3761
|
const validAnotion = typeof anotion === "string" && anotion.trim() !== "";
|
|
3639
|
-
return /* @__PURE__ */ (0,
|
|
3640
|
-
/* @__PURE__ */ (0,
|
|
3641
|
-
open ? /* @__PURE__ */ (0,
|
|
3642
|
-
/* @__PURE__ */ (0,
|
|
3643
|
-
validAnotion && /* @__PURE__ */ (0,
|
|
3762
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_collapsible.Collapsible, __spreadProps(__spreadValues({ open, onOpenChange: setOpen }, props), { children: [
|
|
3763
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_collapsible.CollapsibleTrigger, { className: cn(itemVariants, className, "w-full"), children: [
|
|
3764
|
+
open ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(globalLucideIcons.FolderOpen, {}) : /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(globalLucideIcons.Folder, {}),
|
|
3765
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { children: name }),
|
|
3766
|
+
validAnotion && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: anotionClass, children: anotion })
|
|
3644
3767
|
] }),
|
|
3645
|
-
/* @__PURE__ */ (0,
|
|
3768
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_collapsible.CollapsibleContent, { children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: "ms-2 flex flex-col border-l ps-2", children }) })
|
|
3646
3769
|
] }));
|
|
3647
3770
|
}
|
|
3648
3771
|
|
|
3649
3772
|
// src/fuma/mdx/toc-footer-wrapper.tsx
|
|
3650
|
-
var
|
|
3773
|
+
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
3651
3774
|
function TocFooterWrapper({ lastModified, editPath, githubBaseUrl, copyButtonComponent }) {
|
|
3652
3775
|
const showEdit = githubBaseUrl && editPath;
|
|
3653
|
-
return /* @__PURE__ */ (0,
|
|
3654
|
-
/* @__PURE__ */ (0,
|
|
3776
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: "flex flex-col gap-y-2 items-start m-4", children: [
|
|
3777
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(LastUpdatedDate, { date: lastModified }),
|
|
3655
3778
|
copyButtonComponent,
|
|
3656
|
-
showEdit && /* @__PURE__ */ (0,
|
|
3779
|
+
showEdit && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(EditOnGitHub, { url: `${githubBaseUrl}${editPath}` })
|
|
3657
3780
|
] });
|
|
3658
3781
|
}
|
|
3659
3782
|
// Annotate the CommonJS export names for ESM import in node:
|