@portabletext/editor 2.1.6 → 2.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  import { Behavior, Editor, EditorEmittedEvent, EditorSchema } from "../_chunks-dts/behavior.types.action.js";
2
- import * as react12 from "react";
2
+ import * as react22 from "react";
3
3
  import React from "react";
4
4
  /**
5
5
  * @beta
@@ -181,7 +181,7 @@ type MarkdownPluginConfig = MarkdownBehaviorsConfig & {
181
181
  */
182
182
  declare function MarkdownPlugin(props: {
183
183
  config: MarkdownPluginConfig;
184
- }): react12.JSX.Element;
184
+ }): react22.JSX.Element;
185
185
  /**
186
186
  * @beta
187
187
  * Restrict the editor to one line. The plugin takes care of blocking
@@ -192,5 +192,5 @@ declare function MarkdownPlugin(props: {
192
192
  *
193
193
  * @deprecated Install the plugin from `@portabletext/plugin-one-line`
194
194
  */
195
- declare function OneLinePlugin(): react12.JSX.Element;
195
+ declare function OneLinePlugin(): react22.JSX.Element;
196
196
  export { BehaviorPlugin, DecoratorShortcutPlugin, EditorRefPlugin, EventListenerPlugin, MarkdownPlugin, type MarkdownPluginConfig, OneLinePlugin };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@portabletext/editor",
3
- "version": "2.1.6",
3
+ "version": "2.1.7",
4
4
  "description": "Portable Text Editor made in React",
5
5
  "keywords": [
6
6
  "sanity",
@@ -1,4 +1,5 @@
1
1
  import {Transforms} from 'slate'
2
+ import {EDITOR_TO_PENDING_SELECTION} from 'slate-dom'
2
3
  import type {EditorSnapshot} from '../editor/editor-snapshot'
3
4
  import {
4
5
  getFocusSpan,
@@ -67,5 +68,9 @@ export const insertTextOperationImplementation: BehaviorOperationImplementation<
67
68
  marks: [...activeDecorators, ...activeAnnotations],
68
69
  })
69
70
 
71
+ // This makes sure the selection is set correctly when event handling is run
72
+ // through Slate's Android input handling
73
+ EDITOR_TO_PENDING_SELECTION.set(operation.editor, operation.editor.selection)
74
+
70
75
  operation.editor.decoratorState = {}
71
76
  }