Skip to content

Commit 66197d5

Browse files
committed
feat: fumadocs
1 parent e586d12 commit 66197d5

File tree

173 files changed

+10045
-501
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

173 files changed

+10045
-501
lines changed

examples/.eslintrc.js

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module.exports = {
2+
extends: ["../.eslintrc.js"],
3+
rules: {
4+
"import/extensions": "off",
5+
},
6+
};

examples/03-ui-components/02-formatting-toolbar-buttons/src/App.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import {
1616
useCreateBlockNote,
1717
} from "@blocknote/react";
1818

19-
import { BlueButton } from "./BlueButton.js";
19+
import { BlueButton } from "./BlueButton";
2020

2121
export default function App() {
2222
// Creates a new editor instance.

examples/03-ui-components/03-formatting-toolbar-block-type-items/src/App.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {
1111
} from "@blocknote/react";
1212

1313
import { RiAlertFill } from "react-icons/ri";
14-
import { Alert } from "./Alert.js";
14+
import { Alert } from "./Alert";
1515

1616
// Our schema with block specs, which contain the configs and implementations for
1717
// blocks that we want our editor to use.

examples/03-ui-components/04-side-menu-buttons/src/App.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {
88
useCreateBlockNote,
99
} from "@blocknote/react";
1010

11-
import { RemoveBlockButton } from "./RemoveBlockButton.js";
11+
import { RemoveBlockButton } from "./RemoveBlockButton";
1212

1313
export default function App() {
1414
// Creates a new editor instance.

examples/03-ui-components/05-side-menu-drag-handle-items/src/App.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {
1111
useCreateBlockNote,
1212
} from "@blocknote/react";
1313

14-
import { ResetBlockTypeItem } from "./ResetBlockTypeItem.js";
14+
import { ResetBlockTypeItem } from "./ResetBlockTypeItem";
1515

1616
// To avoid rendering issues, it's good practice to define your custom drag
1717
// handle menu in a separate component, instead of inline within the `sideMenu`

examples/03-ui-components/10-suggestion-menus-grid-mentions/src/App.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import {
1212
useCreateBlockNote,
1313
} from "@blocknote/react";
1414

15-
import { Mention } from "./Mention.js";
15+
import { Mention } from "./Mention";
1616

1717
// Our schema with inline content specs, which contain the configs and
1818
// implementations for inline content that we want our editor to use.
@@ -27,7 +27,7 @@ const schema = BlockNoteSchema.create({
2727

2828
// Function which gets all users for the mentions menu.
2929
const getMentionMenuItems = (
30-
editor: typeof schema.BlockNoteEditor
30+
editor: typeof schema.BlockNoteEditor,
3131
): DefaultReactGridSuggestionItem[] => {
3232
const users = ["Steve", "Bob", "Joe", "Mike"];
3333

@@ -95,7 +95,7 @@ export function App() {
9595
...item,
9696
title: item.id,
9797
})),
98-
query
98+
query,
9999
) as DefaultReactGridSuggestionItem[]
100100
}
101101
columns={2}

examples/03-ui-components/11-uppy-file-panel/src/App.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ import {
99
useCreateBlockNote,
1010
} from "@blocknote/react";
1111

12-
import { FileReplaceButton } from "./FileReplaceButton.js";
13-
import { uploadFile, UppyFilePanel } from "./UppyFilePanel.js";
12+
import { FileReplaceButton } from "./FileReplaceButton";
13+
import { uploadFile, UppyFilePanel } from "./UppyFilePanel";
1414

1515
export default function App() {
1616
// Creates a new editor instance.
@@ -44,7 +44,7 @@ export default function App() {
4444
items.splice(
4545
items.findIndex((c) => c.key === "replaceFileButton"),
4646
1,
47-
<FileReplaceButton key={"fileReplaceButton"} />
47+
<FileReplaceButton key={"fileReplaceButton"} />,
4848
);
4949

5050
return <FormattingToolbar {...props}>{items}</FormattingToolbar>;

examples/03-ui-components/11-uppy-file-panel/src/FileReplaceButton.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import { useEffect, useState } from "react";
1414

1515
import { RiImageEditFill } from "react-icons/ri";
1616

17-
import { UppyFilePanel } from "./UppyFilePanel.js";
17+
import { UppyFilePanel } from "./UppyFilePanel";
1818

1919
// Copied with minor changes from:
2020
// https://github.com/TypeCellOS/BlockNote/blob/main/packages/react/src/components/FormattingToolbar/DefaultButtons/FileReplaceButton.tsx

examples/03-ui-components/13-custom-ui/src/App.tsx

+7-7
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ import "@blocknote/react/style.css";
1111
import { createTheme, ThemeProvider, useMediaQuery } from "@mui/material";
1212
import { useMemo } from "react";
1313

14-
import { schema } from "./schema.js";
15-
import { CustomMUIFormattingToolbar } from "./MUIFormattingToolbar.js";
16-
import { CustomMUISideMenu } from "./MUISideMenu.js";
17-
import { MUISuggestionMenu } from "./MUISuggestionMenu.js";
14+
import { schema } from "./schema";
15+
import { CustomMUIFormattingToolbar } from "./MUIFormattingToolbar";
16+
import { CustomMUISideMenu } from "./MUISideMenu";
17+
import { MUISuggestionMenu } from "./MUISuggestionMenu";
1818

1919
import "./style.css";
2020

@@ -42,7 +42,7 @@ export default function App() {
4242
mode: prefersDarkMode ? "dark" : "light",
4343
},
4444
}),
45-
[prefersDarkMode]
45+
[prefersDarkMode],
4646
);
4747

