diff --git a/.changeset/mean-taxis-tie.md b/.changeset/mean-taxis-tie.md deleted file mode 100644 index 8cd353a316..0000000000 --- a/.changeset/mean-taxis-tie.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'@udecode/plate-ui': minor ---- - -- add support for custom tailwind prefix -- minify build diff --git a/apps/www/public/registry/themes.css b/apps/www/public/registry/themes.css index d3f75bc426..c4078e8014 100644 --- a/apps/www/public/registry/themes.css +++ b/apps/www/public/registry/themes.css @@ -24,7 +24,7 @@ --accent: 240 4.8% 95.9%; --accent-foreground: 240 5.9% 10%; - --destructive: 0 84.2% 60.2%; + --destructive: 0 72.22% 50.59%; --destructive-foreground: 0 0% 98%; --ring: 240 5.9% 10%; @@ -88,7 +88,7 @@ --accent: 210 40% 96.1%; --accent-foreground: 222.2 47.4% 11.2%; - --destructive: 0 84.2% 60.2%; + --destructive: 0 72.22% 50.59%; --destructive-foreground: 210 40% 98%; --ring: 215 20.2% 65.1%; @@ -152,7 +152,7 @@ --accent: 60 4.8% 95.9%; --accent-foreground: 24 9.8% 10%; - --destructive: 0 84.2% 60.2%; + --destructive: 0 72.22% 50.59%; --destructive-foreground: 60 9.1% 97.8%; --ring: 20 14.3% 4.1%; @@ -216,7 +216,7 @@ --accent: 220 14.3% 95.9%; --accent-foreground: 220.9 39.3% 11%; - --destructive: 0 84.2% 60.2%; + --destructive: 0 72.22% 50.59%; --destructive-foreground: 210 20% 98%; --ring: 224 71.4% 4.1%; @@ -280,7 +280,7 @@ --accent: 0 0% 96.1%; --accent-foreground: 0 0% 9%; - --destructive: 0 84.2% 60.2%; + --destructive: 0 72.22% 50.59%; --destructive-foreground: 0 0% 98%; --ring: 0 0% 3.9%; @@ -344,7 +344,7 @@ --accent: 0 0% 96.1%; --accent-foreground: 0 0% 9%; - --destructive: 0 84.2% 60.2%; + --destructive: 0 72.22% 50.59%; --destructive-foreground: 0 0% 98%; --ring: 0 72.2% 50.6%; @@ -408,7 +408,7 @@ --accent: 240 4.8% 95.9%; --accent-foreground: 240 5.9% 10%; - --destructive: 0 84.2% 60.2%; + --destructive: 0 72.22% 50.59%; --destructive-foreground: 0 0% 98%; --ring: 346.8 77.2% 49.8%; @@ -472,7 +472,7 @@ --accent: 60 4.8% 95.9%; --accent-foreground: 24 9.8% 10%; - --destructive: 0 84.2% 60.2%; + --destructive: 0 72.22% 50.59%; --destructive-foreground: 60 9.1% 97.8%; --ring: 24.6 95% 53.1%; @@ -536,7 +536,7 @@ --accent: 240 4.8% 95.9%; --accent-foreground: 240 5.9% 10%; - --destructive: 0 84.2% 60.2%; + --destructive: 0 72.22% 50.59%; --destructive-foreground: 0 0% 98%; --ring: 142.1 76.2% 36.3%; @@ -600,7 +600,7 @@ --accent: 210 40% 96.1%; --accent-foreground: 222.2 47.4% 11.2%; - --destructive: 0 84.2% 60.2%; + --destructive: 0 72.22% 50.59%; --destructive-foreground: 210 40% 98%; --ring: 221.2 83.2% 53.3%; @@ -664,7 +664,7 @@ --accent: 60 4.8% 95.9%; --accent-foreground: 24 9.8% 10%; - --destructive: 0 84.2% 60.2%; + --destructive: 0 72.22% 50.59%; --destructive-foreground: 60 9.1% 97.8%; --ring: 20 14.3% 4.1%; @@ -728,7 +728,7 @@ --accent: 220 14.3% 95.9%; --accent-foreground: 220.9 39.3% 11%; - --destructive: 0 84.2% 60.2%; + --destructive: 0 72.22% 50.59%; --destructive-foreground: 210 20% 98%; --ring: 262.1 83.3% 57.8%; diff --git a/packages/cli/CHANGELOG.md b/packages/cli/CHANGELOG.md index 8321b9d7f7..e0b6a1805b 100644 --- a/packages/cli/CHANGELOG.md +++ b/packages/cli/CHANGELOG.md @@ -1,5 +1,13 @@ # @udecode/plate-ui +## 28.1.0 + +### Minor Changes + +- [#2824](https://github.com/udecode/plate/pull/2824) by [@zbeyens](https://github.com/zbeyens) – + - add support for custom tailwind prefix + - minify build + ## 24.1.1 ### Patch Changes diff --git a/packages/cli/package.json b/packages/cli/package.json index d0191f810f..e030932aaa 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@udecode/plate-ui", - "version": "24.1.1", + "version": "28.1.0", "description": "Add Plate components to your apps.", "license": "MIT", "homepage": "https://platejs.org", diff --git a/packages/plate/CHANGELOG.md b/packages/plate/CHANGELOG.md index e05e0bd1da..87838c2d4d 100644 --- a/packages/plate/CHANGELOG.md +++ b/packages/plate/CHANGELOG.md @@ -1,5 +1,7 @@ # @udecode/plate +## 28.1.1 + ## 28.0.0 ## 27.0.4 @@ -276,9 +278,9 @@ - due to esm issues, dnd plugin is not part of plate package anymore. To use it, install `@udecode/plate-ui-dnd` ```ts // before - import { createDndPlugin } from '@udecode/plate'; + import { createDndPlugin } from "@udecode/plate"; // after - import { createDndPlugin } from '@udecode/plate-ui-dnd'; + import { createDndPlugin } from "@udecode/plate-ui-dnd"; ``` - upgrade peerDeps: ```json diff --git a/packages/plate/package.json b/packages/plate/package.json index 48eab530ce..ebb458b420 100644 --- a/packages/plate/package.json +++ b/packages/plate/package.json @@ -1,6 +1,6 @@ { "name": "@udecode/plate", - "version": "28.0.0", + "version": "28.1.1", "description": "Plate – a plugin system for slate", "license": "MIT", "homepage": "https://platejs.org", @@ -72,13 +72,13 @@ "@udecode/plate-reset-node": "28.0.0", "@udecode/plate-resizable": "28.0.0", "@udecode/plate-select": "28.0.0", - "@udecode/plate-serializer-csv": "28.0.0", - "@udecode/plate-serializer-docx": "28.0.0", + "@udecode/plate-serializer-csv": "28.1.1", + "@udecode/plate-serializer-docx": "28.1.1", "@udecode/plate-serializer-html": "28.0.0", "@udecode/plate-serializer-md": "28.0.0", "@udecode/plate-suggestion": "28.0.0", "@udecode/plate-tabbable": "28.0.0", - "@udecode/plate-table": "28.0.0", + "@udecode/plate-table": "28.1.1", "@udecode/plate-trailing-block": "28.0.0" }, "peerDependencies": { diff --git a/packages/serializer-csv/CHANGELOG.md b/packages/serializer-csv/CHANGELOG.md index 065a684fcd..f980bd91e5 100644 --- a/packages/serializer-csv/CHANGELOG.md +++ b/packages/serializer-csv/CHANGELOG.md @@ -1,5 +1,7 @@ # @udecode/plate-serializer-csv +## 28.1.1 + ## 28.0.0 ## 27.0.3 diff --git a/packages/serializer-csv/package.json b/packages/serializer-csv/package.json index b25ca560eb..36ef702985 100644 --- a/packages/serializer-csv/package.json +++ b/packages/serializer-csv/package.json @@ -1,6 +1,6 @@ { "name": "@udecode/plate-serializer-csv", - "version": "28.0.0", + "version": "28.1.1", "description": "CSV serializer plugin for Plate", "license": "MIT", "homepage": "https://platejs.org", @@ -40,7 +40,7 @@ }, "dependencies": { "@udecode/plate-common": "28.0.0", - "@udecode/plate-table": "28.0.0", + "@udecode/plate-table": "28.1.1", "papaparse": "^5.4.1" }, "peerDependencies": { diff --git a/packages/serializer-docx/CHANGELOG.md b/packages/serializer-docx/CHANGELOG.md index 0e6bb8da04..d77dfd5d8a 100644 --- a/packages/serializer-docx/CHANGELOG.md +++ b/packages/serializer-docx/CHANGELOG.md @@ -1,5 +1,7 @@ # @udecode/plate-docx-serializer +## 28.1.1 + ## 28.0.0 ## 27.0.3 diff --git a/packages/serializer-docx/package.json b/packages/serializer-docx/package.json index f800cf5e58..c28b4764eb 100644 --- a/packages/serializer-docx/package.json +++ b/packages/serializer-docx/package.json @@ -1,6 +1,6 @@ { "name": "@udecode/plate-serializer-docx", - "version": "28.0.0", + "version": "28.1.1", "description": "Docx serializer plugin for Plate", "license": "MIT", "homepage": "https://platejs.org", @@ -45,7 +45,7 @@ "@udecode/plate-indent-list": "28.0.0", "@udecode/plate-media": "28.0.0", "@udecode/plate-paragraph": "28.0.0", - "@udecode/plate-table": "28.0.0", + "@udecode/plate-table": "28.1.1", "validator": "^13.9.0" }, "peerDependencies": { diff --git a/packages/table/CHANGELOG.md b/packages/table/CHANGELOG.md index b549cc58a6..81ab13a513 100644 --- a/packages/table/CHANGELOG.md +++ b/packages/table/CHANGELOG.md @@ -1,5 +1,13 @@ # @udecode/plate-table +## 28.1.1 + +### Patch Changes + +- [#2832](https://github.com/udecode/plate/pull/2832) by [@dimaanj](https://github.com/dimaanj) – + - Fix: merge of header cells in table + - Fix: #2831 + ## 28.0.0 ### Patch Changes diff --git a/packages/table/package.json b/packages/table/package.json index 62c77b1567..b83994810f 100644 --- a/packages/table/package.json +++ b/packages/table/package.json @@ -1,6 +1,6 @@ { "name": "@udecode/plate-table", - "version": "28.0.0", + "version": "28.1.1", "description": "Table plugin for Plate", "license": "MIT", "homepage": "https://platejs.org", diff --git a/packages/table/src/components/TableCellElement/useTableCellElementState.ts b/packages/table/src/components/TableCellElement/useTableCellElementState.ts index 023a163b22..12c3a644ff 100644 --- a/packages/table/src/components/TableCellElement/useTableCellElementState.ts +++ b/packages/table/src/components/TableCellElement/useTableCellElementState.ts @@ -71,7 +71,7 @@ export const useTableCellElementState = ({ const rowIndex = getTableRowIndex(editor, cellElement); const rowSize = - rowSizeOverrides.get(rowIndex) ?? rowElement?.size ?? undefined; + rowSizeOverrides.get?.(rowIndex) ?? rowElement?.size ?? undefined; const isFirstCell = colIndex === 0; const isFirstRow = tableElement.children?.[0] === rowElement; @@ -115,7 +115,7 @@ export const useTableCellElementState = ({ const endingColIndex = colIndex + colSpan - 1; const rowSize = - rowSizeOverrides.get(endingRowIndex) ?? rowElement?.size ?? undefined; + rowSizeOverrides.get?.(endingRowIndex) ?? rowElement?.size ?? undefined; const isFirstCell = colIndex === 0; const isFirstRow = tableElement.children?.[0] === rowElement; diff --git a/packages/table/src/merge/mergeTableCells.ts b/packages/table/src/merge/mergeTableCells.ts index 45553400c5..1cab0d1aea 100644 --- a/packages/table/src/merge/mergeTableCells.ts +++ b/packages/table/src/merge/mergeTableCells.ts @@ -1,4 +1,5 @@ import { + collapseSelection, getBlockAbove, getPluginOptions, getPluginType, @@ -10,7 +11,7 @@ import { } from '@udecode/plate-common'; import { cloneDeep } from 'lodash'; -import { ELEMENT_TABLE } from '../createTablePlugin'; +import { ELEMENT_TABLE, ELEMENT_TH } from '../createTablePlugin'; import { getTableGridAbove } from '../queries'; import { getColSpan } from '../queries/getColSpan'; import { getRowSpan } from '../queries/getRowSpan'; @@ -78,14 +79,7 @@ export const mergeTableCells = ( // and values are an array of all paths with that column const cols: { [key: string]: number[][] } = {}; - // A boolean to keep track if we have a header cell among the cells we are merging - let hasHeaderCell = false; - cellEntries.forEach(([entry, path]) => { - if (!hasHeaderCell && entry.type === 'table_header_cell') { - hasHeaderCell = true; - } - const rowIndex = path.at(-2)!; if (cols[rowIndex]) { @@ -107,7 +101,7 @@ export const mergeTableCells = ( // calculated colSpan and rowSpan attributes and combined content const mergedCell = { ...getEmptyCellNode(editor, { - header: cellEntries[0][0].type === 'th', + header: cellEntries[0][0].type === getPluginType(editor, ELEMENT_TH), newCellChildren: contents, }), colSpan, @@ -116,5 +110,6 @@ export const mergeTableCells = ( // insert the new merged cell in place of the first cell in the selection insertElements(editor, mergedCell, { at: cellEntries[0][1] }); + collapseSelection(editor); }); }; diff --git a/packages/table/src/merge/unmergeTableCells.ts b/packages/table/src/merge/unmergeTableCells.ts index a0451d9768..40e5400938 100644 --- a/packages/table/src/merge/unmergeTableCells.ts +++ b/packages/table/src/merge/unmergeTableCells.ts @@ -10,7 +10,7 @@ import { withoutNormalizing, } from '@udecode/plate-common'; -import { ELEMENT_TABLE, ELEMENT_TR } from '../createTablePlugin'; +import { ELEMENT_TABLE, ELEMENT_TH, ELEMENT_TR } from '../createTablePlugin'; import { getTableGridAbove } from '../queries'; import { getColSpan } from '../queries/getColSpan'; import { getRowSpan } from '../queries/getRowSpan'; @@ -34,7 +34,7 @@ export const unmergeTableCells = ( const createEmptyCell = (children?: TDescendant[]) => { return { ...getEmptyCellNode(editor, { - header: cellElem.type === 'th', + header: cellElem.type === getPluginType(editor, ELEMENT_TH), newCellChildren: children, }), colSpan: 1, diff --git a/packages/table/src/queries/getTableOverriddenColSizes.ts b/packages/table/src/queries/getTableOverriddenColSizes.ts index c9e5b96a03..baaf4cb0b8 100644 --- a/packages/table/src/queries/getTableOverriddenColSizes.ts +++ b/packages/table/src/queries/getTableOverriddenColSizes.ts @@ -16,7 +16,7 @@ export const getTableOverriddenColSizes = ( tableNode.colSizes ? [...tableNode.colSizes] : (Array.from({ length: colCount }).fill(0) as number[]) - ).map((size, index) => colSizeOverrides?.get(index) ?? size); + ).map((size, index) => colSizeOverrides?.get?.(index) ?? size); return colSizes; }; diff --git a/packages/table/src/transforms/insertTableRow.ts b/packages/table/src/transforms/insertTableRow.ts index 3e520d0093..1b2eb45bdf 100644 --- a/packages/table/src/transforms/insertTableRow.ts +++ b/packages/table/src/transforms/insertTableRow.ts @@ -70,7 +70,7 @@ export const insertTableRow = ( const isHeaderColumn = !hasSingleRow && (tableEntry[0].children as TElement[]).every( - (n) => n.children[i].type === ELEMENT_TH + (n) => n.children[i].type === getPluginType(editor, ELEMENT_TH) ); return getEmptyCellNode(editor, { header: header ?? isHeaderColumn,