| 1 | "use client"; |
| 2 | |
| 3 | import { SlashInputPlugin, SlashPlugin } from "@platejs/slash-command/react"; |
| 4 | import { KEYS } from "platejs"; |
| 5 | |
| 6 | import { SlashInputElement } from "@/components/plate/ui/slash-node"; |
| 7 | |
| 8 | export const SlashKit = [ |
| 9 | SlashPlugin.configure({ |
| 10 | options: { |
| 11 | triggerQuery: (editor) => |
| 12 | !editor.api.some({ |
| 13 | match: { type: editor.getType(KEYS.codeBlock) }, |
| 14 | }), |
| 15 | }, |
| 16 | }), |
| 17 | SlashInputPlugin.withComponent(SlashInputElement), |
| 18 | ]; |
| 19 |