-
-
Notifications
You must be signed in to change notification settings - Fork 742
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3809 from udecode/feat/editor-select
Select editor
- Loading branch information
Showing
98 changed files
with
3,731 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@udecode/slate-utils': patch | ||
--- | ||
|
||
- Add `removeEditorText`: Remove non-empty editor text nodes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@udecode/plate-tag': patch | ||
--- | ||
|
||
- New plugins: `TagPlugin`, `MultiSelectPlugin` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@udecode/plate-utils': patch | ||
--- | ||
|
||
- Add `useEditorString`: Subscribes to the editor string on each change |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@udecode/plate-core': patch | ||
--- | ||
|
||
- `PlateContent` new prop - `autoFocusOnEditable`: Autofocus when it becomes editable (readOnly false -> readOnly true) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@udecode/plate-media': patch | ||
--- | ||
|
||
Fix README |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
--- | ||
title: Multi Select | ||
docs: | ||
- route: /docs/components/tag-element | ||
- route: /docs/components/select-editor | ||
--- | ||
|
||
<ComponentPreview name="select-editor-demo" /> | ||
|
||
<PackageInfo> | ||
|
||
## Features | ||
|
||
- Inline selectable elements with keyboard navigation | ||
- Multi-item selection support | ||
- Automatic cleanup of surrounding text | ||
- Duplicate prevention | ||
- Customizable rendering and behavior | ||
- Built on top of the Tag plugin infrastructure | ||
- Keyboard shortcuts for quick selection and navigation | ||
|
||
</PackageInfo> | ||
|
||
## Installation | ||
|
||
```bash | ||
npm install @udecode/plate-tag | ||
``` | ||
|
||
## Usage | ||
|
||
```tsx | ||
import { MultiSelectPlugin } from '@udecode/plate-tag/react'; | ||
import { TagElement } from '@/components/plate-ui/tag-element'; | ||
import { | ||
SelectEditor, | ||
SelectEditorContent, | ||
SelectEditorInput, | ||
SelectEditorCombobox, | ||
type SelectItem, | ||
} from '@/components/plate-ui/select-editor'; | ||
|
||
// Define your items | ||
const ITEMS: SelectItem[] = [ | ||
{ value: 'React' }, | ||
{ value: 'TypeScript' }, | ||
{ value: 'JavaScript' }, | ||
]; | ||
|
||
export default function MySelectEditor() { | ||
const [value, setValue] = React.useState<SelectItem[]>([ITEMS[0]]); | ||
|
||
return ( | ||
<SelectEditor | ||
value={value} | ||
onValueChange={setValue} | ||
items={ITEMS} | ||
> | ||
<SelectEditorContent> | ||
<SelectEditorInput placeholder="Select items..." /> | ||
<SelectEditorCombobox /> | ||
</SelectEditorContent> | ||
</SelectEditor> | ||
); | ||
} | ||
``` | ||
|
||
- [TagElement](/docs/components/tag-element) | ||
- [SelectEditor](/docs/components/select-editor) | ||
|
||
## Plugins | ||
|
||
### MultiSelectPlugin | ||
|
||
Handling multi-select elements in the editor. Built on top of TagPlugin. | ||
|
||
<APIOptions> | ||
<APIItem name="type" type="string" optional> | ||
The type identifier for multi-select elements. | ||
|
||
- **Default:** `'multi-select'` | ||
</APIItem> | ||
</APIOptions> | ||
|
||
### TagPlugin | ||
|
||
Inline void element plugin. | ||
|
||
## API |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
title: Tag | ||
docs: | ||
- route: /docs/components/tag-element | ||
title: Tag Element | ||
--- | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.