4848
// Renders the editor instance.
@@ -76,9 +76,9 @@ export default function App() {
7676
getItems={async (query) =>
7777
filterSuggestionItems(
7878
getDefaultReactSlashMenuItems(editor).filter(
79-
(item) => item.title !== "Emoji"
79+
(item) => item.title !== "Emoji",
8080
),
81-
query
81+
query,
8282
)
8383
}
8484
suggestionMenuComponent={MUISuggestionMenu}

examples/03-ui-components/13-custom-ui/src/MUIFormattingToolbar.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ import {
4242
ReactNode,
4343
} from "react";
4444

45-
import { TextBlockSchema } from "./schema.js";
45+
import { TextBlockSchema } from "./schema";
4646

4747
// This replaces the generic Mantine `ToolbarSelect` component with a simplified
4848
// MUI version:

examples/03-ui-components/13-custom-ui/src/MUISideMenu.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {
1111
} from "@mui/material";
1212
import { MouseEvent, ReactNode, useCallback, useMemo, useState } from "react";
1313

14-
import { TextBlockSchema } from "./schema.js";
14+
import { TextBlockSchema } from "./schema";
1515

1616
// This replaces the default `RemoveBlockItem` component with a simplified
1717
// MUI version:

examples/03-ui-components/13-custom-ui/src/MUISuggestionMenu.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import {
1616
} from "@mui/material";
1717
import { useEffect, useMemo, useRef } from "react";
1818

19-
import { TextBlockSchema } from "./schema.js";
19+
import { TextBlockSchema } from "./schema";
2020

2121
// If you want to change the items in a Suggestion Menu, like the Slash Menu,
2222
// you don't need to modify any of the components in this file. Instead, you

examples/03-ui-components/link-toolbar-buttons/src/App.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {
77
useCreateBlockNote,
88
} from "@blocknote/react";
99

10-
import { AlertButton } from "./AlertButton.js";
10+
import { AlertButton } from "./AlertButton";
1111

1212
export default function App() {
1313
// Creates a new editor instance.

examples/04-theming/07-custom-code-block/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ This will generate a `shiki.bundle.ts` file that you can use to create a syntax
1717
Like this:
1818

1919
```ts
20-
import { createHighlighter } from "./shiki.bundle.js";
20+
import { createHighlighter } from "./shiki.bundle";
2121

2222
export default function App() {
2323
// Creates a new editor instance.

examples/04-theming/07-custom-code-block/src/App.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { BlockNoteView } from "@blocknote/mantine";
33
import "@blocknote/mantine/style.css";
44
import { useCreateBlockNote } from "@blocknote/react";
55
// Bundle created from `npx shiki-codegen --langs typescript,javascript,react --themes light-plus,dark-plus --engine javascript --precompiled ./shiki.bundle.ts`
6-
import { createHighlighter } from "./shiki.bundle.js";
6+
import { createHighlighter } from "./shiki.bundle";
77

88
export default function App() {
99
// Creates a new editor instance.

examples/06-custom-schema/01-alert-block/src/App.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { BlockNoteView } from "@blocknote/mantine";
44
import "@blocknote/mantine/style.css";
55
import { useCreateBlockNote } from "@blocknote/react";
66

7-
import { Alert } from "./Alert.js";
7+
import { Alert } from "./Alert";
88

99
// Our schema with block specs, which contain the configs and implementations for
1010
// blocks that we want our editor to use.

examples/06-custom-schema/02-suggestion-menus-mentions/src/App.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import {
1212
useCreateBlockNote,
1313
} from "@blocknote/react";
1414

15-
import { Mention } from "./Mention.js";
15+
import { Mention } from "./Mention";
1616

1717
// Our schema with inline content specs, which contain the configs and
1818
// implementations for inline content that we want our editor to use.
@@ -27,7 +27,7 @@ const schema = BlockNoteSchema.create({
2727

2828
// Function which gets all users for the mentions menu.
2929
const getMentionMenuItems = (
30-
editor: typeof schema.BlockNoteEditor
30+
editor: typeof schema.BlockNoteEditor,
3131
): DefaultReactSuggestionItem[] => {
3232
const users = ["Steve", "Bob", "Joe", "Mike"];
3333

examples/06-custom-schema/03-font-style/src/App.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import {
2121

2222
import { RiText } from "react-icons/ri";
2323

24-
import { Font } from "./Font.js";
24+
import { Font } from "./Font";
2525

2626
// Our schema with style specs, which contain the configs and implementations for styles
2727
// that we want our editor to use.

examples/06-custom-schema/04-pdf-file-block/src/App.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import {
1515

1616
import { RiFilePdfFill } from "react-icons/ri";
1717

18-
import { PDF } from "./PDF.js";
18+
import { PDF } from "./PDF";
1919

2020
// Our schema with block specs, which contain the configs and implementations for blocks
2121
// that we want our editor to use.
@@ -76,7 +76,7 @@ export default function App() {
7676
// Gets all default slash menu items and `insertPDF` item.
7777
filterSuggestionItems(
7878
[...getDefaultReactSlashMenuItems(editor), insertPDF(editor)],
79-
query
79+
query,
8080
)
8181
}
8282
/>

examples/06-custom-schema/05-alert-block-full-ux/src/App.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import {
1818
} from "@blocknote/react";
1919

2020
import { RiAlertFill } from "react-icons/ri";
21-
import { Alert } from "./Alert.js";
21+
import { Alert } from "./Alert";
2222

2323
// Our schema with block specs, which contain the configs and implementations for
2424
// blocks that we want our editor to use.
@@ -115,7 +115,7 @@ export default function App() {
115115
const defaultItems = getDefaultReactSlashMenuItems(editor);
116116
// Finds index of last item in "Basic blocks" group.
117117
const lastBasicBlockIndex = defaultItems.findLastIndex(
118-
(item) => item.group === "Basic blocks"
118+
(item) => item.group === "Basic blocks",
119119
);
120120
// Inserts the Alert item as the last item in the "Basic blocks" group.
121121
defaultItems.splice(lastBasicBlockIndex + 1, 0, insertAlert(editor));

examples/07-collaboration/02-liveblocks/src/App.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import "@liveblocks/react-ui/styles.css";
99
import "@liveblocks/react-ui/styles/dark/media-query.css";
1010
import "@liveblocks/react-tiptap/styles.css";
1111

12-
import { Editor } from "./Editor.js";
12+
import { Editor } from "./Editor";
1313
import "./globals.css";
1414
import "./styles.css";
1515

examples/07-collaboration/02-liveblocks/src/Editor.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { BlockNoteView } from "@blocknote/mantine";
44
import "@blocknote/mantine/style.css";
55
import { useCreateBlockNoteWithLiveblocks } from "@liveblocks/react-blocknote";
66

7-
import { Threads } from "./Threads.js";
7+
import { Threads } from "./Threads";
88

99
export function Editor() {
1010
const editor = useCreateBlockNoteWithLiveblocks(

examples/07-collaboration/04-comments/src/App.tsx

+4-4
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ import { useCreateBlockNote } from "@blocknote/react";
1010
import { YDocProvider, useYDoc, useYjsProvider } from "@y-sweet/react";
1111
import { useMemo, useState } from "react";
1212

13-
import { SettingsSelect } from "./SettingsSelect.js";
14-
import { HARDCODED_USERS, MyUserType, getRandomColor } from "./userdata.js";
13+
import { SettingsSelect } from "./SettingsSelect";
14+
import { HARDCODED_USERS, MyUserType, getRandomColor } from "./userdata";
1515

1616
import "./style.css";
1717

@@ -66,7 +66,7 @@ function Document() {
6666
return new YjsThreadStore(
6767
activeUser.id,
6868
doc.getMap("threads"),
69-
new DefaultThreadStoreAuth(activeUser.id, activeUser.role)
69+
new DefaultThreadStoreAuth(activeUser.id, activeUser.role),
7070
);
7171
}, [doc, activeUser]);
7272

@@ -83,7 +83,7 @@ function Document() {
8383
user: { color: getRandomColor(), name: activeUser.username },
8484
},
8585
},
86-
[activeUser, threadStore]
86+
[activeUser, threadStore],
8787
);
8888

8989
return (

examples/07-collaboration/05-comments-with-sidebar/src/App.tsx

+4-4
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ import {
1515
import { YDocProvider, useYDoc, useYjsProvider } from "@y-sweet/react";
1616
import { useMemo, useState } from "react";
1717

18-
import { SettingsSelect } from "./SettingsSelect.js";
19-
import { HARDCODED_USERS, MyUserType, getRandomColor } from "./userdata.js";
18+
import { SettingsSelect } from "./SettingsSelect";
19+
import { HARDCODED_USERS, MyUserType, getRandomColor } from "./userdata";
2020

2121
import "./style.css";
2222

@@ -77,7 +77,7 @@ function Document() {
7777
return new YjsThreadStore(
7878
activeUser.id,
7979
doc.getMap("threads"),
80-
new DefaultThreadStoreAuth(activeUser.id, activeUser.role)
80+
new DefaultThreadStoreAuth(activeUser.id, activeUser.role),
8181
);
8282
}, [doc, activeUser]);
8383

@@ -94,7 +94,7 @@ function Document() {
9494
user: { color: getRandomColor(), name: activeUser.username },
9595
},
9696
},
97-
[activeUser, threadStore]
97+
[activeUser, threadStore],
9898
);
9999

100100
return (

examples/08-extensions/01-tiptap-arrow-conversion/src/App.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { useCreateBlockNote } from "@blocknote/react";
33
import { BlockNoteView } from "@blocknote/mantine";
44
import "@blocknote/mantine/style.css";
55

6-
import { ArrowConversionExtension } from "./ArrowConversionExtension.js";
6+
import { ArrowConversionExtension } from "./ArrowConversionExtension";
77

88
export default function App() {
99
// Creates a new editor instance.

fumadocs/.eslintrc.json

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"rules": {
3+
"import/extensions": 0
4+
}
5+
}

fumadocs/.gitignore

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# deps
2+
/node_modules
3+
4+
# generated content
5+
.contentlayer
6+
.content-collections
7+
.source
8+
9+
# test & build
10+
/coverage
11+
/.next/
12+
/out/
13+
/build
14+
*.tsbuildinfo
15+
16+
# misc
17+
.DS_Store
18+
*.pem
19+
/.pnp
20+
.pnp.js
21+
npm-debug.log*
22+
yarn-debug.log*
23+
yarn-error.log*
24+
25+
# others
26+
.env*.local
27+
.vercel
28+
next-env.d.ts
29+
# Sentry Config File
30+
.env.sentry-build-plugin
31+
/content/examples/
32+
/components/example/generated/

0 commit comments

Comments
 (0)