Skip to content

Commit

Permalink
Merge branch 'udecode:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
beeant0512 authored Dec 9, 2024
2 parents 1457a23 + d649052 commit f960861
Show file tree
Hide file tree
Showing 1,299 changed files with 33,096 additions and 20,655 deletions.
12 changes: 11 additions & 1 deletion .changeset/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,17 @@
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
"changelog": ["./changelog-config", { "repo": "udecode/plate" }],
"commit": false,
"linked": [["@udecode/*"]],
"linked": [
[
"@udecode/plate",
"@udecode/plate*",
"@udecode/slate",
"@udecode/slate*",
"@udecode/react*",
"@udecode/cn",
"@udecode/utils"
]
],
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
Expand Down
5 changes: 0 additions & 5 deletions .changeset/itchy-cups-wonder.md

This file was deleted.

8 changes: 8 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,14 @@ module.exports = {
'**/scripts/*.mts',
],
overrides: [
{
files: ['**/registry/default/**/*'],
rules: {
'jsx-a11y/iframe-has-title': 'off',
'jsx-a11y/media-has-caption': 'off',
'react/jsx-no-comment-textnodes': 'off',
},
},
{
files: ['*.ts', '*.tsx', '*.mts'],
parserOptions: {
Expand Down
32 changes: 32 additions & 0 deletions BREAKING_CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,37 @@
For older changelogs, see https://github.com/udecode/plate/blob/main/docs

# 40.0.0

## @udecode/slate-react@40.0.0

### Major Changes

- [#3744](https://github.com/udecode/plate/pull/3744) by [@zbeyens](https://github.com/zbeyens)
- Add `slate-dom` as a peer dependency.
- Update `slate-react` peer dependency to `>=0.111.0`

## @udecode/plate-ai@40.0.0

### Major Changes

- [#3744](https://github.com/udecode/plate/pull/3744) by [@zbeyens](https://github.com/zbeyens)
- Remove `scrollContainerSelector` option in favor of `useEditorContainerRef`

## @udecode/plate-heading@40.0.0

### Major Changes

- [#3744](https://github.com/udecode/plate/pull/3744) by [@zbeyens](https://github.com/zbeyens)
- Remove `scrollContainerSelector` option in favor of `useEditorContainerRef`

## @udecode/plate-layout@40.0.0

### Major Changes

- [#3744](https://github.com/udecode/plate/pull/3744) by [@zbeyens](https://github.com/zbeyens)
- Remove `toggleColumns` in favor of `toggleColumnGroup`
- Remove `insertEmptyColumn` in favor of `insertColumn`

# 39.0.0

## @udecode/plate-dnd@39.0.0
Expand Down
21 changes: 5 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,6 @@ Plate
<a target="_blank" href="https://discord.gg/mAZRuBzGM3"><img src="https://img.shields.io/badge/chat-on%20discord-7289da.svg?sanitize=true" /></a>
<a target="_blank" href="https://github.com/udecode/plate/blob/main/LICENSE"><img src="https://badgen.now.sh/badge/license/MIT" /></a>
</div>
<div align="center">
<a href="https://console.algora.io/org/Udecode/bounties/new">
<img style="border-radius: 100px;" height="24" src="https://img.shields.io/static/v1?labelColor=grey&color=6366f1&label=Algora&message=%F0%9F%92%8E+Bounty+issues&style=for-the-badge" alt="Udecode">
</a>

</div>
<div align="center">
<a href="https://vercel.com/?utm_source=udecode&utm_campaign=oss"><img height="24" src="https://styled-icons.dev/powered-by-vercel.svg" alt="Powered by Vercel" /></a>
</div>
</p>

![hero](apps/www/public/og.png)

Expand All @@ -35,12 +25,11 @@ Plate

You can choose one of the following templates to get started:

| Option | NextJS | Plate | Plugins | AI & Backend |
| --------------------------------------------------------------------------------- | ------ | ----- | ------- | ------------ |
| [Notion-like template](https://pro.platejs.org/docs/templates/potion) |||||
| [Plate playground template](https://github.com/udecode/plate-playground-template) |||| |
| [Plate minimal template](https://github.com/udecode/plate-template) ||| | |
| [NextJS template](https://platejs.org/docs/components/installation/next) || | | |
| Option | Plate | Plugins | AI | Backend |
| --------------------------------------------------------------------------------- | ----- | ------- | --- | ------- |
| [Notion-like template](https://pro.platejs.org/docs/templates/potion) |||||
| [Plate playground template](https://github.com/udecode/plate-playground-template) |||| |
| [Plate minimal template](https://github.com/udecode/plate-template) || | | |

## Documentation

Expand Down
19 changes: 1 addition & 18 deletions apps/www/content/docs/ai.mdx
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
---
title: AI
description: AI menu with commands, streaming responses in a preview or directly into the editor.
docs:
- route: https://pro.platejs.org/docs/examples/ai
title: AI
---

<ComponentPreview name="playground-demo" id="ai" />
<ComponentPreview name="ai-demo" />

<PackageInfo>

Expand Down Expand Up @@ -172,7 +171,6 @@ const plugins = [
? PROMPT_TEMPLATES.userSelecting
: PROMPT_TEMPLATES.userDefault;
},
scrollContainerSelector: '#scroll_container',
systemTemplate: ({ isBlockSelecting, isSelecting }) => {
return isBlockSelecting
? PROMPT_TEMPLATES.systemBlockSelecting
Expand All @@ -183,18 +181,11 @@ const plugins = [
},
render: { afterEditable: () => <AIMenu /> },
}),
SelectionOverlayPlugin,
];
```

- [AIMenu](/docs/components/ai-menu)

The [SelectionOverlayPlugin](https://pro.platejs.org/docs/components/cursor-overlay):

- Maintains selection highlight when editor loses focus
- Essential for AI menu and other external input interactions
- Prevents double selection with `data-plate-prevent-overlay` attribute

### AI SDK

This plugin is depending on the [ai](https://npmjs.com/package/ai) package:
Expand Down Expand Up @@ -278,14 +269,6 @@ Template for generating prompts. Supports placeholders:

</APIItem>

<APIItem name="scrollContainerSelector" type="string" optional>

CSS selector for scrollable container.

- **Default:** `'#scroll_container'`

</APIItem>

<APIItem name="systemTemplate" type="(props: EditorPromptParams) => string | void" optional>

Template for system messages. Supports same placeholders as `promptTemplate`.
Expand Down
4 changes: 2 additions & 2 deletions apps/www/content/docs/alignment.mdx
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
---
title: Alignment
description: Align your content to different positions.
docs:
- route: /docs/components/align-dropdown-menu
title: Align Dropdown Menu
---

<ComponentPreview name="playground-demo" id="align" />
<ComponentPreview name="align-demo" />

<PackageInfo>

Expand Down Expand Up @@ -66,6 +65,7 @@ The editor instance.
The alignment value.
</APISubListItem>
<APISubListItem parent="options" name="setNodesOptions" type="SetNodesOptions" optional>
Options for the `setNodes` function.
</APISubListItem>

</APISubList>
Expand Down
12 changes: 12 additions & 0 deletions apps/www/content/docs/api/core.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,18 @@ a
A new `PlatePlugin` with precise type control.
</APIReturns>

### useEditorContainerRef

Get the editor container DOM reference.

### useEditorScrollRef

Get the editor scroll container reference.

### useScrollRef

Get the editor scroll container reference. Returns the scroll ref if it exists, otherwise returns the container ref.

### useEditorPlugin

Get editor and plugin context.
Expand Down
22 changes: 22 additions & 0 deletions apps/www/content/docs/api/core/plate-plugin.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,28 @@ Defines how the plugin injects functionality into other plugins or the editor.
<APISubListItem parent="inject" name="nodeProps" type="InjectNodeProps<WithAnyKey<C>>" optional>
Properties used by Plate to inject props into any node component.
</APISubListItem>


<APISubListItem parent="inject" name="excludePlugins" type="string[]" optional>
An array of plugin keys to exclude from node prop injection.
</APISubListItem>

<APISubListItem parent="inject" name="excludeBelowPlugins" type="string[]" optional>
An array of plugin keys. Node prop injection will be excluded for any nodes that are descendants of elements with these plugin types.
</APISubListItem>
<APISubListItem parent="inject" name="isBlock" type="boolean" optional>
If true, only matches block elements. Used to restrict prop injection to block-level nodes.
</APISubListItem>

<APISubListItem parent="inject" name="isElement" type="boolean" optional>
If true, only matches element nodes. Used to restrict prop injection to element nodes.
</APISubListItem>
<APISubListItem parent="inject" name="isLeaf" type="boolean" optional>
If true, only matches leaf nodes. Used to restrict prop injection to leaf nodes.
</APISubListItem>
<APISubListItem parent="inject" name="maxLevel" type="number" optional>
Maximum nesting level for node prop injection. Nodes deeper than this level will not receive injected props.
</APISubListItem>
<APISubListItem parent="inject" name="plugins" type="Record<string, Partial<EditorPlatePlugin<AnyPluginConfig>>>" optional>
Property that can be used by a plugin to allow other plugins to inject code.
</APISubListItem>
Expand Down
5 changes: 4 additions & 1 deletion apps/www/content/docs/api/core/plate.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Controlled callback called when the editor state changes.
<APIItem name="onSelectionChange" type="(selection: Range | null) => void" optional>
Callback called when the editor selection changes.
</APIItem>
<APIItem name="onValueChange" type="(value: Value) => void" optional>
<APIItem name="onValueChange" type="({ value, editor }: { value: Value; editor: PlateEditor }) => void" optional>
Callback called when the editor value changes.
</APIItem>
<APIItem name="primary" type="boolean" optional>
Expand All @@ -49,6 +49,9 @@ Custom render function for leaf nodes.
Props for the [Editable](https://docs.slatejs.org/libraries/slate-react/editable) component. Extends `TextareaHTMLAttributes<HTMLDivElement>`.

<APIProps>
<APIItem name="autoFocusOnEditable" type="boolean" optional>
Automatically focus the editor when it transitions from read-only to editable mode (when `readOnly` changes from `true` to `false`).
</APIItem>
<APIItem name="renderEditable" type="(editable: ReactNode) => ReactNode" optional>
Custom `Editable` node.

Expand Down
4 changes: 4 additions & 0 deletions apps/www/content/docs/api/core/store.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ A unique ID used as a provider scope. Use it if you have multiple `Plate` in the
- **Default:** random id
</APIItem>

<APIItem name="containerRef" type="React.RefObject<HTMLDivElement>">
A reference to the editor container element.
</APIItem>

<APIItem name="decorate" type="function" optional>
Function used to decorate ranges in the editor.

Expand Down
Loading

0 comments on commit f960861

Please sign in to comment.