返回 presentation-ai
basis-marks-kit.tsx
根目录 / src / components / notebook / presentation / editor / plugins / basis-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 import { PresentationLeafElement } from "../custom-elements/presentation-leaf-element";
19 export const BasicMarksKit = [
20 BoldPlugin.withComponent(PresentationLeafElement),
21 ItalicPlugin.withComponent(PresentationLeafElement),
22 UnderlinePlugin.withComponent(PresentationLeafElement),
23 CodePlugin.configure({
24 node: { component: CodeLeaf },
25 shortcuts: { toggle: { keys: "mod+e" } },
26 }),
27 StrikethroughPlugin.configure({
28 render: { node: PresentationLeafElement },
29 shortcuts: { toggle: { keys: "mod+shift+x" } },
30 }),
31 SubscriptPlugin.configure({
32 shortcuts: { toggle: { keys: "mod+comma" } },
33 }),
34 SuperscriptPlugin.configure({
35 shortcuts: { toggle: { keys: "mod+period" } },
36 }),
37 HighlightPlugin.configure({
38 node: { component: HighlightLeaf },
39 shortcuts: { toggle: { keys: "mod+shift+h" } },
40 }),
41 KbdPlugin.withComponent(KbdLeaf),
42 ];
43
43 lines Plain Text