@portabletext/editor 2.6.4 → 2.6.5
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.cts +9 -9
- package/lib/_chunks-dts/behavior.types.action.d.ts +124 -124
- 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.cts +3 -3
- package/lib/plugins/index.d.ts +3 -3
- package/lib/utils/index.d.ts +2 -2
- package/package.json +8 -8
- package/src/operations/behavior.operation.select.ts +5 -0
package/lib/plugins/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Behavior, Editor, EditorEmittedEvent, EditorSchema } from "../_chunks-dts/behavior.types.action.cjs";
|
|
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/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 react11 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
|
+
}): react11.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(): react11.JSX.Element;
|
|
196
196
|
export { BehaviorPlugin, DecoratorShortcutPlugin, EditorRefPlugin, EventListenerPlugin, MarkdownPlugin, type MarkdownPluginConfig, OneLinePlugin };
|
package/lib/utils/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BlockOffset, BlockPath, ChildPath, EditorContext, EditorSelection, EditorSelectionPoint } from "../_chunks-dts/behavior.types.action.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as _sanity_types6 from "@sanity/types";
|
|
3
3
|
import { KeyedSegment, PortableTextBlock, PortableTextTextBlock } from "@sanity/types";
|
|
4
4
|
import { isSpan, isTextBlock } from "@portabletext/schema";
|
|
5
5
|
/**
|
|
@@ -143,7 +143,7 @@ declare function mergeTextBlocks({
|
|
|
143
143
|
context: Pick<EditorContext, 'keyGenerator' | 'schema'>;
|
|
144
144
|
targetBlock: PortableTextTextBlock;
|
|
145
145
|
incomingBlock: PortableTextTextBlock;
|
|
146
|
-
}): PortableTextTextBlock<
|
|
146
|
+
}): PortableTextTextBlock<_sanity_types6.PortableTextObject | _sanity_types6.PortableTextSpan>;
|
|
147
147
|
/**
|
|
148
148
|
* @public
|
|
149
149
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@portabletext/editor",
|
|
3
|
-
"version": "2.6.
|
|
3
|
+
"version": "2.6.5",
|
|
4
4
|
"description": "Portable Text Editor made in React",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"sanity",
|
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
"slate-dom": "^0.118.1",
|
|
80
80
|
"slate-react": "0.117.4",
|
|
81
81
|
"xstate": "^5.20.2",
|
|
82
|
-
"@portabletext/block-tools": "^3.4.
|
|
82
|
+
"@portabletext/block-tools": "^3.4.1",
|
|
83
83
|
"@portabletext/keyboard-shortcuts": "^1.1.1",
|
|
84
84
|
"@portabletext/patches": "^1.1.8",
|
|
85
85
|
"@portabletext/schema": "^1.2.0"
|
|
@@ -87,8 +87,8 @@
|
|
|
87
87
|
"devDependencies": {
|
|
88
88
|
"@sanity/diff-match-patch": "^3.2.0",
|
|
89
89
|
"@sanity/pkg-utils": "^8.0.5",
|
|
90
|
-
"@sanity/schema": "^4.
|
|
91
|
-
"@sanity/types": "^4.
|
|
90
|
+
"@sanity/schema": "^4.6.0",
|
|
91
|
+
"@sanity/types": "^4.6.0",
|
|
92
92
|
"@testing-library/react": "^16.3.0",
|
|
93
93
|
"@types/debug": "^4.1.12",
|
|
94
94
|
"@types/lodash": "^4.17.20",
|
|
@@ -111,14 +111,14 @@
|
|
|
111
111
|
"vite": "^7.1.3",
|
|
112
112
|
"vitest": "^3.2.4",
|
|
113
113
|
"vitest-browser-react": "^1.0.1",
|
|
114
|
-
"@portabletext/sanity-bridge": "1.1.
|
|
114
|
+
"@portabletext/sanity-bridge": "1.1.7",
|
|
115
115
|
"@portabletext/test": "^0.0.0",
|
|
116
116
|
"racejar": "1.2.14"
|
|
117
117
|
},
|
|
118
118
|
"peerDependencies": {
|
|
119
|
-
"@portabletext/sanity-bridge": "^1.1.
|
|
120
|
-
"@sanity/schema": "^4.
|
|
121
|
-
"@sanity/types": "^4.
|
|
119
|
+
"@portabletext/sanity-bridge": "^1.1.7",
|
|
120
|
+
"@sanity/schema": "^4.6.0",
|
|
121
|
+
"@sanity/types": "^4.6.0",
|
|
122
122
|
"react": "^18.3 || ^19",
|
|
123
123
|
"rxjs": "^7.8.2"
|
|
124
124
|
},
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import {Transforms} from 'slate'
|
|
2
|
+
import {IS_FOCUSED, IS_READ_ONLY} from 'slate-dom'
|
|
2
3
|
import {toSlateRange} from '../internal-utils/to-slate-range'
|
|
3
4
|
import type {BehaviorOperationImplementation} from './behavior.operations'
|
|
4
5
|
|
|
@@ -19,4 +20,8 @@ export const selectOperationImplementation: BehaviorOperationImplementation<
|
|
|
19
20
|
} else {
|
|
20
21
|
Transforms.deselect(operation.editor)
|
|
21
22
|
}
|
|
23
|
+
|
|
24
|
+
if (IS_FOCUSED.get(operation.editor) && IS_READ_ONLY.get(operation.editor)) {
|
|
25
|
+
IS_FOCUSED.set(operation.editor, false)
|
|
26
|
+
}
|
|
22
27
|
}
|