mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-05-29 19:35:20 +02:00
feat: introduce fixed toolbar and insert button for enhanced editor functionality
This commit is contained in:
parent
73147c69a3
commit
1450e22f54
8 changed files with 359 additions and 87 deletions
|
|
@ -10,6 +10,7 @@ import { AutoformatKit } from '@/components/editor/plugins/autoformat-classic-ki
|
|||
import { BasicNodesKit } from '@/components/editor/plugins/basic-nodes-kit';
|
||||
import { CalloutKit } from '@/components/editor/plugins/callout-kit';
|
||||
import { CodeBlockKit } from '@/components/editor/plugins/code-block-kit';
|
||||
import { FixedToolbarKit } from '@/components/editor/plugins/fixed-toolbar-kit';
|
||||
import { FloatingToolbarKit } from '@/components/editor/plugins/floating-toolbar-kit';
|
||||
import { IndentKit } from '@/components/editor/plugins/indent-kit';
|
||||
import { LinkKit } from '@/components/editor/plugins/link-kit';
|
||||
|
|
@ -62,6 +63,7 @@ export function PlateEditor({
|
|||
...MathKit,
|
||||
...SelectionKit,
|
||||
...SlashCommandKit,
|
||||
...FixedToolbarKit,
|
||||
...FloatingToolbarKit,
|
||||
...AutoformatKit,
|
||||
MarkdownPlugin.configure({
|
||||
|
|
|
|||
|
|
@ -0,0 +1,20 @@
|
|||
'use client';
|
||||
|
||||
import { createPlatePlugin } from 'platejs/react';
|
||||
|
||||
import { FixedToolbar } from '@/components/ui/fixed-toolbar';
|
||||
import { FixedToolbarButtons } from '@/components/ui/fixed-toolbar-buttons';
|
||||
|
||||
export const FixedToolbarKit = [
|
||||
createPlatePlugin({
|
||||
key: 'fixed-toolbar',
|
||||
render: {
|
||||
beforeEditable: () => (
|
||||
<FixedToolbar>
|
||||
<FixedToolbarButtons />
|
||||
</FixedToolbar>
|
||||
),
|
||||
},
|
||||
}),
|
||||
];
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue