返回 presentation-ai
basic-marks-kit.tsx
根目录 / src / components / plate / plugins / basic-marks-kit.tsx
1 "use client";
2
3 import {
4 BoldPlugin,
5 CodePlugin,
6 HighlightPlugin,
7 ItalicPlugin,
8 KbdPlugin,
9 StrikethroughPlugin,
10 SubscriptPlugin,
11 SuperscriptPlugin,
12 UnderlinePlugin,
13 } from "@platejs/basic-nodes/react";
14
15 import { CodeLeaf } from "@/components/plate/ui/code-node";
16 import { HighlightLeaf } from "@/components/plate/ui/highlight-node";
17 import { KbdLeaf } from "@/components/plate/ui/kbd-node";
18
19 export const BasicMarksKit = [
20 BoldPlugin,
21 ItalicPlugin,
22 UnderlinePlugin,
23 CodePlugin.configure({
24 node: { component: CodeLeaf },
25 shortcuts: { toggle: { keys: "mod+e" } },
26 }),
27 StrikethroughPlugin.configure({
28 shortcuts: { toggle: { keys: "mod+shift+x" } },
29 }),
30 SubscriptPlugin.configure({
31 shortcuts: { toggle: { keys: "mod+comma" } },
32 }),
33 SuperscriptPlugin.configure({
34 shortcuts: { toggle: { keys: "mod+period" } },
35 }),
36 HighlightPlugin.configure({
37 node: { component: HighlightLeaf },
38 shortcuts: { toggle: { keys: "mod+shift+h" } },
39 }),
40 KbdPlugin.withComponent(KbdLeaf),
41 ];
42
42 lines Plain Text