Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 0 additions & 77 deletions .changeset/remove-change-observable.md

This file was deleted.

9 changes: 0 additions & 9 deletions .changeset/remove-editor-change.md

This file was deleted.

13 changes: 0 additions & 13 deletions .changeset/remove-sanity-dependencies.md

This file was deleted.

9 changes: 0 additions & 9 deletions .changeset/remove-unused-type-exports.md

This file was deleted.

99 changes: 99 additions & 0 deletions packages/editor/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,104 @@
# Changelog

## 6.0.0

### Major Changes

- [#2184](https://github.com/portabletext/editor/pull/2184) [`79b69a5`](https://github.com/portabletext/editor/commit/79b69a5cd7f5a19d4393453b993611916ab86a95) Thanks [@christianhg](https://github.com/christianhg)! - feat!: remove `change$` observable and `rxjs` dependency

The `PortableTextEditor.change$` observable isn't used internally anymore. It's
purely a legacy public API that allows consumers to read editor changes/events
through an Observable rather than through the ordinary subscription API. This
does not justify declaring `rxjs` as a peer dependency of PTE and therefore
this commit removes the `change$` Observable along with the `rxjs` dependency.

BREAKING CHANGES:
- Removed `PortableTextEditor.change$` property
- Removed `EditorChanges` type export (`Subject<EditorChange>`)
- Removed `PatchObservable` type export (`Observable<...>`)
- Removed `rxjs` from peerDependencies

Migration: Replace `change$.subscribe()` with `editor.on()` or
`<EventListenerPlugin on={...} />`. Every active `EditorChange` type
has a 1:1 equivalent in the new event API.

What's preserved:
- `PortableTextEditor` class (separate deprecation path)
- All static methods and `schemaTypes` property

### Migration

Replace `change$.subscribe()` with `editor.on()` or `<EventListenerPlugin>`:

**Before (rxjs):**

```tsx
import {usePortableTextEditor} from '@portabletext/editor'

const editor = usePortableTextEditor()

useEffect(() => {
const sub = editor.change$.subscribe((change) => {
if (change.type === 'mutation') {
// ...
}
})
return () => sub.unsubscribe()
}, [editor])
```

**After (editor.on):**

```tsx
import {useEditor} from '@portabletext/editor'

const editor = useEditor()

useEffect(() => {
const unsubscribe = editor.on('mutation', (event) => {
// ...
})
return unsubscribe
}, [editor])
```

**After (EventListenerPlugin):**

```tsx
import {EventListenerPlugin} from '@portabletext/editor/plugins'

;<EventListenerPlugin
on={(event) => {
if (event.type === 'mutation') {
// ...
}
}}
/>
```

Every active `EditorChange` type has a 1:1 equivalent in the new event API. See the [event listener documentation](https://www.portabletext.org/reference/event-listener-plugin/) for details.

- [#2244](https://github.com/portabletext/editor/pull/2244) [`5a3e8bf`](https://github.com/portabletext/editor/commit/5a3e8bf33d9591b9cfbf310e37ae95f736862942) Thanks [@christianhg](https://github.com/christianhg)! - feat!: remove `EditorChange` type

The `EditorChange` type and its variant types (`BlurChange`, `ConnectionChange`, `LoadingChange`, `MutationChange`) have been removed. `EditorChange` was the event type emitted by the removed `PortableTextEditor` React component and consumed by the `onChange` callback on the `PortableTextEditor` class.

Use `editor.on()` instead: `editor.on('value changed', ...)`, `editor.on('focused', ...)`, `editor.on('blurred', ...)`, `editor.on('selection', ...)`.

- [#2136](https://github.com/portabletext/editor/pull/2136) [`2f8d366`](https://github.com/portabletext/editor/commit/2f8d36694ddad97a5b1ca910ffc7f7e60937c642) Thanks [@christianhg](https://github.com/christianhg)! - feat!: remove `@sanity/*` dependencies

BREAKING CHANGES:
- `EditorConfig` no longer accepts `schema` — use `schemaDefinition` instead
- `PortableTextMemberSchemaTypes` removed from exports (available from `@portabletext/sanity-bridge`)
- `PasteData.schemaTypes` type changed from `PortableTextMemberSchemaTypes` to `EditorSchema`
- Render prop `schemaType` fields now use PTE schema types (`BlockObjectSchemaType`, `InlineObjectSchemaType`, `AnnotationSchemaType`, `DecoratorSchemaType`, `ListSchemaType`, `StyleSchemaType`) instead of Sanity types (`ObjectSchemaType`, `BlockDecoratorDefinition`, `BlockListDefinition`, `BlockStyleDefinition`)
- Deprecated `type` prop removed from `BlockRenderProps`, `BlockChildRenderProps`, `BlockAnnotationRenderProps`, and `BlockDecoratorRenderProps`

- [#2245](https://github.com/portabletext/editor/pull/2245) [`3ce0561`](https://github.com/portabletext/editor/commit/3ce056153812bf75c3d95a452417f1f7e45f352e) Thanks [@christianhg](https://github.com/christianhg)! - feat!: remove `EditableAPI` and `OnBeforeInputFn` type exports

`EditableAPI` is an internal interface backing the `PortableTextEditor` static methods, never intended for public use. It was accidentally exported to fix typedoc resolution. `OnBeforeInputFn` was the callback type for the `onBeforeInput` prop, which has since been removed.

The static methods on `PortableTextEditor` still work as before. Only the type exports are removed.

## 5.1.1

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/editor/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@portabletext/editor",
"version": "5.1.1",
"version": "6.0.0",
"description": "Portable Text Editor made in React",
"keywords": [
"sanity",
Expand Down
7 changes: 7 additions & 0 deletions packages/plugin-character-pair-decorator/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## 7.0.0

### Patch Changes

- Updated dependencies [[`79b69a5`](https://github.com/portabletext/editor/commit/79b69a5cd7f5a19d4393453b993611916ab86a95), [`5a3e8bf`](https://github.com/portabletext/editor/commit/5a3e8bf33d9591b9cfbf310e37ae95f736862942), [`2f8d366`](https://github.com/portabletext/editor/commit/2f8d36694ddad97a5b1ca910ffc7f7e60937c642), [`3ce0561`](https://github.com/portabletext/editor/commit/3ce056153812bf75c3d95a452417f1f7e45f352e)]:
- @portabletext/editor@6.0.0

## 6.0.6

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-character-pair-decorator/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@portabletext/plugin-character-pair-decorator",
"version": "6.0.6",
"version": "7.0.0",
"description": "Automatically match a pair of characters and decorate the text in between",
"keywords": [
"portabletext",
Expand Down
8 changes: 8 additions & 0 deletions packages/plugin-emoji-picker/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# @portabletext/plugin-emoji-picker

## 6.0.0

### Patch Changes

- Updated dependencies [[`79b69a5`](https://github.com/portabletext/editor/commit/79b69a5cd7f5a19d4393453b993611916ab86a95), [`5a3e8bf`](https://github.com/portabletext/editor/commit/5a3e8bf33d9591b9cfbf310e37ae95f736862942), [`2f8d366`](https://github.com/portabletext/editor/commit/2f8d36694ddad97a5b1ca910ffc7f7e60937c642), [`3ce0561`](https://github.com/portabletext/editor/commit/3ce056153812bf75c3d95a452417f1f7e45f352e)]:
- @portabletext/editor@6.0.0
- @portabletext/plugin-input-rule@4.0.0

## 5.0.6

### Patch Changes
Expand Down
4 changes: 2 additions & 2 deletions packages/plugin-emoji-picker/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@portabletext/plugin-emoji-picker",
"version": "5.0.6",
"version": "6.0.0",
"description": "Easily configure an Emoji Picker for the Portable Text Editor",
"keywords": [
"portabletext",
Expand Down Expand Up @@ -77,7 +77,7 @@
"vitest": "^4.0.18"
},
"peerDependencies": {
"@portabletext/editor": "workspace:^5.1.1",
"@portabletext/editor": "workspace:^6.0.0",
"react": "^19.2"
},
"engines": {
Expand Down
7 changes: 7 additions & 0 deletions packages/plugin-input-rule/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @portabletext/plugin-input-rule

## 4.0.0

### Patch Changes

- Updated dependencies [[`79b69a5`](https://github.com/portabletext/editor/commit/79b69a5cd7f5a19d4393453b993611916ab86a95), [`5a3e8bf`](https://github.com/portabletext/editor/commit/5a3e8bf33d9591b9cfbf310e37ae95f736862942), [`2f8d366`](https://github.com/portabletext/editor/commit/2f8d36694ddad97a5b1ca910ffc7f7e60937c642), [`3ce0561`](https://github.com/portabletext/editor/commit/3ce056153812bf75c3d95a452417f1f7e45f352e)]:
- @portabletext/editor@6.0.0

## 3.0.6

### Patch Changes
Expand Down
4 changes: 2 additions & 2 deletions packages/plugin-input-rule/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@portabletext/plugin-input-rule",
"version": "3.0.6",
"version": "4.0.0",
"description": "Easily configure input rules in the Portable Text Editor",
"keywords": [
"portabletext",
Expand Down Expand Up @@ -75,7 +75,7 @@
"vitest": "^4.0.18"
},
"peerDependencies": {
"@portabletext/editor": "workspace:^5.1.1",
"@portabletext/editor": "workspace:^6.0.0",
"react": "^19.2"
},
"engines": {
Expand Down
9 changes: 9 additions & 0 deletions packages/plugin-markdown-shortcuts/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Changelog

## 7.0.0

### Patch Changes

- Updated dependencies [[`79b69a5`](https://github.com/portabletext/editor/commit/79b69a5cd7f5a19d4393453b993611916ab86a95), [`5a3e8bf`](https://github.com/portabletext/editor/commit/5a3e8bf33d9591b9cfbf310e37ae95f736862942), [`2f8d366`](https://github.com/portabletext/editor/commit/2f8d36694ddad97a5b1ca910ffc7f7e60937c642), [`3ce0561`](https://github.com/portabletext/editor/commit/3ce056153812bf75c3d95a452417f1f7e45f352e)]:
- @portabletext/editor@6.0.0
- @portabletext/plugin-character-pair-decorator@7.0.0
- @portabletext/plugin-input-rule@4.0.0

## 6.0.6

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-markdown-shortcuts/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@portabletext/plugin-markdown-shortcuts",
"version": "6.0.6",
"version": "7.0.0",
"description": "Adds helpful Markdown shortcuts to the editor",
"keywords": [
"portabletext",
Expand Down
7 changes: 7 additions & 0 deletions packages/plugin-one-line/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## 6.0.0

### Patch Changes

- Updated dependencies [[`79b69a5`](https://github.com/portabletext/editor/commit/79b69a5cd7f5a19d4393453b993611916ab86a95), [`5a3e8bf`](https://github.com/portabletext/editor/commit/5a3e8bf33d9591b9cfbf310e37ae95f736862942), [`2f8d366`](https://github.com/portabletext/editor/commit/2f8d36694ddad97a5b1ca910ffc7f7e60937c642), [`3ce0561`](https://github.com/portabletext/editor/commit/3ce056153812bf75c3d95a452417f1f7e45f352e)]:
- @portabletext/editor@6.0.0

## 5.0.6

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-one-line/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@portabletext/plugin-one-line",
"version": "5.0.6",
"version": "6.0.0",
"description": "🤏 Restricts the Portable Text Editor to a single line",
"keywords": [
"portabletext",
Expand Down
7 changes: 7 additions & 0 deletions packages/plugin-paste-link/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @portabletext/plugin-paste-link

## 3.0.0

### Patch Changes

- Updated dependencies [[`79b69a5`](https://github.com/portabletext/editor/commit/79b69a5cd7f5a19d4393453b993611916ab86a95), [`5a3e8bf`](https://github.com/portabletext/editor/commit/5a3e8bf33d9591b9cfbf310e37ae95f736862942), [`2f8d366`](https://github.com/portabletext/editor/commit/2f8d36694ddad97a5b1ca910ffc7f7e60937c642), [`3ce0561`](https://github.com/portabletext/editor/commit/3ce056153812bf75c3d95a452417f1f7e45f352e)]:
- @portabletext/editor@6.0.0

## 2.0.6

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-paste-link/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@portabletext/plugin-paste-link",
"version": "2.0.6",
"version": "3.0.0",
"description": "Allows pasting links in the Portable Text Editor",
"keywords": [
"portabletext",
Expand Down
7 changes: 7 additions & 0 deletions packages/plugin-sdk-value/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## 6.0.0

### Patch Changes

- Updated dependencies [[`79b69a5`](https://github.com/portabletext/editor/commit/79b69a5cd7f5a19d4393453b993611916ab86a95), [`5a3e8bf`](https://github.com/portabletext/editor/commit/5a3e8bf33d9591b9cfbf310e37ae95f736862942), [`2f8d366`](https://github.com/portabletext/editor/commit/2f8d36694ddad97a5b1ca910ffc7f7e60937c642), [`3ce0561`](https://github.com/portabletext/editor/commit/3ce056153812bf75c3d95a452417f1f7e45f352e)]:
- @portabletext/editor@6.0.0

## 5.0.8

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-sdk-value/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@portabletext/plugin-sdk-value",
"version": "5.0.8",
"version": "6.0.0",
"description": "Synchronizes the Portable Text Editor value with the Sanity SDK, allowing for two-way editing.",
"keywords": [
"portabletext",
Expand Down
Loading
Loading