SurfSense/surfsense_web/components/editor/plugins/selection-kit.tsx

24 lines
499 B
TypeScript
Raw Normal View History

2026-02-17 12:47:39 +05:30
"use client";
2026-02-17 12:47:39 +05:30
import { BlockSelectionPlugin } from "@platejs/selection/react";
2026-02-17 12:47:39 +05:30
import { BlockSelection } from "@/components/ui/block-selection";
export const SelectionKit = [
2026-02-17 12:47:39 +05:30
BlockSelectionPlugin.configure({
render: {
belowRootNodes: BlockSelection as any,
},
options: {
isSelectable: (element) => {
// Exclude specific block types from selection
if (["code_line", "td", "th"].includes(element.type as string)) {
return false;
}
2026-02-17 12:47:39 +05:30
return true;
},
},
}),
];