mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-04-26 17:26:23 +02:00
24 lines
539 B
TypeScript
24 lines
539 B
TypeScript
|
|
'use client';
|
||
|
|
|
||
|
|
import { BlockSelectionPlugin } from '@platejs/selection/react';
|
||
|
|
|
||
|
|
import { BlockSelection } from '@/components/ui/block-selection';
|
||
|
|
|
||
|
|
export const SelectionKit = [
|
||
|
|
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;
|
||
|
|
}
|
||
|
|
|
||
|
|
return true;
|
||
|
|
},
|
||
|
|
},
|
||
|
|
}),
|
||
|
|
];
|