@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.
- package/lib/_chunks-dts/behavior.types.action.d.ts +9 -9
- package/lib/index.cjs +1 -1
- package/lib/index.cjs.map +1 -1
- package/lib/index.js +2 -2
- package/lib/index.js.map +1 -1
- package/lib/plugins/index.d.ts +3 -3
- package/package.json +1 -1
- package/src/operations/behavior.operation.insert.text.ts +5 -0
package/lib/plugins/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Behavior, Editor, EditorEmittedEvent, EditorSchema } from "../_chunks-dts/behavior.types.action.js";
|
|
2
|
-
import * as
|
|
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
|
-
}):
|
|
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():
|
|
195
|
+
declare function OneLinePlugin(): react22.JSX.Element;
|
|
196
196
|
export { BehaviorPlugin, DecoratorShortcutPlugin, EditorRefPlugin, EventListenerPlugin, MarkdownPlugin, type MarkdownPluginConfig, OneLinePlugin };
|
package/package.json
CHANGED
|
@@ -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
|
}
|