Skip to content

Commit

Permalink
Merge pull request #3830 from udecode/plate/view
Browse files Browse the repository at this point in the history
Plate Static
  • Loading branch information
felixfeng33 authored Dec 19, 2024
2 parents 091beed + 5f180fb commit 6ec5deb
Show file tree
Hide file tree
Showing 339 changed files with 5,539 additions and 3,251 deletions.
6 changes: 6 additions & 0 deletions .changeset/base.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@udecode/plate-table': patch
'@udecode/plate-link': patch
---

Move `node.props` plugin attributes from `/react` to `/`
13 changes: 13 additions & 0 deletions .changeset/core-minor.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
'@udecode/plate-core': minor
---

## @udecode/plate-core@40.1.0

### Minor Changes

- [#3744](https://github.com/udecode/plate/pull/3744) by [@zbeyens](https://github.com/zbeyens)
- Add `PlateStatic`, `SlateElement`, `SlateLeaf` components for static rendering and server-side HTML serialization
- Add `serializeHtml` function to serialize editor content to HTML. Deprecating `@udecode/plate-html` in favor of core serialization.
- Move from `PlatePlugin` (`/react`) to `BasePlugin` (`/`): `node.component`, `render.aboveEditable`, `render.aboveSlate`, `render.node`
- Add to `SlatePlugin`: `node.props`, `render.aboveNodes`, `render.belowNodes`, `render.afterEditable`, `render.beforeEditable`, `render.node`
16 changes: 16 additions & 0 deletions .changeset/findNodePath.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
'@udecode/plate-indent-list': patch
'@udecode/plate-utils': patch
'@udecode/plate-code-block': patch
'@udecode/plate-resizable': patch
'@udecode/plate-selection': patch
'@udecode/plate-combobox': patch
'@udecode/plate-tabbable': patch
'@udecode/plate-caption': patch
'@udecode/plate-layout': patch
'@udecode/plate-table': patch
'@udecode/plate-list': patch
'@udecode/plate-dnd': patch
---

Replace `findNodePath` with `findPath`
5 changes: 5 additions & 0 deletions .changeset/link.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@udecode/plate-link': patch
---

- Fix floating link url input being focused when focusing the placeholder input
6 changes: 6 additions & 0 deletions .changeset/list-major.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@udecode/plate-indent-list': major
---

- Move `render.belowNodes` from `IndentListPlugin` to `BaseIndentListPlugin`. Props type for `listStyleTypes.liComponent` and `listStyleTypes.markerComponent` options is now `SlateRenderElementProps` instead of `PlateRenderElementProps`
- Move `someIndentList`, `someIndentTodo` from `@udecode/plate-indent-list/react` to `@udecode/plate-indent-list`
12 changes: 12 additions & 0 deletions .changeset/slate-react major.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
'@udecode/slate-react': major
---

Rename `findNodePath` to `findPath` since the addition of `findNodePath` in the headless lib.

We recommend using `findPath` mostly when subscribing to its value (e.g. in a React component) as it has O(path.length) complexity, compared to O(n) for the traversal-based `findNodePath`. This optimization is particularly important in:

- Render functions of Plate components where using `findNodePath` would increase the initial render time by O(n²)
- Key press handlers where using `findNodePath` would increase the handling time by O(n)

where n is the number of nodes in the editor.
5 changes: 5 additions & 0 deletions .changeset/slate-react.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@udecode/slate-react': patch
---

Update `TRenderElementProps`, `TRenderLeafProps` types
9 changes: 9 additions & 0 deletions .changeset/slate.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
'@udecode/slate': minor
---

Add `findNodePath` - a traversal-based node path finder with O(n) complexity. This is the headless alternative to `findPath` from `@udecode/slate-react`, recommended for:

- Non-React contexts
- Plugin logic that doesn't require React dependencies
- Non-performance-critical paths where O(n) traversal is acceptable
27 changes: 27 additions & 0 deletions .changeset/table-major.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
'@udecode/plate-table': major
---

Move from `@udecode/plate-table/react` to `@udecode/plate-table`:

- `deleteColumn`
- `deleteColumnWhenExpanded`
- `deleteRow`
- `deleteRowWhenExpanded`
- `getTableColumn`
- `getTableGridAbove`
- `getTableGridByRange`
- `getTableRow`
- `insertTable`
- `mergeTableCells`
- `moveSelectionFromCell`
- `overrideSelectionFromCell`
- `unmergeTableCells`
- `withDeleteTable`
- `withGetFragmentlable`
- `withInsertFragmentTable`
- `withInsertTextTable`
- `withMarkTable`
- `withSelectionTable`
- `withSetFragmentDataTable`
- `withTable`
2 changes: 1 addition & 1 deletion .github/workflows/registry.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
key: packages-cache-${{ runner.os }}-${{ hashFiles('yarn.lock') }}

- name: 🏗 Build Registry
run: yarn build:registry
run: yarn build:registry && yarn build:tw

- name: ◻️ Create Pull Request
uses: peter-evans/create-pull-request@v4
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
!.yarn/releases
!.yarn/sdks
!.yarn/versions
.repo_ignore

**/traceDir

Expand Down
2 changes: 1 addition & 1 deletion apps/www/content/docs/api/slate-react.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Find the corresponding documentation in the [Slate React docs](https://docs.slat

### `findNodeKey`

### `findNodePath`
### `findPath`

### `focusEditor`

Expand Down
12 changes: 12 additions & 0 deletions apps/www/content/docs/components/changelog.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,18 @@ Use the [CLI](https://platejs.org/docs/components/cli) to install the latest ver

## December 2024 #17

### December 19 #17.2

Plate 41

- New RSC components for element and leaf components, filename ending with `-static.tsx`. Those are now added along with the default client components.
- `editor`: add `select-text` to `editorVariants`
- `date-element`: remove popover when read-only
- `indent-todo-marker`: use `SlateRenderElementProps` type instead of `PlateRenderElementProps`
- `hr-element`, `media-audio-element`, `media-embed-element`, `mention-element`: improve cursor styling
- `media-file-element`: use `<a>` instead of `div` + `onClick`
- all element and leaf components: `className` prop is now placed before inline prop.

### December 16 #17.1

- `column-element`:
Expand Down
5 changes: 0 additions & 5 deletions apps/www/content/docs/examples/iframe.mdx

This file was deleted.

Loading

0 comments on commit 6ec5deb

Please sign in to comment.