Skip to content

Commit 6e98cad

Browse files
Version Packages
1 parent c7efcdb commit 6e98cad

31 files changed

Lines changed: 150 additions & 80 deletions

File tree

.changeset/fast-falcons-wear.md

Lines changed: 0 additions & 7 deletions
This file was deleted.

.changeset/gfm-callout-support.md

Lines changed: 0 additions & 23 deletions
This file was deleted.

.changeset/is-text-block-node.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

.changeset/pretty-radios-leave.md

Lines changed: 0 additions & 9 deletions
This file was deleted.

.changeset/pt-native-traversal.md

Lines changed: 0 additions & 7 deletions
This file was deleted.

.changeset/silly-pigs-call.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

.changeset/text-plain-deserialize-data.md

Lines changed: 0 additions & 7 deletions
This file was deleted.

packages/editor/CHANGELOG.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,36 @@
11
# Changelog
22

3+
## 6.6.0
4+
5+
### Minor Changes
6+
7+
- [#2387](https://github.com/portabletext/editor/pull/2387) [`055bdb1`](https://github.com/portabletext/editor/commit/055bdb160eb0b4e83e291ac3bf508ed6865747b8) Thanks [@christianhg](https://github.com/christianhg)! - feat: simplify internal DOM mapping
8+
9+
Introduces a new `data-pt-path` attribute on editor DOM nodes to aid the mapping between the internal model and the DOM.
10+
11+
Path attributes use serialized paths like `data-pt-path="[_key=="k0"].children[_key=="s1"]"` for a text block span.
12+
13+
- [#2398](https://github.com/portabletext/editor/pull/2398) [`041fef0`](https://github.com/portabletext/editor/commit/041fef01c7663317e7e13fc9197536c23822709f) Thanks [@christianhg](https://github.com/christianhg)! - feat: internal Portable Text-native node traversal
14+
15+
Replaces the vendored Slate traversal system with schema-driven functions that resolve children on any node type, not just `.children`. The old system hardcoded `.children` as the only child field, which blocks first-class nesting where children will live in schema-defined fields like `rows`, `cells`, or `content`.
16+
17+
### Patch Changes
18+
19+
- [#2414](https://github.com/portabletext/editor/pull/2414) [`ff8220d`](https://github.com/portabletext/editor/commit/ff8220db49b8407664b06d840f3d20b393b0effd) Thanks [@christianhg](https://github.com/christianhg)! - fix: add proper internal check for leaf nodes
20+
21+
Add an `isLeaf` predicate that correctly distinguishes between nodes that cannot have children and nodes that currently have no children. This replaces ad-hoc `isSpan || isObjectNode` checks in operations with a proper leaf node check that is aware of editable containers.
22+
23+
- [#2421](https://github.com/portabletext/editor/pull/2421) [`b97146c`](https://github.com/portabletext/editor/commit/b97146ccf45cc6d51dbd6b4d0d86015fa2af8039) Thanks [@christianhg](https://github.com/christianhg)! - fix: use lax type guards for text block and span identification
24+
25+
- [#2420](https://github.com/portabletext/editor/pull/2420) [`56c20c3`](https://github.com/portabletext/editor/commit/56c20c34a7378e141126d5e63aded6e3b4d810da) Thanks [@christianhg](https://github.com/christianhg)! - fix: handle spans with missing text property during normalization and rendering
26+
27+
- [#2425](https://github.com/portabletext/editor/pull/2425) [`d1928a2`](https://github.com/portabletext/editor/commit/d1928a2661ef5319f3bf7602b03bf650f726f3f2) Thanks [@christianhg](https://github.com/christianhg)! - fix: move `text/plain` inherit-formatting to `deserialize.data`
28+
29+
Consumer behaviors on `deserialize.data` can now override the default `text/plain` paste handling. Previously, the inherit-formatting logic ran on `deserialization.success`, which stripped structure from any blocks produced by consumer `deserialize.data` behaviors.
30+
31+
- Updated dependencies [[`251c51b`](https://github.com/portabletext/editor/commit/251c51b7a731dc5008798ea1f922e3d1ad2e11d5)]:
32+
- @portabletext/markdown@1.2.0
33+
334
## 6.5.2
435

536
### Patch Changes

packages/editor/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@portabletext/editor",
3-
"version": "6.5.2",
3+
"version": "6.6.0",
44
"description": "Portable Text Editor made in React",
55
"keywords": [
66
"sanity",

packages/markdown/CHANGELOG.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,32 @@
11
# @portabletext/markdown
22

3+
## 1.2.0
4+
5+
### Minor Changes
6+
7+
- [#2417](https://github.com/portabletext/editor/pull/2417) [`251c51b`](https://github.com/portabletext/editor/commit/251c51b7a731dc5008798ea1f922e3d1ad2e11d5) Thanks [@christianhg](https://github.com/christianhg)! - feat: add first-class GFM callout support
8+
9+
GFM callouts (`> [!NOTE]`, `> [!TIP]`, `> [!WARNING]`, etc.) are now parsed as structured callout objects instead of regular blockquotes. A `DefaultCalloutRenderer` is also available for serializing callout objects back to GFM syntax. Consumers can customize callout handling via the `types.callout` matcher option.
10+
11+
```ts
12+
import {markdownToPortableText} from '@portabletext/markdown'
13+
14+
markdownToPortableText('> [!NOTE]\n> This is a note')
15+
// => [{_type: 'callout', tone: 'note', content: [...]}]
16+
```
17+
18+
```ts
19+
import {
20+
DefaultCalloutRenderer,
21+
portableTextToMarkdown,
22+
} from '@portabletext/markdown'
23+
24+
portableTextToMarkdown(blocks, {
25+
types: {callout: DefaultCalloutRenderer},
26+
})
27+
// => '> [!NOTE]\n> This is a note'
28+
```
29+
330
## 1.1.4
431

532
### Patch Changes

0 commit comments

Comments
 (0)