diff --git a/apps/web/src/components/ui/report/elements/EmojiToolbarButton.tsx b/apps/web/src/components/ui/report/elements/EmojiToolbarButton.tsx index 48b906801..7ee5135e8 100644 --- a/apps/web/src/components/ui/report/elements/EmojiToolbarButton.tsx +++ b/apps/web/src/components/ui/report/elements/EmojiToolbarButton.tsx @@ -252,7 +252,7 @@ function EmojiPickerContent({ return (
} style={{ width: getRowWidth }} data-id={categoryId}>
@@ -310,7 +310,7 @@ function EmojiPickerContent({ return (
} className={cn( 'h-full min-h-[50%] overflow-x-hidden overflow-y-auto px-2', '[&::-webkit-scrollbar]:w-4', @@ -319,7 +319,7 @@ function EmojiPickerContent({ '[&::-webkit-scrollbar-thumb]:border-popover [&::-webkit-scrollbar-thumb]:border-4 [&::-webkit-scrollbar-thumb]:border-solid [&::-webkit-scrollbar-thumb]:bg-clip-padding' )} data-id="scroll"> -
+
} className="h-full"> {isSearching ? SearchList() : EmojiList()}
diff --git a/apps/web/src/components/ui/report/plugins/callout-base-kit.tsx b/apps/web/src/components/ui/report/plugins/callout-base-kit.tsx deleted file mode 100644 index 538dbb10c..000000000 --- a/apps/web/src/components/ui/report/plugins/callout-base-kit.tsx +++ /dev/null @@ -1,5 +0,0 @@ -import { BaseCalloutPlugin } from '@platejs/callout'; - -import { CalloutElementStatic } from '@/components/ui/callout-node-static'; - -export const BaseCalloutKit = [BaseCalloutPlugin.withComponent(CalloutElementStatic)]; diff --git a/apps/web/src/components/ui/report/plugins/callout-kit.tsx b/apps/web/src/components/ui/report/plugins/callout-kit.tsx new file mode 100644 index 000000000..37ae29660 --- /dev/null +++ b/apps/web/src/components/ui/report/plugins/callout-kit.tsx @@ -0,0 +1,5 @@ +import { BaseCalloutPlugin } from '@platejs/callout'; + +import { CalloutElement } from '../elements/CalloutNode'; + +export const CalloutKit = [BaseCalloutPlugin.withComponent(CalloutElement)]; diff --git a/apps/web/src/components/ui/report/plugins/test-plugin.tsx b/apps/web/src/components/ui/report/plugins/test-plugin.tsx new file mode 100644 index 000000000..dfe6604f8 --- /dev/null +++ b/apps/web/src/components/ui/report/plugins/test-plugin.tsx @@ -0,0 +1,34 @@ +import { createPlatePlugin, Key } from 'platejs/react'; + +// Example: A simplified plugin with both transforms and API +export const MyTestPlugin = createPlatePlugin({ + key: 'doc' +}) + // Define editor.tf.doc.format() + .extendTransforms(({ editor, type }) => ({ + format: () => { + console.log('format', editor, type); + editor.tf.normalize({ force: true }); + } + })) + // Define editor.api.doc.format() + .extendApi(({ editor, type }) => ({ + save: async () => { + console.log('save', editor, type); + // Save the document + // await fetch(...); + } + })) + .extend({ + // Or .configure() if extending an existing plugin + shortcuts: { + // This will call editor.tf.doc.format() + format: { + keys: [[Key.Mod, Key.Shift, 'f']] // e.g., Cmd/Ctrl + Shift + F + }, + // This will call editor.api.doc.save() + save: { + keys: [[Key.Mod, 's']] // e.g., Cmd/Ctrl + S + } + } + }); diff --git a/apps/web/src/components/ui/report/useEditor.tsx b/apps/web/src/components/ui/report/useEditor.tsx index f74d5a3c1..c4c3f8a9f 100644 --- a/apps/web/src/components/ui/report/useEditor.tsx +++ b/apps/web/src/components/ui/report/useEditor.tsx @@ -1,6 +1,4 @@ import { AnyPluginConfig, type Value } from 'platejs'; -import { CodePlugin } from '@platejs/basic-nodes/react'; -import { CalloutPlugin } from '@platejs/callout/react'; import { KEYS } from 'platejs'; import { AutoformatPlugin } from '@platejs/autoformat'; @@ -8,13 +6,14 @@ import { usePlateEditor } from 'platejs/react'; import { BasicBlocksKit } from './plugins/basic-blocks-kit'; import { BaseBasicMarksKit } from './plugins/basic-markd-kit'; import { CodeBlockKit } from './plugins/code-block-kit'; +import { CalloutKit } from './plugins/callout-kit'; +import { MyDocumentPlugin } from './plugins/test-plugin'; export const editorPlugins: AnyPluginConfig[] = [ ...BaseBasicMarksKit, ...BasicBlocksKit, ...CodeBlockKit, - CalloutPlugin, - CodePlugin, + ...CalloutKit, AutoformatPlugin.configure({ options: { rules: [