From 4ee33e511d9345d91b522f1f556b3c8564937ca5 Mon Sep 17 00:00:00 2001 From: zbeyens Date: Mon, 2 Oct 2023 19:32:22 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../www/content/docs/components/changelog.mdx | 7 ++++++ .../default/plate-ui/table-cell-element.tsx | 5 ++--- .../useTableCellElementState.ts | 22 +++++++++---------- 3 files changed, 20 insertions(+), 14 deletions(-) diff --git a/apps/www/content/docs/components/changelog.mdx b/apps/www/content/docs/components/changelog.mdx index 550c240b08..474a8e3ef6 100644 --- a/apps/www/content/docs/components/changelog.mdx +++ b/apps/www/content/docs/components/changelog.mdx @@ -8,6 +8,13 @@ Since Plate UI is not a component library, a changelog is maintained here. Use the [CLI](https://platejs.org/docs/components/cli) to install the latest version of the components. +## October 2023 #5 + +### 2 Oct #5.1 + +- `table-cell-element`: + - feat: merging cells + ## September 2023 #4 ### 18 Sept #4.4 diff --git a/apps/www/src/registry/default/plate-ui/table-cell-element.tsx b/apps/www/src/registry/default/plate-ui/table-cell-element.tsx index 3ef4777e84..3395bfb4e4 100644 --- a/apps/www/src/registry/default/plate-ui/table-cell-element.tsx +++ b/apps/www/src/registry/default/plate-ui/table-cell-element.tsx @@ -1,4 +1,4 @@ -import React, { LegacyRef } from 'react'; +import React from 'react'; import { PlateElement, PlateElementProps, Value } from '@udecode/plate-common'; import { TTableCellElement, @@ -48,7 +48,6 @@ const TableCellElement = React.forwardRef< const { rightProps, bottomProps, leftProps, hiddenLeft } = useTableCellElementResizable(resizableState); - const Cell = isHeader ? 'th' : 'td'; return ( @@ -85,7 +84,7 @@ const TableCellElement = React.forwardRef< } as React.CSSProperties } > - | undefined}> +
; + cellRef: MutableRefObject; }; export const useTableCellElementState = ({ @@ -43,7 +43,7 @@ export const useTableCellElementState = ({ } = {}): TableCellElementState => { const editor = useEditorRef(); const cellElement = useElement(); - const cellRef = useRef(); + const cellRef = useRef(null); // TODO: get rid of mutating element here // currently needed only for pasting tables from clipboard to gather span attributes