返回 presentation-ai
quote-plugin.tsx
根目录 / src / components / notebook / presentation / editor / plugins / quote-plugin.tsx
1 "use client";
2
3 import { type TElement } from "platejs";
4 import { createTPlatePlugin } from "platejs/react";
5
6 import { QuoteElement } from "../custom-elements/quote";
7 import { QUOTE_ELEMENT } from "../lib";
8
9 // Create plugin for quote
10 export const QuotePlugin = createTPlatePlugin({
11 key: QUOTE_ELEMENT,
12 node: {
13 isElement: true,
14 type: QUOTE_ELEMENT,
15 component: QuoteElement,
16 },
17 });
18
19 export type TQuoteElement = TElement & {
20 type: typeof QUOTE_ELEMENT;
21 variant: "large" | "sidequote-icon" | "sidequote";
22 author?: string;
23 };
24
24 lines Plain Text