返回 presentation-ai
font-kit.tsx
根目录 / src / components / plate / plugins / font-kit.tsx
1 "use client";
2
3 import {
4 FontBackgroundColorPlugin,
5 FontColorPlugin,
6 FontFamilyPlugin,
7 FontSizePlugin,
8 } from "@platejs/basic-styles/react";
9 import { KEYS } from "platejs";
10 import { type PlatePluginConfig } from "platejs/react";
11
12 const options = {
13 inject: { targetPlugins: [KEYS.p] },
14 } satisfies PlatePluginConfig;
15
16 export const FontKit = [
17 FontColorPlugin.configure({
18 inject: {
19 ...options.inject,
20 nodeProps: {
21 defaultNodeValue: "black",
22 },
23 },
24 }),
25 FontBackgroundColorPlugin.configure(options),
26 FontSizePlugin.configure(options),
27 FontFamilyPlugin.configure(options),
28 ];
29
29 lines Plain Text