@portabletext/editor 2.3.4 → 2.3.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.
|
@@ -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;
|
|
@@ -3,12 +3,12 @@ import * as _sanity_types5 from "@sanity/types";
|
|
|
3
3
|
import { ArrayDefinition, ArraySchemaType, BlockDecoratorDefinition, BlockListDefinition, BlockStyleDefinition, ObjectSchemaType, Path, PortableTextBlock, PortableTextBlock as PortableTextBlock$1, PortableTextChild, PortableTextChild as PortableTextChild$1, PortableTextListBlock, PortableTextObject, PortableTextObject as PortableTextObject$1, PortableTextSpan, PortableTextSpan as PortableTextSpan$1, PortableTextTextBlock, PortableTextTextBlock as PortableTextTextBlock$1, TypedObject } from "@sanity/types";
|
|
4
4
|
import * as _portabletext_schema5 from "@portabletext/schema";
|
|
5
5
|
import { AnnotationDefinition, AnnotationSchemaType, BaseDefinition, BlockObjectDefinition, BlockObjectSchemaType, DecoratorDefinition, DecoratorSchemaType, FieldDefinition, InlineObjectDefinition, InlineObjectSchemaType, ListDefinition, ListSchemaType, Schema, SchemaDefinition, SchemaDefinition as SchemaDefinition$1, StyleDefinition, StyleSchemaType, defineSchema } from "@portabletext/schema";
|
|
6
|
-
import * as
|
|
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 react20 from "react";
|
|
10
10
|
import React$1, { BaseSyntheticEvent, ClipboardEvent, Component, FocusEvent, JSX, KeyboardEvent as KeyboardEvent$1, MutableRefObject, PropsWithChildren, ReactElement, RefObject, TextareaHTMLAttributes } from "react";
|
|
11
|
-
import * as
|
|
11
|
+
import * as xstate_guards12 from "xstate/guards";
|
|
12
12
|
import { Observable, Subject } from "rxjs";
|
|
13
13
|
import { DOMNode } from "slate-dom";
|
|
14
14
|
import { ReactEditor } from "slate-react";
|
|
@@ -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(): react20.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: react20.ForwardRefExoticComponent<Omit<PortableTextEditableProps, "ref"> & react20.RefAttributes<Omit<HTMLDivElement, "as" | "onPaste" | "onBeforeInput">>>;
|
|
614
614
|
type DecoratedRange = BaseRange & {
|
|
615
615
|
rangeDecoration: RangeDecoration;
|
|
616
616
|
};
|
|
@@ -1176,7 +1176,7 @@ type EditorActor = ActorRefFrom<typeof editorMachine>;
|
|
|
1176
1176
|
/**
|
|
1177
1177
|
* @internal
|
|
1178
1178
|
*/
|
|
1179
|
-
declare const editorMachine:
|
|
1179
|
+
declare const editorMachine: xstate227.StateMachine<{
|
|
1180
1180
|
behaviors: Set<BehaviorConfig>;
|
|
1181
1181
|
behaviorsSorted: boolean;
|
|
1182
1182
|
converters: Set<Converter>;
|
|
@@ -1194,7 +1194,7 @@ declare const editorMachine: xstate241.StateMachine<{
|
|
|
1194
1194
|
};
|
|
1195
1195
|
dragGhost?: HTMLElement;
|
|
1196
1196
|
slateEditor?: PortableTextSlateEditor;
|
|
1197
|
-
},
|
|
1197
|
+
}, InternalPatchEvent | MutationEvent | PatchesEvent | {
|
|
1198
1198
|
type: "update readOnly";
|
|
1199
1199
|
readOnly: boolean;
|
|
1200
1200
|
} | {
|
|
@@ -1241,58 +1241,58 @@ declare const editorMachine: xstate241.StateMachine<{
|
|
|
1241
1241
|
type: "dragend";
|
|
1242
1242
|
} | {
|
|
1243
1243
|
type: "drop";
|
|
1244
|
-
}, {}, never,
|
|
1244
|
+
}, {}, never, xstate227.Values<{
|
|
1245
1245
|
"add behavior to context": {
|
|
1246
1246
|
type: "add behavior to context";
|
|
1247
|
-
params:
|
|
1247
|
+
params: xstate227.NonReducibleUnknown;
|
|
1248
1248
|
};
|
|
1249
1249
|
"remove behavior from context": {
|
|
1250
1250
|
type: "remove behavior from context";
|
|
1251
|
-
params:
|
|
1251
|
+
params: xstate227.NonReducibleUnknown;
|
|
1252
1252
|
};
|
|
1253
1253
|
"emit patch event": {
|
|
1254
1254
|
type: "emit patch event";
|
|
1255
|
-
params:
|
|
1255
|
+
params: xstate227.NonReducibleUnknown;
|
|
1256
1256
|
};
|
|
1257
1257
|
"emit mutation event": {
|
|
1258
1258
|
type: "emit mutation event";
|
|
1259
|
-
params:
|
|
1259
|
+
params: xstate227.NonReducibleUnknown;
|
|
1260
1260
|
};
|
|
1261
1261
|
"emit read only": {
|
|
1262
1262
|
type: "emit read only";
|
|
1263
|
-
params:
|
|
1263
|
+
params: xstate227.NonReducibleUnknown;
|
|
1264
1264
|
};
|
|
1265
1265
|
"emit editable": {
|
|
1266
1266
|
type: "emit editable";
|
|
1267
|
-
params:
|
|
1267
|
+
params: xstate227.NonReducibleUnknown;
|
|
1268
1268
|
};
|
|
1269
1269
|
"defer event": {
|
|
1270
1270
|
type: "defer event";
|
|
1271
|
-
params:
|
|
1271
|
+
params: xstate227.NonReducibleUnknown;
|
|
1272
1272
|
};
|
|
1273
1273
|
"emit pending events": {
|
|
1274
1274
|
type: "emit pending events";
|
|
1275
|
-
params:
|
|
1275
|
+
params: xstate227.NonReducibleUnknown;
|
|
1276
1276
|
};
|
|
1277
1277
|
"emit ready": {
|
|
1278
1278
|
type: "emit ready";
|
|
1279
|
-
params:
|
|
1279
|
+
params: xstate227.NonReducibleUnknown;
|
|
1280
1280
|
};
|
|
1281
1281
|
"clear pending events": {
|
|
1282
1282
|
type: "clear pending events";
|
|
1283
|
-
params:
|
|
1283
|
+
params: xstate227.NonReducibleUnknown;
|
|
1284
1284
|
};
|
|
1285
1285
|
"defer incoming patches": {
|
|
1286
1286
|
type: "defer incoming patches";
|
|
1287
|
-
params:
|
|
1287
|
+
params: xstate227.NonReducibleUnknown;
|
|
1288
1288
|
};
|
|
1289
1289
|
"emit pending incoming patches": {
|
|
1290
1290
|
type: "emit pending incoming patches";
|
|
1291
|
-
params:
|
|
1291
|
+
params: xstate227.NonReducibleUnknown;
|
|
1292
1292
|
};
|
|
1293
1293
|
"clear pending incoming patches": {
|
|
1294
1294
|
type: "clear pending incoming patches";
|
|
1295
|
-
params:
|
|
1295
|
+
params: xstate227.NonReducibleUnknown;
|
|
1296
1296
|
};
|
|
1297
1297
|
"handle blur": {
|
|
1298
1298
|
type: "handle blur";
|
|
@@ -1308,7 +1308,7 @@ declare const editorMachine: xstate241.StateMachine<{
|
|
|
1308
1308
|
};
|
|
1309
1309
|
"sort behaviors": {
|
|
1310
1310
|
type: "sort behaviors";
|
|
1311
|
-
params:
|
|
1311
|
+
params: xstate227.NonReducibleUnknown;
|
|
1312
1312
|
};
|
|
1313
1313
|
}>, {
|
|
1314
1314
|
type: "slate is busy";
|
|
@@ -1337,9 +1337,9 @@ declare const editorMachine: xstate241.StateMachine<{
|
|
|
1337
1337
|
readOnly?: boolean;
|
|
1338
1338
|
schema: EditorSchema;
|
|
1339
1339
|
initialValue?: Array<PortableTextBlock>;
|
|
1340
|
-
},
|
|
1340
|
+
}, xstate227.NonReducibleUnknown, InternalPatchEvent | MutationEvent | PatchesEvent | {
|
|
1341
1341
|
type: "blurred";
|
|
1342
|
-
event:
|
|
1342
|
+
event: react20.FocusEvent<HTMLDivElement, Element>;
|
|
1343
1343
|
} | {
|
|
1344
1344
|
type: "done loading";
|
|
1345
1345
|
} | {
|
|
@@ -1351,14 +1351,14 @@ declare const editorMachine: xstate241.StateMachine<{
|
|
|
1351
1351
|
data: unknown;
|
|
1352
1352
|
} | {
|
|
1353
1353
|
type: "focused";
|
|
1354
|
-
event:
|
|
1354
|
+
event: react20.FocusEvent<HTMLDivElement, Element>;
|
|
1355
1355
|
} | {
|
|
1356
1356
|
type: "invalid value";
|
|
1357
1357
|
resolution: InvalidValueResolution | null;
|
|
1358
1358
|
value: Array<PortableTextBlock> | undefined;
|
|
1359
1359
|
} | {
|
|
1360
1360
|
type: "loading";
|
|
1361
|
-
} |
|
|
1361
|
+
} | {
|
|
1362
1362
|
type: "read only";
|
|
1363
1363
|
} | {
|
|
1364
1364
|
type: "ready";
|
|
@@ -1368,19 +1368,19 @@ declare const editorMachine: xstate241.StateMachine<{
|
|
|
1368
1368
|
} | {
|
|
1369
1369
|
type: "value changed";
|
|
1370
1370
|
value: Array<PortableTextBlock> | undefined;
|
|
1371
|
-
}
|
|
1371
|
+
}, xstate227.MetaObject, {
|
|
1372
1372
|
readonly id: "editor";
|
|
1373
1373
|
readonly context: ({
|
|
1374
1374
|
input
|
|
1375
1375
|
}: {
|
|
1376
1376
|
spawn: {
|
|
1377
|
-
<TSrc extends never>(logic: TSrc, ...[options]: never):
|
|
1378
|
-
<TLogic extends
|
|
1377
|
+
<TSrc extends never>(logic: TSrc, ...[options]: never): xstate227.ActorRefFromLogic<never>;
|
|
1378
|
+
<TLogic extends xstate227.AnyActorLogic>(src: TLogic, ...[options]: xstate227.ConditionalRequired<[options?: ({
|
|
1379
1379
|
id?: never;
|
|
1380
1380
|
systemId?: string;
|
|
1381
|
-
input?:
|
|
1381
|
+
input?: xstate227.InputFrom<TLogic> | undefined;
|
|
1382
1382
|
syncSnapshot?: boolean;
|
|
1383
|
-
} & { [K in
|
|
1383
|
+
} & { [K in xstate227.RequiredLogicInput<TLogic>]: unknown }) | undefined], xstate227.IsNotNever<xstate227.RequiredLogicInput<TLogic>>>): xstate227.ActorRefFromLogic<TLogic>;
|
|
1384
1384
|
};
|
|
1385
1385
|
input: {
|
|
1386
1386
|
converters?: Array<Converter>;
|
|
@@ -1391,7 +1391,7 @@ declare const editorMachine: xstate241.StateMachine<{
|
|
|
1391
1391
|
schema: EditorSchema;
|
|
1392
1392
|
initialValue?: Array<PortableTextBlock>;
|
|
1393
1393
|
};
|
|
1394
|
-
self:
|
|
1394
|
+
self: xstate227.ActorRef<xstate227.MachineSnapshot<{
|
|
1395
1395
|
behaviors: Set<BehaviorConfig>;
|
|
1396
1396
|
behaviorsSorted: boolean;
|
|
1397
1397
|
converters: Set<Converter>;
|
|
@@ -1409,7 +1409,7 @@ declare const editorMachine: xstate241.StateMachine<{
|
|
|
1409
1409
|
};
|
|
1410
1410
|
dragGhost?: HTMLElement;
|
|
1411
1411
|
slateEditor?: PortableTextSlateEditor;
|
|
1412
|
-
},
|
|
1412
|
+
}, InternalPatchEvent | MutationEvent | PatchesEvent | {
|
|
1413
1413
|
type: "update readOnly";
|
|
1414
1414
|
readOnly: boolean;
|
|
1415
1415
|
} | {
|
|
@@ -1456,7 +1456,7 @@ declare const editorMachine: xstate241.StateMachine<{
|
|
|
1456
1456
|
type: "dragend";
|
|
1457
1457
|
} | {
|
|
1458
1458
|
type: "drop";
|
|
1459
|
-
}, Record<string,
|
|
1459
|
+
}, Record<string, xstate227.AnyActorRef | undefined>, xstate227.StateValue, string, unknown, any, any>, InternalPatchEvent | MutationEvent | PatchesEvent | {
|
|
1460
1460
|
type: "update readOnly";
|
|
1461
1461
|
readOnly: boolean;
|
|
1462
1462
|
} | {
|
|
@@ -1503,10 +1503,10 @@ declare const editorMachine: xstate241.StateMachine<{
|
|
|
1503
1503
|
type: "dragend";
|
|
1504
1504
|
} | {
|
|
1505
1505
|
type: "drop";
|
|
1506
|
-
},
|
|
1506
|
+
}, xstate227.AnyEventObject>;
|
|
1507
1507
|
}) => {
|
|
1508
1508
|
behaviors: Set<{
|
|
1509
|
-
behavior: Behavior<"*" | "split" | `custom.${string}` | "annotation.add" | "annotation.remove" | "block.set" | "block.unset" | "child.set" | "child.unset" | "decorator.add" | "decorator.remove" | "delete" | "history.redo" | "history.undo" | "insert.inline object" | "insert.block" | "insert.span" | "insert.text" | "move.backward" | "move.block" | "move.forward" | "select" | "annotation.set" | "annotation.toggle" | "decorator.toggle" | "delete.backward" | "delete.block" | "delete.child" | "delete.forward" | "delete.text" | "deserialize" | "deserialization.success" | "deserialization.failure" | "insert.blocks" | "insert.break" | "insert.soft break" | "list item.add" | "list item.remove" | "list item.toggle" | "move.block down" | "move.block up" | "select.previous block" | "select.next block" | "serialize" | "serialization.success" | "serialization.failure" | "style.add" | "style.remove" | "style.toggle" | "clipboard.copy" | "clipboard.cut" | "clipboard.paste" | "drag.dragstart" | "drag.drag" | "drag.dragend" | "drag.dragenter" | "drag.dragover" | "drag.dragleave" | "drag.drop" | "input.*" | "keyboard.keydown" | "keyboard.keyup" | "mouse.click" | "
|
|
1509
|
+
behavior: Behavior<"*" | "split" | `custom.${string}` | "annotation.add" | "annotation.remove" | "block.set" | "block.unset" | "child.set" | "child.unset" | "decorator.add" | "decorator.remove" | "delete" | "history.redo" | "history.undo" | "insert.inline object" | "insert.block" | "insert.span" | "insert.text" | "move.backward" | "move.block" | "move.forward" | "select" | "annotation.set" | "annotation.toggle" | "decorator.toggle" | "delete.backward" | "delete.block" | "delete.child" | "delete.forward" | "delete.text" | "deserialize" | "deserialization.success" | "deserialization.failure" | "insert.blocks" | "insert.break" | "insert.soft break" | "list item.add" | "list item.remove" | "list item.toggle" | "move.block down" | "move.block up" | "select.previous block" | "select.next block" | "serialize" | "serialization.success" | "serialization.failure" | "style.add" | "style.remove" | "style.toggle" | "clipboard.copy" | "clipboard.cut" | "clipboard.paste" | "drag.dragstart" | "drag.drag" | "drag.dragend" | "drag.dragenter" | "drag.dragover" | "drag.dragleave" | "drag.drop" | "input.*" | "keyboard.keydown" | "keyboard.keyup" | "mouse.click" | "style.*" | "history.*" | "split.*" | "delete.*" | "select.*" | "deserialize.*" | "serialize.*" | "annotation.*" | "block.*" | "child.*" | "decorator.*" | "insert.*" | "move.*" | "deserialization.*" | "list item.*" | "serialization.*" | "clipboard.*" | "drag.*" | "keyboard.*" | "mouse.*", true, {
|
|
1510
1510
|
type: StrictExtract<"split" | "annotation.add" | "annotation.remove" | "block.set" | "block.unset" | "child.set" | "child.unset" | "decorator.add" | "decorator.remove" | "delete" | "history.redo" | "history.undo" | "insert.inline object" | "insert.block" | "insert.span" | "insert.text" | "move.backward" | "move.block" | "move.forward" | "select" | "annotation.set" | "annotation.toggle" | "decorator.toggle" | "delete.backward" | "delete.block" | "delete.child" | "delete.forward" | "delete.text" | "deserialize" | "deserialization.success" | "deserialization.failure" | "insert.blocks" | "insert.break" | "insert.soft break" | "list item.add" | "list item.remove" | "list item.toggle" | "move.block down" | "move.block up" | "select.previous block" | "select.next block" | "serialize" | "serialization.success" | "serialization.failure" | "style.add" | "style.remove" | "style.toggle", "annotation.add">;
|
|
1511
1511
|
annotation: {
|
|
1512
1512
|
name: string;
|
|
@@ -1789,7 +1789,7 @@ declare const editorMachine: xstate241.StateMachine<{
|
|
|
1789
1789
|
readonly actions: "remove behavior from context";
|
|
1790
1790
|
};
|
|
1791
1791
|
readonly 'update maxBlocks': {
|
|
1792
|
-
readonly actions:
|
|
1792
|
+
readonly actions: xstate227.ActionFunction<{
|
|
1793
1793
|
behaviors: Set<BehaviorConfig>;
|
|
1794
1794
|
behaviorsSorted: boolean;
|
|
1795
1795
|
converters: Set<Converter>;
|
|
@@ -1810,7 +1810,7 @@ declare const editorMachine: xstate241.StateMachine<{
|
|
|
1810
1810
|
}, {
|
|
1811
1811
|
type: "update maxBlocks";
|
|
1812
1812
|
maxBlocks: number | undefined;
|
|
1813
|
-
},
|
|
1813
|
+
}, InternalPatchEvent | MutationEvent | PatchesEvent | {
|
|
1814
1814
|
type: "update readOnly";
|
|
1815
1815
|
readOnly: boolean;
|
|
1816
1816
|
} | {
|
|
@@ -1860,7 +1860,7 @@ declare const editorMachine: xstate241.StateMachine<{
|
|
|
1860
1860
|
}, undefined, never, never, never, never, never>;
|
|
1861
1861
|
};
|
|
1862
1862
|
readonly 'update selection': {
|
|
1863
|
-
readonly actions: readonly [
|
|
1863
|
+
readonly actions: readonly [xstate227.ActionFunction<{
|
|
1864
1864
|
behaviors: Set<BehaviorConfig>;
|
|
1865
1865
|
behaviorsSorted: boolean;
|
|
1866
1866
|
converters: Set<Converter>;
|
|
@@ -1881,7 +1881,7 @@ declare const editorMachine: xstate241.StateMachine<{
|
|
|
1881
1881
|
}, {
|
|
1882
1882
|
type: "update selection";
|
|
1883
1883
|
selection: EditorSelection;
|
|
1884
|
-
},
|
|
1884
|
+
}, InternalPatchEvent | MutationEvent | PatchesEvent | {
|
|
1885
1885
|
type: "update readOnly";
|
|
1886
1886
|
readOnly: boolean;
|
|
1887
1887
|
} | {
|
|
@@ -1928,7 +1928,7 @@ declare const editorMachine: xstate241.StateMachine<{
|
|
|
1928
1928
|
type: "dragend";
|
|
1929
1929
|
} | {
|
|
1930
1930
|
type: "drop";
|
|
1931
|
-
}, undefined, never, never, never, never, never>,
|
|
1931
|
+
}, undefined, never, never, never, never, never>, xstate227.ActionFunction<{
|
|
1932
1932
|
behaviors: Set<BehaviorConfig>;
|
|
1933
1933
|
behaviorsSorted: boolean;
|
|
1934
1934
|
converters: Set<Converter>;
|
|
@@ -1949,7 +1949,7 @@ declare const editorMachine: xstate241.StateMachine<{
|
|
|
1949
1949
|
}, {
|
|
1950
1950
|
type: "update selection";
|
|
1951
1951
|
selection: EditorSelection;
|
|
1952
|
-
},
|
|
1952
|
+
}, InternalPatchEvent | MutationEvent | PatchesEvent | {
|
|
1953
1953
|
type: "update readOnly";
|
|
1954
1954
|
readOnly: boolean;
|
|
1955
1955
|
} | {
|
|
@@ -1996,9 +1996,9 @@ declare const editorMachine: xstate241.StateMachine<{
|
|
|
1996
1996
|
type: "dragend";
|
|
1997
1997
|
} | {
|
|
1998
1998
|
type: "drop";
|
|
1999
|
-
}, undefined, never, never, never, never, {
|
|
1999
|
+
}, undefined, never, never, never, never, InternalPatchEvent | MutationEvent | PatchesEvent | {
|
|
2000
2000
|
type: "blurred";
|
|
2001
|
-
event:
|
|
2001
|
+
event: react20.FocusEvent<HTMLDivElement, Element>;
|
|
2002
2002
|
} | {
|
|
2003
2003
|
type: "done loading";
|
|
2004
2004
|
} | {
|
|
@@ -2010,14 +2010,14 @@ declare const editorMachine: xstate241.StateMachine<{
|
|
|
2010
2010
|
data: unknown;
|
|
2011
2011
|
} | {
|
|
2012
2012
|
type: "focused";
|
|
2013
|
-
event:
|
|
2013
|
+
event: react20.FocusEvent<HTMLDivElement, Element>;
|
|
2014
2014
|
} | {
|
|
2015
2015
|
type: "invalid value";
|
|
2016
2016
|
resolution: InvalidValueResolution | null;
|
|
2017
2017
|
value: Array<PortableTextBlock> | undefined;
|
|
2018
2018
|
} | {
|
|
2019
2019
|
type: "loading";
|
|
2020
|
-
} |
|
|
2020
|
+
} | {
|
|
2021
2021
|
type: "read only";
|
|
2022
2022
|
} | {
|
|
2023
2023
|
type: "ready";
|
|
@@ -2027,10 +2027,10 @@ declare const editorMachine: xstate241.StateMachine<{
|
|
|
2027
2027
|
} | {
|
|
2028
2028
|
type: "value changed";
|
|
2029
2029
|
value: Array<PortableTextBlock> | undefined;
|
|
2030
|
-
}
|
|
2030
|
+
}>];
|
|
2031
2031
|
};
|
|
2032
2032
|
readonly 'set drag ghost': {
|
|
2033
|
-
readonly actions:
|
|
2033
|
+
readonly actions: xstate227.ActionFunction<{
|
|
2034
2034
|
behaviors: Set<BehaviorConfig>;
|
|
2035
2035
|
behaviorsSorted: boolean;
|
|
2036
2036
|
converters: Set<Converter>;
|
|
@@ -2051,7 +2051,7 @@ declare const editorMachine: xstate241.StateMachine<{
|
|
|
2051
2051
|
}, {
|
|
2052
2052
|
type: "set drag ghost";
|
|
2053
2053
|
ghost: HTMLElement;
|
|
2054
|
-
},
|
|
2054
|
+
}, InternalPatchEvent | MutationEvent | PatchesEvent | {
|
|
2055
2055
|
type: "update readOnly";
|
|
2056
2056
|
readOnly: boolean;
|
|
2057
2057
|
} | {
|
|
@@ -2113,7 +2113,7 @@ declare const editorMachine: xstate241.StateMachine<{
|
|
|
2113
2113
|
readonly actions: readonly ["sort behaviors", "handle behavior event"];
|
|
2114
2114
|
readonly guard: ({
|
|
2115
2115
|
event
|
|
2116
|
-
}:
|
|
2116
|
+
}: xstate_guards12.GuardArgs<{
|
|
2117
2117
|
behaviors: Set<BehaviorConfig>;
|
|
2118
2118
|
behaviorsSorted: boolean;
|
|
2119
2119
|
converters: Set<Converter>;
|
|
@@ -2150,7 +2150,7 @@ declare const editorMachine: xstate241.StateMachine<{
|
|
|
2150
2150
|
readonly target: "#editor.edit mode.read only.read only";
|
|
2151
2151
|
readonly guard: ({
|
|
2152
2152
|
context
|
|
2153
|
-
}:
|
|
2153
|
+
}: xstate_guards12.GuardArgs<{
|
|
2154
2154
|
behaviors: Set<BehaviorConfig>;
|
|
2155
2155
|
behaviorsSorted: boolean;
|
|
2156
2156
|
converters: Set<Converter>;
|
|
@@ -2183,7 +2183,7 @@ declare const editorMachine: xstate241.StateMachine<{
|
|
|
2183
2183
|
readonly 'update readOnly': {
|
|
2184
2184
|
readonly guard: ({
|
|
2185
2185
|
event
|
|
2186
|
-
}:
|
|
2186
|
+
}: xstate_guards12.GuardArgs<{
|
|
2187
2187
|
behaviors: Set<BehaviorConfig>;
|
|
2188
2188
|
behaviorsSorted: boolean;
|
|
2189
2189
|
converters: Set<Converter>;
|
|
@@ -2217,7 +2217,7 @@ declare const editorMachine: xstate241.StateMachine<{
|
|
|
2217
2217
|
readonly 'update readOnly': {
|
|
2218
2218
|
readonly guard: ({
|
|
2219
2219
|
event
|
|
2220
|
-
}:
|
|
2220
|
+
}: xstate_guards12.GuardArgs<{
|
|
2221
2221
|
behaviors: Set<BehaviorConfig>;
|
|
2222
2222
|
behaviorsSorted: boolean;
|
|
2223
2223
|
converters: Set<Converter>;
|
|
@@ -2250,7 +2250,7 @@ declare const editorMachine: xstate241.StateMachine<{
|
|
|
2250
2250
|
};
|
|
2251
2251
|
readonly focus: {
|
|
2252
2252
|
readonly target: ".focusing";
|
|
2253
|
-
readonly actions: readonly [
|
|
2253
|
+
readonly actions: readonly [xstate227.ActionFunction<{
|
|
2254
2254
|
behaviors: Set<BehaviorConfig>;
|
|
2255
2255
|
behaviorsSorted: boolean;
|
|
2256
2256
|
converters: Set<Converter>;
|
|
@@ -2271,7 +2271,7 @@ declare const editorMachine: xstate241.StateMachine<{
|
|
|
2271
2271
|
}, {
|
|
2272
2272
|
type: "focus";
|
|
2273
2273
|
editor: PortableTextSlateEditor;
|
|
2274
|
-
},
|
|
2274
|
+
}, InternalPatchEvent | MutationEvent | PatchesEvent | {
|
|
2275
2275
|
type: "update readOnly";
|
|
2276
2276
|
readOnly: boolean;
|
|
2277
2277
|
} | {
|
|
@@ -2328,7 +2328,7 @@ declare const editorMachine: xstate241.StateMachine<{
|
|
|
2328
2328
|
readonly exit: readonly [() => void];
|
|
2329
2329
|
readonly on: {
|
|
2330
2330
|
readonly dragstart: {
|
|
2331
|
-
readonly actions: readonly [
|
|
2331
|
+
readonly actions: readonly [xstate227.ActionFunction<{
|
|
2332
2332
|
behaviors: Set<BehaviorConfig>;
|
|
2333
2333
|
behaviorsSorted: boolean;
|
|
2334
2334
|
converters: Set<Converter>;
|
|
@@ -2350,7 +2350,7 @@ declare const editorMachine: xstate241.StateMachine<{
|
|
|
2350
2350
|
type: "dragstart";
|
|
2351
2351
|
ghost?: HTMLElement;
|
|
2352
2352
|
origin: Pick<EventPosition, "selection">;
|
|
2353
|
-
},
|
|
2353
|
+
}, InternalPatchEvent | MutationEvent | PatchesEvent | {
|
|
2354
2354
|
type: "update readOnly";
|
|
2355
2355
|
readOnly: boolean;
|
|
2356
2356
|
} | {
|
|
@@ -2431,7 +2431,7 @@ declare const editorMachine: xstate241.StateMachine<{
|
|
|
2431
2431
|
readonly entry: readonly [() => void];
|
|
2432
2432
|
readonly exit: readonly [() => void, ({
|
|
2433
2433
|
context
|
|
2434
|
-
}:
|
|
2434
|
+
}: xstate227.ActionArgs<{
|
|
2435
2435
|
behaviors: Set<BehaviorConfig>;
|
|
2436
2436
|
behaviorsSorted: boolean;
|
|
2437
2437
|
converters: Set<Converter>;
|
|
@@ -2449,7 +2449,7 @@ declare const editorMachine: xstate241.StateMachine<{
|
|
|
2449
2449
|
};
|
|
2450
2450
|
dragGhost?: HTMLElement;
|
|
2451
2451
|
slateEditor?: PortableTextSlateEditor;
|
|
2452
|
-
},
|
|
2452
|
+
}, InternalPatchEvent | MutationEvent | PatchesEvent | {
|
|
2453
2453
|
type: "update readOnly";
|
|
2454
2454
|
readOnly: boolean;
|
|
2455
2455
|
} | {
|
|
@@ -2496,7 +2496,7 @@ declare const editorMachine: xstate241.StateMachine<{
|
|
|
2496
2496
|
type: "dragend";
|
|
2497
2497
|
} | {
|
|
2498
2498
|
type: "drop";
|
|
2499
|
-
},
|
|
2499
|
+
}, InternalPatchEvent | MutationEvent | PatchesEvent | {
|
|
2500
2500
|
type: "update readOnly";
|
|
2501
2501
|
readOnly: boolean;
|
|
2502
2502
|
} | {
|
|
@@ -2543,7 +2543,7 @@ declare const editorMachine: xstate241.StateMachine<{
|
|
|
2543
2543
|
type: "dragend";
|
|
2544
2544
|
} | {
|
|
2545
2545
|
type: "drop";
|
|
2546
|
-
}>) => void,
|
|
2546
|
+
}>) => void, xstate227.ActionFunction<{
|
|
2547
2547
|
behaviors: Set<BehaviorConfig>;
|
|
2548
2548
|
behaviorsSorted: boolean;
|
|
2549
2549
|
converters: Set<Converter>;
|
|
@@ -2561,7 +2561,7 @@ declare const editorMachine: xstate241.StateMachine<{
|
|
|
2561
2561
|
};
|
|
2562
2562
|
dragGhost?: HTMLElement;
|
|
2563
2563
|
slateEditor?: PortableTextSlateEditor;
|
|
2564
|
-
},
|
|
2564
|
+
}, InternalPatchEvent | MutationEvent | PatchesEvent | {
|
|
2565
2565
|
type: "update readOnly";
|
|
2566
2566
|
readOnly: boolean;
|
|
2567
2567
|
} | {
|
|
@@ -2608,7 +2608,7 @@ declare const editorMachine: xstate241.StateMachine<{
|
|
|
2608
2608
|
type: "dragend";
|
|
2609
2609
|
} | {
|
|
2610
2610
|
type: "drop";
|
|
2611
|
-
},
|
|
2611
|
+
}, InternalPatchEvent | MutationEvent | PatchesEvent | {
|
|
2612
2612
|
type: "update readOnly";
|
|
2613
2613
|
readOnly: boolean;
|
|
2614
2614
|
} | {
|
|
@@ -2655,7 +2655,7 @@ declare const editorMachine: xstate241.StateMachine<{
|
|
|
2655
2655
|
type: "dragend";
|
|
2656
2656
|
} | {
|
|
2657
2657
|
type: "drop";
|
|
2658
|
-
}, undefined, never, never, never, never, never>,
|
|
2658
|
+
}, undefined, never, never, never, never, never>, xstate227.ActionFunction<{
|
|
2659
2659
|
behaviors: Set<BehaviorConfig>;
|
|
2660
2660
|
behaviorsSorted: boolean;
|
|
2661
2661
|
converters: Set<Converter>;
|
|
@@ -2673,7 +2673,7 @@ declare const editorMachine: xstate241.StateMachine<{
|
|
|
2673
2673
|
};
|
|
2674
2674
|
dragGhost?: HTMLElement;
|
|
2675
2675
|
slateEditor?: PortableTextSlateEditor;
|
|
2676
|
-
},
|
|
2676
|
+
}, InternalPatchEvent | MutationEvent | PatchesEvent | {
|
|
2677
2677
|
type: "update readOnly";
|
|
2678
2678
|
readOnly: boolean;
|
|
2679
2679
|
} | {
|
|
@@ -2720,7 +2720,7 @@ declare const editorMachine: xstate241.StateMachine<{
|
|
|
2720
2720
|
type: "dragend";
|
|
2721
2721
|
} | {
|
|
2722
2722
|
type: "drop";
|
|
2723
|
-
},
|
|
2723
|
+
}, InternalPatchEvent | MutationEvent | PatchesEvent | {
|
|
2724
2724
|
type: "update readOnly";
|
|
2725
2725
|
readOnly: boolean;
|
|
2726
2726
|
} | {
|
|
@@ -2814,7 +2814,7 @@ declare const editorMachine: xstate241.StateMachine<{
|
|
|
2814
2814
|
readonly exit: readonly [() => void];
|
|
2815
2815
|
readonly on: {
|
|
2816
2816
|
readonly patches: {
|
|
2817
|
-
readonly actions: readonly [
|
|
2817
|
+
readonly actions: readonly [xstate227.ActionFunction<{
|
|
2818
2818
|
behaviors: Set<BehaviorConfig>;
|
|
2819
2819
|
behaviorsSorted: boolean;
|
|
2820
2820
|
converters: Set<Converter>;
|
|
@@ -2832,7 +2832,7 @@ declare const editorMachine: xstate241.StateMachine<{
|
|
|
2832
2832
|
};
|
|
2833
2833
|
dragGhost?: HTMLElement;
|
|
2834
2834
|
slateEditor?: PortableTextSlateEditor;
|
|
2835
|
-
}, PatchesEvent,
|
|
2835
|
+
}, PatchesEvent, InternalPatchEvent | MutationEvent | PatchesEvent | {
|
|
2836
2836
|
type: "update readOnly";
|
|
2837
2837
|
readOnly: boolean;
|
|
2838
2838
|
} | {
|
|
@@ -2879,9 +2879,9 @@ declare const editorMachine: xstate241.StateMachine<{
|
|
|
2879
2879
|
type: "dragend";
|
|
2880
2880
|
} | {
|
|
2881
2881
|
type: "drop";
|
|
2882
|
-
}, undefined, never, never, never, never, {
|
|
2882
|
+
}, undefined, never, never, never, never, InternalPatchEvent | MutationEvent | PatchesEvent | {
|
|
2883
2883
|
type: "blurred";
|
|
2884
|
-
event:
|
|
2884
|
+
event: react20.FocusEvent<HTMLDivElement, Element>;
|
|
2885
2885
|
} | {
|
|
2886
2886
|
type: "done loading";
|
|
2887
2887
|
} | {
|
|
@@ -2893,14 +2893,14 @@ declare const editorMachine: xstate241.StateMachine<{
|
|
|
2893
2893
|
data: unknown;
|
|
2894
2894
|
} | {
|
|
2895
2895
|
type: "focused";
|
|
2896
|
-
event:
|
|
2896
|
+
event: react20.FocusEvent<HTMLDivElement, Element>;
|
|
2897
2897
|
} | {
|
|
2898
2898
|
type: "invalid value";
|
|
2899
2899
|
resolution: InvalidValueResolution | null;
|
|
2900
2900
|
value: Array<PortableTextBlock> | undefined;
|
|
2901
2901
|
} | {
|
|
2902
2902
|
type: "loading";
|
|
2903
|
-
} |
|
|
2903
|
+
} | {
|
|
2904
2904
|
type: "read only";
|
|
2905
2905
|
} | {
|
|
2906
2906
|
type: "ready";
|
|
@@ -2910,7 +2910,7 @@ declare const editorMachine: xstate241.StateMachine<{
|
|
|
2910
2910
|
} | {
|
|
2911
2911
|
type: "value changed";
|
|
2912
2912
|
value: Array<PortableTextBlock> | undefined;
|
|
2913
|
-
}
|
|
2913
|
+
}>];
|
|
2914
2914
|
};
|
|
2915
2915
|
readonly 'syncing value': {
|
|
2916
2916
|
readonly target: "syncing value";
|
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 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/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/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_types8 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_types8.PortableTextObject | _sanity_types8.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.5",
|
|
4
4
|
"description": "Portable Text Editor made in React",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"sanity",
|
|
@@ -79,11 +79,11 @@
|
|
|
79
79
|
"slate-dom": "^0.117.4",
|
|
80
80
|
"slate-react": "0.117.4",
|
|
81
81
|
"xstate": "^5.20.2",
|
|
82
|
-
"@portabletext/
|
|
83
|
-
"@portabletext/sanity-bridge": "1.0.0",
|
|
82
|
+
"@portabletext/block-tools": "3.0.0",
|
|
84
83
|
"@portabletext/patches": "1.1.6",
|
|
84
|
+
"@portabletext/keyboard-shortcuts": "1.1.1",
|
|
85
85
|
"@portabletext/schema": "1.0.0",
|
|
86
|
-
"@portabletext/
|
|
86
|
+
"@portabletext/sanity-bridge": "1.1.0"
|
|
87
87
|
},
|
|
88
88
|
"devDependencies": {
|
|
89
89
|
"@portabletext/toolkit": "^2.0.17",
|