feat: expose dropPosition and listIndex on text-block and block-object render-props#2754
Draft
christianhg wants to merge 1 commit into
Draft
feat: expose dropPosition and listIndex on text-block and block-object render-props#2754christianhg wants to merge 1 commit into
christianhg wants to merge 1 commit into
Conversation
🦋 Changeset detectedLatest commit: dbc5258 The changes in this PR will be included in the next version bump. This PR includes changesets to release 12 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
📦 Bundle Stats —
|
| Metric | Value | vs main (c92beef) |
|---|---|---|
| Internal (raw) | 778.6 KB | +806 B, +0.1% |
| Internal (gzip) | 147.9 KB | +112 B, +0.1% |
| Bundled (raw) | 1.38 MB | +806 B, +0.1% |
| Bundled (gzip) | 309.8 KB | +110 B, +0.0% |
| Import time | 96ms | -1ms, -1.2% |
@portabletext/editor/behaviors
| Metric | Value | vs main (c92beef) |
|---|---|---|
| Internal (raw) | 467 B | - |
| Internal (gzip) | 207 B | - |
| Bundled (raw) | 424 B | - |
| Bundled (gzip) | 171 B | - |
| Import time | 2ms | +0ms, +2.0% |
@portabletext/editor/plugins
| Metric | Value | vs main (c92beef) |
|---|---|---|
| Internal (raw) | 2.7 KB | - |
| Internal (gzip) | 894 B | - |
| Bundled (raw) | 2.5 KB | - |
| Bundled (gzip) | 827 B | - |
| Import time | 7ms | +0ms, +0.6% |
@portabletext/editor/selectors
| Metric | Value | vs main (c92beef) |
|---|---|---|
| Internal (raw) | 79.4 KB | - |
| Internal (gzip) | 14.5 KB | - |
| Bundled (raw) | 74.9 KB | - |
| Bundled (gzip) | 13.4 KB | - |
| Import time | 8ms | -0ms, -0.3% |
@portabletext/editor/traversal
| Metric | Value | vs main (c92beef) |
|---|---|---|
| Internal (raw) | 25.5 KB | - |
| Internal (gzip) | 5.0 KB | - |
| Bundled (raw) | 25.5 KB | - |
| Bundled (gzip) | 5.0 KB | - |
| Import time | 6ms | -0ms, -0.4% |
@portabletext/editor/utils
| Metric | Value | vs main (c92beef) |
|---|---|---|
| Internal (raw) | 28.8 KB | - |
| Internal (gzip) | 6.0 KB | - |
| Bundled (raw) | 26.7 KB | - |
| Bundled (gzip) | 5.7 KB | - |
| Import time | 6ms | +0ms, +0.5% |
🗺️ . · ./behaviors · ./plugins · ./selectors · ./traversal · ./utils · Artifacts
Details
- Import time regressions over 10% are flagged with
⚠️ - Sizes shown as raw / gzip 🗜️. Internal bytes = own code only. Total bytes = with all dependencies. Import time = Node.js cold-start median.
📦 Bundle Stats — @portabletext/markdown
Compared against main (c92beefe)
| Metric | Value | vs main (c92beef) |
|---|---|---|
| Internal (raw) | 53.0 KB | - |
| Internal (gzip) | 9.6 KB | - |
| Bundled (raw) | 347.6 KB | - |
| Bundled (gzip) | 96.0 KB | - |
| Import time | 40ms | +2ms, +5.2% |
🗺️ View treemap · Artifacts
Details
- Import time regressions over 10% are flagged with
⚠️ - Sizes shown as raw / gzip 🗜️. Internal bytes = own code only. Total bytes = with all dependencies. Import time = Node.js cold-start median.
b823106 to
005627c
Compare
005627c to
6f43480
Compare
…t render-props defineTextBlock and defineBlockObject now receive two engine-derived signals that aren't available on the value: - dropPosition: 'start' | 'end' | undefined - set mid-drag when this block is the current drop target. Consumers using a custom render can show their own drop affordance (or delegate via renderDefault). - listIndex: number | undefined on TextBlockRenderProps - 1-based running index of a list-item within its visible list run (level-aware, resets across non-list interrupts).
b5650fc to
dbc5258
Compare
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
defineTextBlockanddefineBlockObjectnow receive two engine-derived signals that aren't available on the value, letting catch-all consumers recreate the legacy drop indicator and numbered-list affordances:dropPosition: 'start' | 'end' | undefinedon bothTextBlockRenderPropsandBlockObjectRenderProps. Set mid-drag when this block is the current drop target. Consumers using a customrendercan show their own drop affordance, or delegate viarenderDefault.listIndex: number | undefinedonTextBlockRenderProps. The 1-based running index of a list-item within its visible list run — level-aware, resets across non-list interrupts. Engine already computes it (editor.listIndexMap); now exposed.Both fields are optional in the consumer's destructure (catch-all consumers that don't care simply omit them).
Generic — applies to anyone using
defineTextBlock({type: '*'})/defineBlockObject({type: '*'})or a positional override in a container'sofarray.