diff --git a/apps/www/src/registry/default/plate-ui/draggable.tsx b/apps/www/src/registry/default/plate-ui/draggable.tsx index 928a3e7c4b..5e0bf38ddf 100644 --- a/apps/www/src/registry/default/plate-ui/draggable.tsx +++ b/apps/www/src/registry/default/plate-ui/draggable.tsx @@ -108,10 +108,7 @@ export const Draggable = withRef<'div', PlateRenderElementProps>( className={cn( 'relative', isDragging && 'opacity-50', - STRUCTURAL_TYPES.includes(element.type) - ? 'group/structural' - : 'group', - className + STRUCTURAL_TYPES.includes(element.type) ? 'group/structural' : 'group' )} > diff --git a/packages/ai/CHANGELOG.md b/packages/ai/CHANGELOG.md index a580fd4cdb..8570ffaf38 100644 --- a/packages/ai/CHANGELOG.md +++ b/packages/ai/CHANGELOG.md @@ -1,5 +1,7 @@ # @udecode/plate-ai +## 41.0.8 + ## 41.0.6 ## 41.0.1 diff --git a/packages/ai/package.json b/packages/ai/package.json index 9434d0afa0..469473b26f 100644 --- a/packages/ai/package.json +++ b/packages/ai/package.json @@ -1,6 +1,6 @@ { "name": "@udecode/plate-ai", - "version": "41.0.6", + "version": "41.0.8", "description": "Text AI plugin for Plate", "keywords": [ "plate", @@ -51,7 +51,7 @@ }, "dependencies": { "@udecode/plate-markdown": "41.0.0", - "@udecode/plate-selection": "41.0.6", + "@udecode/plate-selection": "41.0.8", "lodash": "^4.17.21" }, "devDependencies": { diff --git a/packages/csv/CHANGELOG.md b/packages/csv/CHANGELOG.md index ae2da247b1..1c57bfb5ce 100644 --- a/packages/csv/CHANGELOG.md +++ b/packages/csv/CHANGELOG.md @@ -1,5 +1,9 @@ # @udecode/plate-serializer-csv +## 41.0.9 + +## 41.0.7 + ## 41.0.0 ## 40.0.0 diff --git a/packages/csv/package.json b/packages/csv/package.json index c2cd36f760..211e8febd2 100644 --- a/packages/csv/package.json +++ b/packages/csv/package.json @@ -1,6 +1,6 @@ { "name": "@udecode/plate-csv", - "version": "41.0.0", + "version": "41.0.9", "description": "CSV serializer plugin for Plate", "keywords": [ "csv", @@ -46,7 +46,7 @@ "typecheck": "yarn p:typecheck" }, "dependencies": { - "@udecode/plate-table": "41.0.0", + "@udecode/plate-table": "41.0.9", "papaparse": "^5.4.1" }, "devDependencies": { diff --git a/packages/docx/CHANGELOG.md b/packages/docx/CHANGELOG.md index e05ea8d3a8..0de27b4028 100644 --- a/packages/docx/CHANGELOG.md +++ b/packages/docx/CHANGELOG.md @@ -1,5 +1,9 @@ # @udecode/plate-docx-serializer +## 41.0.9 + +## 41.0.7 + ## 41.0.0 ## 40.2.7 diff --git a/packages/docx/package.json b/packages/docx/package.json index 402495fa57..0333296a1b 100644 --- a/packages/docx/package.json +++ b/packages/docx/package.json @@ -1,6 +1,6 @@ { "name": "@udecode/plate-docx", - "version": "41.0.0", + "version": "41.0.9", "description": "Docx serializer plugin for Plate", "keywords": [ "docx", @@ -50,7 +50,7 @@ "@udecode/plate-indent": "41.0.0", "@udecode/plate-indent-list": "41.0.0", "@udecode/plate-media": "41.0.0", - "@udecode/plate-table": "41.0.0", + "@udecode/plate-table": "41.0.9", "validator": "^13.12.0" }, "devDependencies": { diff --git a/packages/plate/CHANGELOG.md b/packages/plate/CHANGELOG.md index 15ac67dd2b..d19778dd13 100644 --- a/packages/plate/CHANGELOG.md +++ b/packages/plate/CHANGELOG.md @@ -1,5 +1,11 @@ # @udecode/plate +## 41.0.9 + +## 41.0.8 + +## 41.0.7 + ## 41.0.6 ## 41.0.5 diff --git a/packages/plate/package.json b/packages/plate/package.json index 12a7802ab3..5d9a9eb525 100644 --- a/packages/plate/package.json +++ b/packages/plate/package.json @@ -1,6 +1,6 @@ { "name": "@udecode/plate", - "version": "41.0.6", + "version": "41.0.9", "description": "Plate – a plugin system for slate", "keywords": [ "contentEditable", @@ -66,9 +66,9 @@ "@udecode/plate-combobox": "41.0.0", "@udecode/plate-comments": "41.0.0", "@udecode/plate-common": "41.0.5", - "@udecode/plate-csv": "41.0.0", + "@udecode/plate-csv": "41.0.9", "@udecode/plate-diff": "41.0.0", - "@udecode/plate-docx": "41.0.0", + "@udecode/plate-docx": "41.0.9", "@udecode/plate-find-replace": "41.0.0", "@udecode/plate-floating": "41.0.0", "@udecode/plate-font": "41.0.0", @@ -90,11 +90,11 @@ "@udecode/plate-reset-node": "41.0.0", "@udecode/plate-resizable": "41.0.0", "@udecode/plate-select": "41.0.0", - "@udecode/plate-selection": "41.0.6", + "@udecode/plate-selection": "41.0.8", "@udecode/plate-slash-command": "41.0.0", "@udecode/plate-suggestion": "41.0.0", "@udecode/plate-tabbable": "41.0.0", - "@udecode/plate-table": "41.0.0", + "@udecode/plate-table": "41.0.9", "@udecode/plate-toggle": "41.0.0", "@udecode/plate-trailing-block": "41.0.0" }, diff --git a/packages/selection/CHANGELOG.md b/packages/selection/CHANGELOG.md index 7cb7f3c869..a238866436 100644 --- a/packages/selection/CHANGELOG.md +++ b/packages/selection/CHANGELOG.md @@ -1,5 +1,11 @@ # @udecode/plate-selection +## 41.0.8 + +### Patch Changes + +- [#3912](https://github.com/udecode/plate/pull/3912) by [@felixfeng33](https://github.com/felixfeng33) – Fix `selectedIds` has `undifinded` + ## 41.0.6 ### Patch Changes diff --git a/packages/selection/package.json b/packages/selection/package.json index 2a44f24ac2..c9c1773dbf 100644 --- a/packages/selection/package.json +++ b/packages/selection/package.json @@ -1,6 +1,6 @@ { "name": "@udecode/plate-selection", - "version": "41.0.6", + "version": "41.0.8", "description": "Plate selection plugins", "keywords": [ "plate", diff --git a/packages/selection/src/react/BlockSelectionPlugin.tsx b/packages/selection/src/react/BlockSelectionPlugin.tsx index 1cd8b8c605..656259286e 100644 --- a/packages/selection/src/react/BlockSelectionPlugin.tsx +++ b/packages/selection/src/react/BlockSelectionPlugin.tsx @@ -161,10 +161,12 @@ export const BlockSelectionPlugin = createTPlatePlugin({ const next = new Set(prev); if (added) { - extractSelectableIds(added).forEach((id) => next.add(id)); + extractSelectableIds(added).forEach((id) => id && next.add(id)); } if (removed) { - extractSelectableIds(removed).forEach((id) => next.delete(id)); + extractSelectableIds(removed).forEach( + (id) => id && next.delete(id) + ); } setOption('selectedIds', next); diff --git a/packages/table/CHANGELOG.md b/packages/table/CHANGELOG.md index dec18d1fff..8239e0f4a2 100644 --- a/packages/table/CHANGELOG.md +++ b/packages/table/CHANGELOG.md @@ -1,5 +1,17 @@ # @udecode/plate-table +## 41.0.9 + +### Patch Changes + +- [#3909](https://github.com/udecode/plate/pull/3909) by [@Croc-ye](https://github.com/Croc-ye) – fix: copying form mulitple cells does not retain font attributes + +## 41.0.7 + +### Patch Changes + +- [#3908](https://github.com/udecode/plate/pull/3908) by [@Croc-ye](https://github.com/Croc-ye) – fix: exception of inputting Chinese when selecting multiple cells + ## 41.0.0 ### Major Changes diff --git a/packages/table/package.json b/packages/table/package.json index dd70c65cdd..2a227a055e 100644 --- a/packages/table/package.json +++ b/packages/table/package.json @@ -1,6 +1,6 @@ { "name": "@udecode/plate-table", - "version": "41.0.0", + "version": "41.0.9", "description": "Table plugin for Plate", "keywords": [ "plate", diff --git a/packages/table/src/lib/withSetFragmentDataTable.ts b/packages/table/src/lib/withSetFragmentDataTable.ts index 13834ab52c..7451fc6355 100644 --- a/packages/table/src/lib/withSetFragmentDataTable.ts +++ b/packages/table/src/lib/withSetFragmentDataTable.ts @@ -148,7 +148,7 @@ export const withSetFragmentDataTable: ExtendEditor = ({ data.setData('text/html', divElement.innerHTML); // set slate fragment - const selectedFragmentStr = JSON.stringify(tableNode); + const selectedFragmentStr = JSON.stringify([tableNode]); const encodedFragment = window.btoa( encodeURIComponent(selectedFragmentStr) ); diff --git a/packages/table/src/react/onKeyDownTable.ts b/packages/table/src/react/onKeyDownTable.ts index 9489f504b5..0d70014c20 100644 --- a/packages/table/src/react/onKeyDownTable.ts +++ b/packages/table/src/react/onKeyDownTable.ts @@ -1,6 +1,9 @@ import { type TElement, + collapseSelection, getAboveNode, + getNodeEntries, + isExpanded, isHotkey, select, } from '@udecode/plate-common'; @@ -9,6 +12,7 @@ import { type KeyboardHandler, Hotkeys } from '@udecode/plate-common/react'; import { type TableConfig, KEY_SHIFT_EDGES, + getCellTypes, getNextTableCell, getPreviousTableCell, getTableEntries, @@ -22,6 +26,31 @@ export const onKeyDownTable: KeyboardHandler = ({ }) => { if (event.defaultPrevented) return; + const compositeKeyCode = 229; + + if ( + // This exception only occurs when IME composition is triggered, and can be identified by this keycode + event.which === compositeKeyCode && + editor.selection && + isExpanded(editor.selection) + ) { + // fix the exception of inputting Chinese when selecting multiple cells + const tdEntries = Array.from( + getNodeEntries(editor, { + at: editor.selection, + match: { type: getCellTypes(editor) }, + }) + ); + + if (tdEntries.length > 1) { + collapseSelection(editor, { + edge: 'end', + }); + + return; + } + } + const isKeyDown: any = { 'shift+down': isHotkey('shift+down', event), 'shift+left': isHotkey('shift+left', event),