Skip to content

Commit 34eebd9

Browse files
authored
Merge branch 'udecode:main' into main
2 parents e7acc67 + 90d7507 commit 34eebd9

30 files changed

Lines changed: 297 additions & 31 deletions

File tree

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
'@platejs/docx-io': minor
3+
---
4+
5+
Forward two dropped options in `exportToDocx`:
6+
7+
- **`pageSize`** — the html-to-docx engine accepts a page size, but `exportToDocx` only forwarded `margins` and `orientation`, so the document was always the default (US Letter). You can now pass e.g. `pageSize: { width: 11906, height: 16838 }` to export A4.
8+
- **`fontFamily`** — it was only applied to the serialized HTML (and only when an `EditorStaticComponent` was provided), so the document default font was never set and Word fell back to Times New Roman. It now also sets the document default font (`documentOptions.font`).

apps/www/src/generated/release-index.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,21 @@
11
[
2+
{
3+
"changelogUrl": "https://github.com/udecode/plate/blob/79578fd8ef53237edfc78389594df3ed5c722277/packages/ai/CHANGELOG.md",
4+
"content": "`@platejs/ai`\n\n### Bug Fixes\n\n- Updated `@platejs/table`.\n\n`@platejs/table`\n\n### Bug Fixes\n\n- Remove the table when deleting its final column. ([#4994](https://github.com/udecode/plate/pull/4994))\n\n[`v53.0.8...v53.0.9`](https://github.com/udecode/plate/compare/v53.0.8...v53.0.9) · By [@puneetdixit200](https://github.com/puneetdixit200)",
5+
"contributors": [
6+
{
7+
"url": "https://github.com/puneetdixit200",
8+
"username": "@puneetdixit200"
9+
}
10+
],
11+
"date": "2026-06-04",
12+
"packageTag": "@platejs/ai@53.0.9",
13+
"tag": "v53.0.9",
14+
"title": "v53.0.9",
15+
"type": "patch",
16+
"versionPackagePrUrl": "https://github.com/udecode/plate/pull/4995",
17+
"url": "https://github.com/udecode/plate/releases/tag/v53.0.9"
18+
},
219
{
320
"changelogUrl": "https://github.com/udecode/plate/blob/f4514ed943145a9dd812e34b5f0caed8862b4d61/packages/docx-io/CHANGELOG.md",
421
"content": "`@platejs/docx-io`\n\n### Bug Fixes\n\n- Fix `exportToDocx` adding blank paragraphs at the top of the document. `wrapHtmlForDocx` emitted a `<!DOCTYPE html>` and indented the template; html-to-docx (html-to-vdom) keeps the DOCTYPE and the whitespace-only text nodes between tags and renders each as a blank paragraph. The wrapper now emits tight markup with no DOCTYPE. ([#4991](https://github.com/udecode/plate/pull/4991))\n\n[`v53.0.7...v53.0.8`](https://github.com/udecode/plate/compare/v53.0.7...v53.0.8) · By [@WilliamPeralta](https://github.com/WilliamPeralta)",

packages/ai/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# @platejs/ai
22

3+
## 53.0.9
4+
5+
### Patch Changes
6+
7+
- Updated `@platejs/table`.
8+
39
## 53.0.7
410

511
### Patch Changes

packages/ai/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@platejs/ai",
3-
"version": "53.0.7",
3+
"version": "53.0.9",
44
"description": "Text AI plugin for Plate",
55
"keywords": [
66
"plate",

packages/csv/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# @udecode/plate-serializer-csv
22

3+
## 53.0.9
4+
35
## 53.0.7
46

57
## 53.0.0

packages/csv/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@platejs/csv",
3-
"version": "53.0.7",
3+
"version": "53.0.9",
44
"description": "CSV serializer plugin for Plate",
55
"keywords": [
66
"csv",

packages/docx-io/src/lib/docx-export-plugin.tsx

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ import { serializeHtml } from 'platejs/static';
4444

4545
import juice from 'juice';
4646

47-
import type { DocumentMargins } from './html-to-docx';
47+
import type { DocumentMargins, PageSize } from './html-to-docx';
4848

4949
import { htmlToDocxBlob } from './html-to-docx';
5050

@@ -176,12 +176,12 @@ export type DocxExportOperationOptions = {
176176
customStyles?: string;
177177

178178
/**
179-
* Font family for the document body.
180-
* This overrides the default Calibri font.
179+
* Font family for the document body. Sets the document default font; when
180+
* omitted the document falls back to the docx default (Times New Roman).
181181
*
182182
* @example
183183
* ```typescript
184-
* fontFamily: 'Times New Roman'
184+
* fontFamily: 'Calibri'
185185
* ```
186186
*/
187187
fontFamily?: string;
@@ -203,6 +203,17 @@ export type DocxExportOperationOptions = {
203203
*/
204204
orientation?: DocxExportOrientation;
205205

206+
/**
207+
* Page size in twentieths of a point (twips). Defaults to the html-to-docx
208+
* default (US Letter) when omitted.
209+
*
210+
* @example
211+
* ```typescript
212+
* pageSize: { width: 11906, height: 16838 } // A4 portrait
213+
* ```
214+
*/
215+
pageSize?: PageSize;
216+
206217
/**
207218
* Document title (for metadata purposes).
208219
*/
@@ -418,6 +429,7 @@ async function exportToDocxInternal(
418429
fontFamily,
419430
margins = DEFAULT_DOCX_MARGINS,
420431
orientation = 'portrait',
432+
pageSize,
421433
value,
422434
} = options;
423435

@@ -442,11 +454,13 @@ async function exportToDocxInternal(
442454

443455
// Convert to DOCX using browser-compatible implementation
444456
const blob = await htmlToDocxBlob(inlinedHtml, {
457+
font: fontFamily,
445458
margins: {
446459
...DEFAULT_DOCX_MARGINS,
447460
...margins,
448461
},
449462
orientation,
463+
pageSize,
450464
});
451465

452466
return blob;

packages/table/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# @platejs/table
22

3+
## 53.0.9
4+
5+
### Patch Changes
6+
7+
- [#4994](https://github.com/udecode/plate/pull/4994) by [@puneetdixit200](https://github.com/puneetdixit200) – Remove the table when deleting its final column.
8+
39
## 53.0.7
410

511
### Patch Changes

packages/table/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@platejs/table",
3-
"version": "53.0.7",
3+
"version": "53.0.9",
44
"description": "Table plugin for Plate",
55
"keywords": [
66
"plate",

packages/table/src/lib/merge/deleteColumn.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import { BaseTablePlugin } from '../BaseTablePlugin';
1313
import { deleteColumnWhenExpanded } from './deleteColumnWhenExpanded';
1414
import { findCellByIndexes } from './findCellByIndexes';
1515
import { getCellPath } from './getCellPath';
16+
import { getTableMergedColumnCount } from './getTableMergedColumnCount';
1617

1718
export const deleteTableMergeColumn = (editor: SlateEditor) => {
1819
const type = editor.getType(KEYS.table);
@@ -44,6 +45,12 @@ export const deleteTableMergeColumn = (editor: SlateEditor) => {
4445
const { col: deletingColIndex } = getCellIndices(editor, selectedCell);
4546
const colsDeleteNumber = api.table.getColSpan(selectedCell);
4647

48+
if (getTableMergedColumnCount(table) <= colsDeleteNumber) {
49+
editor.tf.removeNodes({ at: tableEntry[1] });
50+
51+
return;
52+
}
53+
4754
const endingColIndex = deletingColIndex + colsDeleteNumber - 1;
4855

4956
const rowNumber = table.children.length;

0 commit comments

Comments
 (0)