返回 presentation-ai
note-block-placeholder-kit.tsx
根目录 / src / components / plate / plugins / note-block-placeholder-kit.tsx
1 "use client";
2
3 import { KEYS } from "platejs";
4 import { BlockPlaceholderPlugin } from "platejs/react";
5
6 export const NoteBlockPlaceholderKit = [
7 BlockPlaceholderPlugin.configure({
8 options: {
9 className:
10 "before:absolute before:cursor-text before:opacity-30 before:content-[attr(placeholder)]",
11 placeholders: {
12 [KEYS.p]: "",
13 [KEYS.h1]: "Heading 1",
14 [KEYS.h2]: "Heading 2",
15 [KEYS.h3]: "Heading 3",
16 [KEYS.h4]: "Heading 4",
17 [KEYS.h5]: "Heading 5",
18 [KEYS.h6]: "Heading 6",
19 },
20 query: ({ path }) => {
21 return path.length === 1;
22 },
23 },
24 }),
25 ];
26
26 lines Plain Text