fumadocs-ui 13.3.3 → 13.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/mdx.d.ts CHANGED
@@ -19,7 +19,7 @@ declare const defaultMdxComponents: {
19
19
  h5: (props: React.HTMLAttributes<HTMLHeadingElement>) => react_jsx_runtime.JSX.Element;
20
20
  h6: (props: React.HTMLAttributes<HTMLHeadingElement>) => react_jsx_runtime.JSX.Element;
21
21
  table: typeof Table;
22
- Callout: react.ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLDivElement>, "title" | "type" | "icon"> & {
22
+ Callout: react.ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLDivElement>, "title" | "icon" | "type"> & {
23
23
  title?: react.ReactNode;
24
24
  type?: "info" | "warn" | "error";
25
25
  icon?: react.ReactNode;
package/dist/og.d.ts ADDED
@@ -0,0 +1,22 @@
1
+ import { ImageResponse } from 'next/og';
2
+ import { ReactElement, ReactNode } from 'react';
3
+ import { ImageResponseOptions } from 'next/dist/compiled/@vercel/og/types';
4
+
5
+ interface GenerateProps {
6
+ title: ReactNode;
7
+ description?: ReactNode;
8
+ icon?: ReactNode;
9
+ primaryColor?: string;
10
+ primaryTextColor?: string;
11
+ site?: ReactNode;
12
+ }
13
+ declare function getImageMeta(baseUrl: string, slugs?: string[]): {
14
+ alt: string;
15
+ url: string;
16
+ width: number;
17
+ height: number;
18
+ };
19
+ declare function generateOGImage(options: GenerateProps & ImageResponseOptions): ImageResponse;
20
+ declare function generate({ primaryColor, primaryTextColor, ...props }: GenerateProps): ReactElement;
21
+
22
+ export { generate, generateOGImage, getImageMeta };
package/dist/og.js ADDED
@@ -0,0 +1,114 @@
1
+ import "./chunk-MLKGABMK.js";
2
+
3
+ // src/og.tsx
4
+ import { ImageResponse } from "next/og";
5
+ import { jsx, jsxs } from "react/jsx-runtime";
6
+ function getImageMeta(baseUrl, slugs = []) {
7
+ return {
8
+ alt: "Banner",
9
+ url: `/${[...baseUrl.split("/"), ...slugs, "og.png"].filter((v) => v.length > 0).join("/")}`,
10
+ width: 1200,
11
+ height: 630
12
+ };
13
+ }
14
+ function generateOGImage(options) {
15
+ const {
16
+ title,
17
+ description,
18
+ icon,
19
+ site,
20
+ primaryColor,
21
+ primaryTextColor,
22
+ ...rest
23
+ } = options;
24
+ return new ImageResponse(
25
+ generate({
26
+ title,
27
+ description,
28
+ icon,
29
+ site,
30
+ primaryTextColor,
31
+ primaryColor
32
+ }),
33
+ {
34
+ width: 1200,
35
+ height: 630,
36
+ ...rest
37
+ }
38
+ );
39
+ }
40
+ function generate({
41
+ primaryColor = "rgba(255,150,255,0.3)",
42
+ primaryTextColor = "rgb(255,150,255)",
43
+ ...props
44
+ }) {
45
+ return /* @__PURE__ */ jsxs(
46
+ "div",
47
+ {
48
+ style: {
49
+ display: "flex",
50
+ flexDirection: "column",
51
+ width: "100%",
52
+ height: "100%",
53
+ color: "white",
54
+ padding: "4rem",
55
+ backgroundColor: "#000000",
56
+ backgroundImage: `linear-gradient(to top right, ${primaryColor}, transparent), linear-gradient(to top, #303030 2px, transparent 2px), linear-gradient(to right, #303030 2px, transparent 2px)`,
57
+ backgroundSize: "100% 100%, 40px 40px, 40px 40px"
58
+ },
59
+ children: [
60
+ /* @__PURE__ */ jsxs(
61
+ "div",
62
+ {
63
+ style: {
64
+ display: "flex",
65
+ flexDirection: "row",
66
+ alignItems: "center",
67
+ gap: "16px",
68
+ marginBottom: "12px",
69
+ color: primaryTextColor
70
+ },
71
+ children: [
72
+ props.icon,
73
+ /* @__PURE__ */ jsx(
74
+ "p",
75
+ {
76
+ style: {
77
+ fontSize: "64px",
78
+ fontWeight: 800
79
+ },
80
+ children: props.site
81
+ }
82
+ )
83
+ ]
84
+ }
85
+ ),
86
+ /* @__PURE__ */ jsx(
87
+ "p",
88
+ {
89
+ style: {
90
+ fontWeight: 800,
91
+ fontSize: "82px"
92
+ },
93
+ children: props.title
94
+ }
95
+ ),
96
+ /* @__PURE__ */ jsx(
97
+ "p",
98
+ {
99
+ style: {
100
+ fontSize: "52px",
101
+ color: "rgba(240,240,240,0.8)"
102
+ },
103
+ children: props.description
104
+ }
105
+ )
106
+ ]
107
+ }
108
+ );
109
+ }
110
+ export {
111
+ generate,
112
+ generateOGImage,
113
+ getImageMeta
114
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fumadocs-ui",
3
- "version": "13.3.3",
3
+ "version": "13.4.0",
4
4
  "description": "The framework for building a documentation website in Next.js",
5
5
  "keywords": [
6
6
  "NextJs",
@@ -51,6 +51,10 @@
51
51
  "./mdx": {
52
52
  "import": "./dist/mdx.js",
53
53
  "types": "./dist/mdx.d.ts"
54
+ },
55
+ "./og": {
56
+ "import": "./dist/og.js",
57
+ "types": "./dist/og.d.ts"
54
58
  }
55
59
  },
56
60
  "typesVersions": {
@@ -81,6 +85,9 @@
81
85
  ],
82
86
  "mdx": [
83
87
  "./dist/mdx.d.ts"
88
+ ],
89
+ "og": [
90
+ "./dist/og.d.ts"
84
91
  ]
85
92
  }
86
93
  },
@@ -103,7 +110,7 @@
103
110
  "react-medium-image-zoom": "^5.2.8",
104
111
  "swr": "^2.2.5",
105
112
  "tailwind-merge": "^2.5.2",
106
- "fumadocs-core": "13.3.3"
113
+ "fumadocs-core": "13.4.0"
107
114
  },
108
115
  "devDependencies": {
109
116
  "@algolia/client-search": "^4.24.0",