(
);
export function ColumnFloatingToolbar({ children }: React.PropsWithChildren) {
+ const editor = useEditorRef();
const readOnly = useReadOnly();
- const {
- setDoubleColumn,
- setDoubleSideDoubleColumn,
- setLeftSideDoubleColumn,
- setRightSideDoubleColumn,
- setThreeColumn,
- } = useColumnState();
-
const element = useElement
(ColumnItemPlugin.key);
+ const columnGroupElement = useElement(ColumnPlugin.key);
const { props: buttonProps } = useRemoveNodeButton({ element });
const isOpen = useDebouncePopoverOpen();
+ const onColumnChange = (widths: string[]) => {
+ setColumns(editor, {
+ at: findNodePath(editor, columnGroupElement),
+ widths,
+ });
+ };
+
if (readOnly) return <>{children}>;
return (
@@ -61,26 +70,38 @@ export function ColumnFloatingToolbar({ children }: React.PropsWithChildren) {
sideOffset={10}
>
-