@portabletext/editor 2.3.5 → 2.3.6
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.
|
@@ -6,7 +6,7 @@ import { AnnotationDefinition, AnnotationSchemaType, BaseDefinition, BlockObject
|
|
|
6
6
|
import * as xstate227 from "xstate";
|
|
7
7
|
import { ActorRef, ActorRefFrom, EventObject, Snapshot } from "xstate";
|
|
8
8
|
import { BaseRange, Descendant, Operation } from "slate";
|
|
9
|
-
import * as
|
|
9
|
+
import * as react22 from "react";
|
|
10
10
|
import React$1, { BaseSyntheticEvent, ClipboardEvent, Component, FocusEvent, JSX, KeyboardEvent as KeyboardEvent$1, MutableRefObject, PropsWithChildren, ReactElement, RefObject, TextareaHTMLAttributes } from "react";
|
|
11
11
|
import * as xstate_guards12 from "xstate/guards";
|
|
12
12
|
import { Observable, Subject } from "rxjs";
|
|
@@ -215,7 +215,7 @@ declare class PortableTextEditor extends Component<PortableTextEditorProps<Inter
|
|
|
215
215
|
componentDidUpdate(prevProps: PortableTextEditorProps): void;
|
|
216
216
|
componentWillUnmount(): void;
|
|
217
217
|
setEditable: (editable: EditableAPI) => void;
|
|
218
|
-
render():
|
|
218
|
+
render(): react22.JSX.Element;
|
|
219
219
|
/**
|
|
220
220
|
* @deprecated
|
|
221
221
|
* Use built-in selectors or write your own: https://www.portabletext.org/reference/selectors/
|
|
@@ -610,7 +610,7 @@ type PortableTextEditableProps = Omit<TextareaHTMLAttributes<HTMLDivElement>, 'o
|
|
|
610
610
|
* ```
|
|
611
611
|
* @group Components
|
|
612
612
|
*/
|
|
613
|
-
declare const PortableTextEditable:
|
|
613
|
+
declare const PortableTextEditable: react22.ForwardRefExoticComponent<Omit<PortableTextEditableProps, "ref"> & react22.RefAttributes<Omit<HTMLDivElement, "as" | "onPaste" | "onBeforeInput">>>;
|
|
614
614
|
type DecoratedRange = BaseRange & {
|
|
615
615
|
rangeDecoration: RangeDecoration;
|
|
616
616
|
};
|
|
@@ -1339,7 +1339,7 @@ declare const editorMachine: xstate227.StateMachine<{
|
|
|
1339
1339
|
initialValue?: Array<PortableTextBlock>;
|
|
1340
1340
|
}, xstate227.NonReducibleUnknown, InternalPatchEvent | MutationEvent | PatchesEvent | {
|
|
1341
1341
|
type: "blurred";
|
|
1342
|
-
event:
|
|
1342
|
+
event: react22.FocusEvent<HTMLDivElement, Element>;
|
|
1343
1343
|
} | {
|
|
1344
1344
|
type: "done loading";
|
|
1345
1345
|
} | {
|
|
@@ -1351,7 +1351,7 @@ declare const editorMachine: xstate227.StateMachine<{
|
|
|
1351
1351
|
data: unknown;
|
|
1352
1352
|
} | {
|
|
1353
1353
|
type: "focused";
|
|
1354
|
-
event:
|
|
1354
|
+
event: react22.FocusEvent<HTMLDivElement, Element>;
|
|
1355
1355
|
} | {
|
|
1356
1356
|
type: "invalid value";
|
|
1357
1357
|
resolution: InvalidValueResolution | null;
|
|
@@ -1998,7 +1998,7 @@ declare const editorMachine: xstate227.StateMachine<{
|
|
|
1998
1998
|
type: "drop";
|
|
1999
1999
|
}, undefined, never, never, never, never, InternalPatchEvent | MutationEvent | PatchesEvent | {
|
|
2000
2000
|
type: "blurred";
|
|
2001
|
-
event:
|
|
2001
|
+
event: react22.FocusEvent<HTMLDivElement, Element>;
|
|
2002
2002
|
} | {
|
|
2003
2003
|
type: "done loading";
|
|
2004
2004
|
} | {
|
|
@@ -2010,7 +2010,7 @@ declare const editorMachine: xstate227.StateMachine<{
|
|
|
2010
2010
|
data: unknown;
|
|
2011
2011
|
} | {
|
|
2012
2012
|
type: "focused";
|
|
2013
|
-
event:
|
|
2013
|
+
event: react22.FocusEvent<HTMLDivElement, Element>;
|
|
2014
2014
|
} | {
|
|
2015
2015
|
type: "invalid value";
|
|
2016
2016
|
resolution: InvalidValueResolution | null;
|
|
@@ -2881,7 +2881,7 @@ declare const editorMachine: xstate227.StateMachine<{
|
|
|
2881
2881
|
type: "drop";
|
|
2882
2882
|
}, undefined, never, never, never, never, InternalPatchEvent | MutationEvent | PatchesEvent | {
|
|
2883
2883
|
type: "blurred";
|
|
2884
|
-
event:
|
|
2884
|
+
event: react22.FocusEvent<HTMLDivElement, Element>;
|
|
2885
2885
|
} | {
|
|
2886
2886
|
type: "done loading";
|
|
2887
2887
|
} | {
|
|
@@ -2893,7 +2893,7 @@ declare const editorMachine: xstate227.StateMachine<{
|
|
|
2893
2893
|
data: unknown;
|
|
2894
2894
|
} | {
|
|
2895
2895
|
type: "focused";
|
|
2896
|
-
event:
|
|
2896
|
+
event: react22.FocusEvent<HTMLDivElement, Element>;
|
|
2897
2897
|
} | {
|
|
2898
2898
|
type: "invalid value";
|
|
2899
2899
|
resolution: InvalidValueResolution | null;
|
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 react12 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
|
+
}): react12.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(): react12.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_types9 from "@sanity/types";
|
|
3
3
|
import { KeyedSegment, PortableTextBlock, PortableTextChild, PortableTextSpan, PortableTextTextBlock } from "@sanity/types";
|
|
4
4
|
/**
|
|
5
5
|
* @public
|
|
@@ -150,7 +150,7 @@ declare function mergeTextBlocks({
|
|
|
150
150
|
context: Pick<EditorContext, 'keyGenerator' | 'schema'>;
|
|
151
151
|
targetBlock: PortableTextTextBlock;
|
|
152
152
|
incomingBlock: PortableTextTextBlock;
|
|
153
|
-
}): PortableTextTextBlock<
|
|
153
|
+
}): PortableTextTextBlock<_sanity_types9.PortableTextObject | _sanity_types9.PortableTextSpan>;
|
|
154
154
|
/**
|
|
155
155
|
* @public
|
|
156
156
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@portabletext/editor",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.6",
|
|
4
4
|
"description": "Portable Text Editor made in React",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"sanity",
|
|
@@ -79,18 +79,18 @@
|
|
|
79
79
|
"slate-dom": "^0.117.4",
|
|
80
80
|
"slate-react": "0.117.4",
|
|
81
81
|
"xstate": "^5.20.2",
|
|
82
|
-
"@portabletext/block-tools": "3.
|
|
83
|
-
"@portabletext/
|
|
82
|
+
"@portabletext/block-tools": "3.1.0",
|
|
83
|
+
"@portabletext/sanity-bridge": "1.1.1",
|
|
84
84
|
"@portabletext/keyboard-shortcuts": "1.1.1",
|
|
85
|
-
"@portabletext/
|
|
86
|
-
"@portabletext/
|
|
85
|
+
"@portabletext/patches": "1.1.6",
|
|
86
|
+
"@portabletext/schema": "1.0.0"
|
|
87
87
|
},
|
|
88
88
|
"devDependencies": {
|
|
89
89
|
"@portabletext/toolkit": "^2.0.17",
|
|
90
90
|
"@sanity/diff-match-patch": "^3.2.0",
|
|
91
91
|
"@sanity/pkg-utils": "^7.11.1",
|
|
92
|
-
"@sanity/schema": "^4.
|
|
93
|
-
"@sanity/types": "^4.
|
|
92
|
+
"@sanity/schema": "^4.4.1",
|
|
93
|
+
"@sanity/types": "^4.4.1",
|
|
94
94
|
"@testing-library/react": "^16.3.0",
|
|
95
95
|
"@types/debug": "^4.1.12",
|
|
96
96
|
"@types/lodash": "^4.17.16",
|
|
@@ -116,8 +116,8 @@
|
|
|
116
116
|
"racejar": "1.2.12"
|
|
117
117
|
},
|
|
118
118
|
"peerDependencies": {
|
|
119
|
-
"@sanity/schema": "^4.
|
|
120
|
-
"@sanity/types": "^4.
|
|
119
|
+
"@sanity/schema": "^4.4.1",
|
|
120
|
+
"@sanity/types": "^4.4.1",
|
|
121
121
|
"react": "^18.3 || ^19",
|
|
122
122
|
"rxjs": "^7.8.2"
|
|
123
123
|
},
|