@portabletext/editor 2.8.1 → 2.8.2
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 +82 -86
- package/lib/_chunks-dts/behavior.types.action.d.ts +27 -31
- package/lib/index.cjs +28 -41
- package/lib/index.cjs.map +1 -1
- package/lib/index.js +28 -41
- package/lib/index.js.map +1 -1
- package/lib/plugins/index.d.cts +3 -3
- package/lib/plugins/index.d.ts +3 -3
- package/package.json +3 -3
- package/src/editor/PortableTextEditor.tsx +1 -1
- package/src/editor/plugins/createWithEditableAPI.ts +70 -28
- package/src/index.ts +1 -1
- package/src/operations/behavior.operation.annotation.add.ts +1 -46
- package/src/operations/behavior.operations.ts +1 -2
- package/src/types/editor.ts +19 -3
|
@@ -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
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
|
-
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";
|
|
@@ -44,23 +44,6 @@ type BehaviorConfig = {
|
|
|
44
44
|
behavior: Behavior;
|
|
45
45
|
priority: EditorPriority;
|
|
46
46
|
};
|
|
47
|
-
/**
|
|
48
|
-
* @public
|
|
49
|
-
*/
|
|
50
|
-
type AddedAnnotationPaths = {
|
|
51
|
-
/**
|
|
52
|
-
* @deprecated An annotation may be applied to multiple blocks, resulting
|
|
53
|
-
* in multiple `markDef`'s being created. Use `markDefPaths` instead.
|
|
54
|
-
*/
|
|
55
|
-
markDefPath: Path;
|
|
56
|
-
markDefPaths: Array<Path>;
|
|
57
|
-
/**
|
|
58
|
-
* @deprecated Does not return anything meaningful since an annotation
|
|
59
|
-
* can span multiple blocks and spans. If references the span closest
|
|
60
|
-
* to the focus point of the selection.
|
|
61
|
-
*/
|
|
62
|
-
spanPath: Path;
|
|
63
|
-
};
|
|
64
47
|
/**
|
|
65
48
|
* @public
|
|
66
49
|
*/
|
|
@@ -640,6 +623,23 @@ type ChildPath = [{
|
|
|
640
623
|
interface EditableAPIDeleteOptions {
|
|
641
624
|
mode?: 'blocks' | 'children' | 'selected';
|
|
642
625
|
}
|
|
626
|
+
/**
|
|
627
|
+
* @public
|
|
628
|
+
*/
|
|
629
|
+
type AddedAnnotationPaths = {
|
|
630
|
+
/**
|
|
631
|
+
* @deprecated An annotation may be applied to multiple blocks, resulting
|
|
632
|
+
* in multiple `markDef`'s being created. Use `markDefPaths` instead.
|
|
633
|
+
*/
|
|
634
|
+
markDefPath: Path;
|
|
635
|
+
markDefPaths: Array<Path>;
|
|
636
|
+
/**
|
|
637
|
+
* @deprecated Does not return anything meaningful since an annotation
|
|
638
|
+
* can span multiple blocks and spans. If references the span closest
|
|
639
|
+
* to the focus point of the selection.
|
|
640
|
+
*/
|
|
641
|
+
spanPath: Path;
|
|
642
|
+
};
|
|
643
643
|
/** @beta */
|
|
644
644
|
interface EditableAPI {
|
|
645
645
|
activeAnnotations: () => PortableTextObject[];
|
|
@@ -648,11 +648,7 @@ interface EditableAPI {
|
|
|
648
648
|
name: string;
|
|
649
649
|
}>(type: TSchemaType, value?: {
|
|
650
650
|
[prop: string]: unknown;
|
|
651
|
-
}) =>
|
|
652
|
-
markDefPath: Path;
|
|
653
|
-
markDefPaths: Array<Path>;
|
|
654
|
-
spanPath: Path;
|
|
655
|
-
} | undefined;
|
|
651
|
+
}) => AddedAnnotationPaths | undefined;
|
|
656
652
|
blur: () => void;
|
|
657
653
|
delete: (selection: EditorSelection, options?: EditableAPIDeleteOptions) => void;
|
|
658
654
|
findByPath: (path: Path) => [PortableTextBlock | PortableTextChild | undefined, Path | undefined];
|
|
@@ -1176,7 +1172,7 @@ type EditorActor = ActorRefFrom<typeof editorMachine>;
|
|
|
1176
1172
|
/**
|
|
1177
1173
|
* @internal
|
|
1178
1174
|
*/
|
|
1179
|
-
declare const editorMachine:
|
|
1175
|
+
declare const editorMachine: xstate227.StateMachine<{
|
|
1180
1176
|
behaviors: Set<BehaviorConfig>;
|
|
1181
1177
|
behaviorsSorted: boolean;
|
|
1182
1178
|
converters: Set<Converter>;
|
|
@@ -1194,7 +1190,7 @@ declare const editorMachine: xstate241.StateMachine<{
|
|
|
1194
1190
|
};
|
|
1195
1191
|
dragGhost?: HTMLElement;
|
|
1196
1192
|
slateEditor?: PortableTextSlateEditor;
|
|
1197
|
-
},
|
|
1193
|
+
}, InternalPatchEvent | MutationEvent | PatchesEvent | {
|
|
1198
1194
|
type: "update readOnly";
|
|
1199
1195
|
readOnly: boolean;
|
|
1200
1196
|
} | {
|
|
@@ -1241,58 +1237,58 @@ declare const editorMachine: xstate241.StateMachine<{
|
|
|
1241
1237
|
type: "dragend";
|
|
1242
1238
|
} | {
|
|
1243
1239
|
type: "drop";
|
|
1244
|
-
}, {}, never,
|
|
1240
|
+
}, {}, never, xstate227.Values<{
|
|
1245
1241
|
"add behavior to context": {
|
|
1246
1242
|
type: "add behavior to context";
|
|
1247
|
-
params:
|
|
1243
|
+
params: xstate227.NonReducibleUnknown;
|
|
1248
1244
|
};
|
|
1249
1245
|
"remove behavior from context": {
|
|
1250
1246
|
type: "remove behavior from context";
|
|
1251
|
-
params:
|
|
1247
|
+
params: xstate227.NonReducibleUnknown;
|
|
1252
1248
|
};
|
|
1253
1249
|
"emit patch event": {
|
|
1254
1250
|
type: "emit patch event";
|
|
1255
|
-
params:
|
|
1251
|
+
params: xstate227.NonReducibleUnknown;
|
|
1256
1252
|
};
|
|
1257
1253
|
"emit mutation event": {
|
|
1258
1254
|
type: "emit mutation event";
|
|
1259
|
-
params:
|
|
1255
|
+
params: xstate227.NonReducibleUnknown;
|
|
1260
1256
|
};
|
|
1261
1257
|
"emit read only": {
|
|
1262
1258
|
type: "emit read only";
|
|
1263
|
-
params:
|
|
1259
|
+
params: xstate227.NonReducibleUnknown;
|
|
1264
1260
|
};
|
|
1265
1261
|
"emit editable": {
|
|
1266
1262
|
type: "emit editable";
|
|
1267
|
-
params:
|
|
1263
|
+
params: xstate227.NonReducibleUnknown;
|
|
1268
1264
|
};
|
|
1269
1265
|
"defer event": {
|
|
1270
1266
|
type: "defer event";
|
|
1271
|
-
params:
|
|
1267
|
+
params: xstate227.NonReducibleUnknown;
|
|
1272
1268
|
};
|
|
1273
1269
|
"emit pending events": {
|
|
1274
1270
|
type: "emit pending events";
|
|
1275
|
-
params:
|
|
1271
|
+
params: xstate227.NonReducibleUnknown;
|
|
1276
1272
|
};
|
|
1277
1273
|
"emit ready": {
|
|
1278
1274
|
type: "emit ready";
|
|
1279
|
-
params:
|
|
1275
|
+
params: xstate227.NonReducibleUnknown;
|
|
1280
1276
|
};
|
|
1281
1277
|
"clear pending events": {
|
|
1282
1278
|
type: "clear pending events";
|
|
1283
|
-
params:
|
|
1279
|
+
params: xstate227.NonReducibleUnknown;
|
|
1284
1280
|
};
|
|
1285
1281
|
"defer incoming patches": {
|
|
1286
1282
|
type: "defer incoming patches";
|
|
1287
|
-
params:
|
|
1283
|
+
params: xstate227.NonReducibleUnknown;
|
|
1288
1284
|
};
|
|
1289
1285
|
"emit pending incoming patches": {
|
|
1290
1286
|
type: "emit pending incoming patches";
|
|
1291
|
-
params:
|
|
1287
|
+
params: xstate227.NonReducibleUnknown;
|
|
1292
1288
|
};
|
|
1293
1289
|
"clear pending incoming patches": {
|
|
1294
1290
|
type: "clear pending incoming patches";
|
|
1295
|
-
params:
|
|
1291
|
+
params: xstate227.NonReducibleUnknown;
|
|
1296
1292
|
};
|
|
1297
1293
|
"handle blur": {
|
|
1298
1294
|
type: "handle blur";
|
|
@@ -1308,7 +1304,7 @@ declare const editorMachine: xstate241.StateMachine<{
|
|
|
1308
1304
|
};
|
|
1309
1305
|
"sort behaviors": {
|
|
1310
1306
|
type: "sort behaviors";
|
|
1311
|
-
params:
|
|
1307
|
+
params: xstate227.NonReducibleUnknown;
|
|
1312
1308
|
};
|
|
1313
1309
|
}>, {
|
|
1314
1310
|
type: "slate is busy";
|
|
@@ -1337,7 +1333,7 @@ declare const editorMachine: xstate241.StateMachine<{
|
|
|
1337
1333
|
readOnly?: boolean;
|
|
1338
1334
|
schema: EditorSchema;
|
|
1339
1335
|
initialValue?: Array<PortableTextBlock>;
|
|
1340
|
-
},
|
|
1336
|
+
}, xstate227.NonReducibleUnknown, InternalPatchEvent | MutationEvent | PatchesEvent | {
|
|
1341
1337
|
type: "blurred";
|
|
1342
1338
|
event: react22.FocusEvent<HTMLDivElement, Element>;
|
|
1343
1339
|
} | {
|
|
@@ -1358,7 +1354,7 @@ declare const editorMachine: xstate241.StateMachine<{
|
|
|
1358
1354
|
value: Array<PortableTextBlock> | undefined;
|
|
1359
1355
|
} | {
|
|
1360
1356
|
type: "loading";
|
|
1361
|
-
} |
|
|
1357
|
+
} | {
|
|
1362
1358
|
type: "read only";
|
|
1363
1359
|
} | {
|
|
1364
1360
|
type: "ready";
|
|
@@ -1368,19 +1364,19 @@ declare const editorMachine: xstate241.StateMachine<{
|
|
|
1368
1364
|
} | {
|
|
1369
1365
|
type: "value changed";
|
|
1370
1366
|
value: Array<PortableTextBlock> | undefined;
|
|
1371
|
-
}
|
|
1367
|
+
}, xstate227.MetaObject, {
|
|
1372
1368
|
readonly id: "editor";
|
|
1373
1369
|
readonly context: ({
|
|
1374
1370
|
input
|
|
1375
1371
|
}: {
|
|
1376
1372
|
spawn: {
|
|
1377
|
-
<TSrc extends never>(logic: TSrc, ...[options]: never):
|
|
1378
|
-
<TLogic extends
|
|
1373
|
+
<TSrc extends never>(logic: TSrc, ...[options]: never): xstate227.ActorRefFromLogic<never>;
|
|
1374
|
+
<TLogic extends xstate227.AnyActorLogic>(src: TLogic, ...[options]: xstate227.ConditionalRequired<[options?: ({
|
|
1379
1375
|
id?: never;
|
|
1380
1376
|
systemId?: string;
|
|
1381
|
-
input?:
|
|
1377
|
+
input?: xstate227.InputFrom<TLogic> | undefined;
|
|
1382
1378
|
syncSnapshot?: boolean;
|
|
1383
|
-
} & { [K in
|
|
1379
|
+
} & { [K in xstate227.RequiredLogicInput<TLogic>]: unknown }) | undefined], xstate227.IsNotNever<xstate227.RequiredLogicInput<TLogic>>>): xstate227.ActorRefFromLogic<TLogic>;
|
|
1384
1380
|
};
|
|
1385
1381
|
input: {
|
|
1386
1382
|
converters?: Array<Converter>;
|
|
@@ -1391,7 +1387,7 @@ declare const editorMachine: xstate241.StateMachine<{
|
|
|
1391
1387
|
schema: EditorSchema;
|
|
1392
1388
|
initialValue?: Array<PortableTextBlock>;
|
|
1393
1389
|
};
|
|
1394
|
-
self:
|
|
1390
|
+
self: xstate227.ActorRef<xstate227.MachineSnapshot<{
|
|
1395
1391
|
behaviors: Set<BehaviorConfig>;
|
|
1396
1392
|
behaviorsSorted: boolean;
|
|
1397
1393
|
converters: Set<Converter>;
|
|
@@ -1409,7 +1405,7 @@ declare const editorMachine: xstate241.StateMachine<{
|
|
|
1409
1405
|
};
|
|
1410
1406
|
dragGhost?: HTMLElement;
|
|
1411
1407
|
slateEditor?: PortableTextSlateEditor;
|
|
1412
|
-
},
|
|
1408
|
+
}, InternalPatchEvent | MutationEvent | PatchesEvent | {
|
|
1413
1409
|
type: "update readOnly";
|
|
1414
1410
|
readOnly: boolean;
|
|
1415
1411
|
} | {
|
|
@@ -1456,7 +1452,7 @@ declare const editorMachine: xstate241.StateMachine<{
|
|
|
1456
1452
|
type: "dragend";
|
|
1457
1453
|
} | {
|
|
1458
1454
|
type: "drop";
|
|
1459
|
-
}, Record<string,
|
|
1455
|
+
}, Record<string, xstate227.AnyActorRef | undefined>, xstate227.StateValue, string, unknown, any, any>, InternalPatchEvent | MutationEvent | PatchesEvent | {
|
|
1460
1456
|
type: "update readOnly";
|
|
1461
1457
|
readOnly: boolean;
|
|
1462
1458
|
} | {
|
|
@@ -1503,10 +1499,10 @@ declare const editorMachine: xstate241.StateMachine<{
|
|
|
1503
1499
|
type: "dragend";
|
|
1504
1500
|
} | {
|
|
1505
1501
|
type: "drop";
|
|
1506
|
-
},
|
|
1502
|
+
}, xstate227.AnyEventObject>;
|
|
1507
1503
|
}) => {
|
|
1508
1504
|
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.block" | "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" | "deserialize.data" | "deserialization.success" | "deserialization.failure" | "insert.blocks" | "insert.break" | "insert.inline object" | "insert.soft break" | "insert.span" | "list item.add" | "list item.remove" | "list item.toggle" | "move.block down" | "move.block up" | "select.previous block" | "select.next block" | "serialize" | "serialize.data" | "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" | "history.*" | "split.*" | "delete.*" | "select.*" | "deserialize.*" | "serialize.*" | "annotation.*" | "block.*" | "child.*" | "decorator.*" | "insert.*" | "move.*" | "deserialization.*" | "list item.*" | "serialization.*" | "
|
|
1505
|
+
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.block" | "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" | "deserialize.data" | "deserialization.success" | "deserialization.failure" | "insert.blocks" | "insert.break" | "insert.inline object" | "insert.soft break" | "insert.span" | "list item.add" | "list item.remove" | "list item.toggle" | "move.block down" | "move.block up" | "select.previous block" | "select.next block" | "serialize" | "serialize.data" | "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
1506
|
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.block" | "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" | "deserialize.data" | "deserialization.success" | "deserialization.failure" | "insert.blocks" | "insert.break" | "insert.inline object" | "insert.soft break" | "insert.span" | "list item.add" | "list item.remove" | "list item.toggle" | "move.block down" | "move.block up" | "select.previous block" | "select.next block" | "serialize" | "serialize.data" | "serialization.success" | "serialization.failure" | "style.add" | "style.remove" | "style.toggle", "annotation.add">;
|
|
1511
1507
|
annotation: {
|
|
1512
1508
|
name: string;
|
|
@@ -1798,7 +1794,7 @@ declare const editorMachine: xstate241.StateMachine<{
|
|
|
1798
1794
|
readonly actions: "remove behavior from context";
|
|
1799
1795
|
};
|
|
1800
1796
|
readonly 'update maxBlocks': {
|
|
1801
|
-
readonly actions:
|
|
1797
|
+
readonly actions: xstate227.ActionFunction<{
|
|
1802
1798
|
behaviors: Set<BehaviorConfig>;
|
|
1803
1799
|
behaviorsSorted: boolean;
|
|
1804
1800
|
converters: Set<Converter>;
|
|
@@ -1819,7 +1815,7 @@ declare const editorMachine: xstate241.StateMachine<{
|
|
|
1819
1815
|
}, {
|
|
1820
1816
|
type: "update maxBlocks";
|
|
1821
1817
|
maxBlocks: number | undefined;
|
|
1822
|
-
},
|
|
1818
|
+
}, InternalPatchEvent | MutationEvent | PatchesEvent | {
|
|
1823
1819
|
type: "update readOnly";
|
|
1824
1820
|
readOnly: boolean;
|
|
1825
1821
|
} | {
|
|
@@ -1869,7 +1865,7 @@ declare const editorMachine: xstate241.StateMachine<{
|
|
|
1869
1865
|
}, undefined, never, never, never, never, never>;
|
|
1870
1866
|
};
|
|
1871
1867
|
readonly 'update selection': {
|
|
1872
|
-
readonly actions: readonly [
|
|
1868
|
+
readonly actions: readonly [xstate227.ActionFunction<{
|
|
1873
1869
|
behaviors: Set<BehaviorConfig>;
|
|
1874
1870
|
behaviorsSorted: boolean;
|
|
1875
1871
|
converters: Set<Converter>;
|
|
@@ -1890,7 +1886,7 @@ declare const editorMachine: xstate241.StateMachine<{
|
|
|
1890
1886
|
}, {
|
|
1891
1887
|
type: "update selection";
|
|
1892
1888
|
selection: EditorSelection;
|
|
1893
|
-
},
|
|
1889
|
+
}, InternalPatchEvent | MutationEvent | PatchesEvent | {
|
|
1894
1890
|
type: "update readOnly";
|
|
1895
1891
|
readOnly: boolean;
|
|
1896
1892
|
} | {
|
|
@@ -1937,7 +1933,7 @@ declare const editorMachine: xstate241.StateMachine<{
|
|
|
1937
1933
|
type: "dragend";
|
|
1938
1934
|
} | {
|
|
1939
1935
|
type: "drop";
|
|
1940
|
-
}, undefined, never, never, never, never, never>,
|
|
1936
|
+
}, undefined, never, never, never, never, never>, xstate227.ActionFunction<{
|
|
1941
1937
|
behaviors: Set<BehaviorConfig>;
|
|
1942
1938
|
behaviorsSorted: boolean;
|
|
1943
1939
|
converters: Set<Converter>;
|
|
@@ -1958,7 +1954,7 @@ declare const editorMachine: xstate241.StateMachine<{
|
|
|
1958
1954
|
}, {
|
|
1959
1955
|
type: "update selection";
|
|
1960
1956
|
selection: EditorSelection;
|
|
1961
|
-
},
|
|
1957
|
+
}, InternalPatchEvent | MutationEvent | PatchesEvent | {
|
|
1962
1958
|
type: "update readOnly";
|
|
1963
1959
|
readOnly: boolean;
|
|
1964
1960
|
} | {
|
|
@@ -2005,7 +2001,7 @@ declare const editorMachine: xstate241.StateMachine<{
|
|
|
2005
2001
|
type: "dragend";
|
|
2006
2002
|
} | {
|
|
2007
2003
|
type: "drop";
|
|
2008
|
-
}, undefined, never, never, never, never, {
|
|
2004
|
+
}, undefined, never, never, never, never, InternalPatchEvent | MutationEvent | PatchesEvent | {
|
|
2009
2005
|
type: "blurred";
|
|
2010
2006
|
event: react22.FocusEvent<HTMLDivElement, Element>;
|
|
2011
2007
|
} | {
|
|
@@ -2026,7 +2022,7 @@ declare const editorMachine: xstate241.StateMachine<{
|
|
|
2026
2022
|
value: Array<PortableTextBlock> | undefined;
|
|
2027
2023
|
} | {
|
|
2028
2024
|
type: "loading";
|
|
2029
|
-
} |
|
|
2025
|
+
} | {
|
|
2030
2026
|
type: "read only";
|
|
2031
2027
|
} | {
|
|
2032
2028
|
type: "ready";
|
|
@@ -2036,10 +2032,10 @@ declare const editorMachine: xstate241.StateMachine<{
|
|
|
2036
2032
|
} | {
|
|
2037
2033
|
type: "value changed";
|
|
2038
2034
|
value: Array<PortableTextBlock> | undefined;
|
|
2039
|
-
}
|
|
2035
|
+
}>];
|
|
2040
2036
|
};
|
|
2041
2037
|
readonly 'set drag ghost': {
|
|
2042
|
-
readonly actions:
|
|
2038
|
+
readonly actions: xstate227.ActionFunction<{
|
|
2043
2039
|
behaviors: Set<BehaviorConfig>;
|
|
2044
2040
|
behaviorsSorted: boolean;
|
|
2045
2041
|
converters: Set<Converter>;
|
|
@@ -2060,7 +2056,7 @@ declare const editorMachine: xstate241.StateMachine<{
|
|
|
2060
2056
|
}, {
|
|
2061
2057
|
type: "set drag ghost";
|
|
2062
2058
|
ghost: HTMLElement;
|
|
2063
|
-
},
|
|
2059
|
+
}, InternalPatchEvent | MutationEvent | PatchesEvent | {
|
|
2064
2060
|
type: "update readOnly";
|
|
2065
2061
|
readOnly: boolean;
|
|
2066
2062
|
} | {
|
|
@@ -2122,7 +2118,7 @@ declare const editorMachine: xstate241.StateMachine<{
|
|
|
2122
2118
|
readonly actions: readonly ["sort behaviors", "handle behavior event"];
|
|
2123
2119
|
readonly guard: ({
|
|
2124
2120
|
event
|
|
2125
|
-
}:
|
|
2121
|
+
}: xstate_guards12.GuardArgs<{
|
|
2126
2122
|
behaviors: Set<BehaviorConfig>;
|
|
2127
2123
|
behaviorsSorted: boolean;
|
|
2128
2124
|
converters: Set<Converter>;
|
|
@@ -2159,7 +2155,7 @@ declare const editorMachine: xstate241.StateMachine<{
|
|
|
2159
2155
|
readonly target: "#editor.edit mode.read only.read only";
|
|
2160
2156
|
readonly guard: ({
|
|
2161
2157
|
context
|
|
2162
|
-
}:
|
|
2158
|
+
}: xstate_guards12.GuardArgs<{
|
|
2163
2159
|
behaviors: Set<BehaviorConfig>;
|
|
2164
2160
|
behaviorsSorted: boolean;
|
|
2165
2161
|
converters: Set<Converter>;
|
|
@@ -2192,7 +2188,7 @@ declare const editorMachine: xstate241.StateMachine<{
|
|
|
2192
2188
|
readonly 'update readOnly': {
|
|
2193
2189
|
readonly guard: ({
|
|
2194
2190
|
event
|
|
2195
|
-
}:
|
|
2191
|
+
}: xstate_guards12.GuardArgs<{
|
|
2196
2192
|
behaviors: Set<BehaviorConfig>;
|
|
2197
2193
|
behaviorsSorted: boolean;
|
|
2198
2194
|
converters: Set<Converter>;
|
|
@@ -2226,7 +2222,7 @@ declare const editorMachine: xstate241.StateMachine<{
|
|
|
2226
2222
|
readonly 'update readOnly': {
|
|
2227
2223
|
readonly guard: ({
|
|
2228
2224
|
event
|
|
2229
|
-
}:
|
|
2225
|
+
}: xstate_guards12.GuardArgs<{
|
|
2230
2226
|
behaviors: Set<BehaviorConfig>;
|
|
2231
2227
|
behaviorsSorted: boolean;
|
|
2232
2228
|
converters: Set<Converter>;
|
|
@@ -2259,7 +2255,7 @@ declare const editorMachine: xstate241.StateMachine<{
|
|
|
2259
2255
|
};
|
|
2260
2256
|
readonly focus: {
|
|
2261
2257
|
readonly target: ".focusing";
|
|
2262
|
-
readonly actions: readonly [
|
|
2258
|
+
readonly actions: readonly [xstate227.ActionFunction<{
|
|
2263
2259
|
behaviors: Set<BehaviorConfig>;
|
|
2264
2260
|
behaviorsSorted: boolean;
|
|
2265
2261
|
converters: Set<Converter>;
|
|
@@ -2280,7 +2276,7 @@ declare const editorMachine: xstate241.StateMachine<{
|
|
|
2280
2276
|
}, {
|
|
2281
2277
|
type: "focus";
|
|
2282
2278
|
editor: PortableTextSlateEditor;
|
|
2283
|
-
},
|
|
2279
|
+
}, InternalPatchEvent | MutationEvent | PatchesEvent | {
|
|
2284
2280
|
type: "update readOnly";
|
|
2285
2281
|
readOnly: boolean;
|
|
2286
2282
|
} | {
|
|
@@ -2337,7 +2333,7 @@ declare const editorMachine: xstate241.StateMachine<{
|
|
|
2337
2333
|
readonly exit: readonly [() => void];
|
|
2338
2334
|
readonly on: {
|
|
2339
2335
|
readonly dragstart: {
|
|
2340
|
-
readonly actions: readonly [
|
|
2336
|
+
readonly actions: readonly [xstate227.ActionFunction<{
|
|
2341
2337
|
behaviors: Set<BehaviorConfig>;
|
|
2342
2338
|
behaviorsSorted: boolean;
|
|
2343
2339
|
converters: Set<Converter>;
|
|
@@ -2359,7 +2355,7 @@ declare const editorMachine: xstate241.StateMachine<{
|
|
|
2359
2355
|
type: "dragstart";
|
|
2360
2356
|
ghost?: HTMLElement;
|
|
2361
2357
|
origin: Pick<EventPosition, "selection">;
|
|
2362
|
-
},
|
|
2358
|
+
}, InternalPatchEvent | MutationEvent | PatchesEvent | {
|
|
2363
2359
|
type: "update readOnly";
|
|
2364
2360
|
readOnly: boolean;
|
|
2365
2361
|
} | {
|
|
@@ -2440,7 +2436,7 @@ declare const editorMachine: xstate241.StateMachine<{
|
|
|
2440
2436
|
readonly entry: readonly [() => void];
|
|
2441
2437
|
readonly exit: readonly [() => void, ({
|
|
2442
2438
|
context
|
|
2443
|
-
}:
|
|
2439
|
+
}: xstate227.ActionArgs<{
|
|
2444
2440
|
behaviors: Set<BehaviorConfig>;
|
|
2445
2441
|
behaviorsSorted: boolean;
|
|
2446
2442
|
converters: Set<Converter>;
|
|
@@ -2458,7 +2454,7 @@ declare const editorMachine: xstate241.StateMachine<{
|
|
|
2458
2454
|
};
|
|
2459
2455
|
dragGhost?: HTMLElement;
|
|
2460
2456
|
slateEditor?: PortableTextSlateEditor;
|
|
2461
|
-
},
|
|
2457
|
+
}, InternalPatchEvent | MutationEvent | PatchesEvent | {
|
|
2462
2458
|
type: "update readOnly";
|
|
2463
2459
|
readOnly: boolean;
|
|
2464
2460
|
} | {
|
|
@@ -2505,7 +2501,7 @@ declare const editorMachine: xstate241.StateMachine<{
|
|
|
2505
2501
|
type: "dragend";
|
|
2506
2502
|
} | {
|
|
2507
2503
|
type: "drop";
|
|
2508
|
-
},
|
|
2504
|
+
}, InternalPatchEvent | MutationEvent | PatchesEvent | {
|
|
2509
2505
|
type: "update readOnly";
|
|
2510
2506
|
readOnly: boolean;
|
|
2511
2507
|
} | {
|
|
@@ -2552,7 +2548,7 @@ declare const editorMachine: xstate241.StateMachine<{
|
|
|
2552
2548
|
type: "dragend";
|
|
2553
2549
|
} | {
|
|
2554
2550
|
type: "drop";
|
|
2555
|
-
}>) => void,
|
|
2551
|
+
}>) => void, xstate227.ActionFunction<{
|
|
2556
2552
|
behaviors: Set<BehaviorConfig>;
|
|
2557
2553
|
behaviorsSorted: boolean;
|
|
2558
2554
|
converters: Set<Converter>;
|
|
@@ -2570,7 +2566,7 @@ declare const editorMachine: xstate241.StateMachine<{
|
|
|
2570
2566
|
};
|
|
2571
2567
|
dragGhost?: HTMLElement;
|
|
2572
2568
|
slateEditor?: PortableTextSlateEditor;
|
|
2573
|
-
},
|
|
2569
|
+
}, InternalPatchEvent | MutationEvent | PatchesEvent | {
|
|
2574
2570
|
type: "update readOnly";
|
|
2575
2571
|
readOnly: boolean;
|
|
2576
2572
|
} | {
|
|
@@ -2617,7 +2613,7 @@ declare const editorMachine: xstate241.StateMachine<{
|
|
|
2617
2613
|
type: "dragend";
|
|
2618
2614
|
} | {
|
|
2619
2615
|
type: "drop";
|
|
2620
|
-
},
|
|
2616
|
+
}, InternalPatchEvent | MutationEvent | PatchesEvent | {
|
|
2621
2617
|
type: "update readOnly";
|
|
2622
2618
|
readOnly: boolean;
|
|
2623
2619
|
} | {
|
|
@@ -2664,7 +2660,7 @@ declare const editorMachine: xstate241.StateMachine<{
|
|
|
2664
2660
|
type: "dragend";
|
|
2665
2661
|
} | {
|
|
2666
2662
|
type: "drop";
|
|
2667
|
-
}, undefined, never, never, never, never, never>,
|
|
2663
|
+
}, undefined, never, never, never, never, never>, xstate227.ActionFunction<{
|
|
2668
2664
|
behaviors: Set<BehaviorConfig>;
|
|
2669
2665
|
behaviorsSorted: boolean;
|
|
2670
2666
|
converters: Set<Converter>;
|
|
@@ -2682,7 +2678,7 @@ declare const editorMachine: xstate241.StateMachine<{
|
|
|
2682
2678
|
};
|
|
2683
2679
|
dragGhost?: HTMLElement;
|
|
2684
2680
|
slateEditor?: PortableTextSlateEditor;
|
|
2685
|
-
},
|
|
2681
|
+
}, InternalPatchEvent | MutationEvent | PatchesEvent | {
|
|
2686
2682
|
type: "update readOnly";
|
|
2687
2683
|
readOnly: boolean;
|
|
2688
2684
|
} | {
|
|
@@ -2729,7 +2725,7 @@ declare const editorMachine: xstate241.StateMachine<{
|
|
|
2729
2725
|
type: "dragend";
|
|
2730
2726
|
} | {
|
|
2731
2727
|
type: "drop";
|
|
2732
|
-
},
|
|
2728
|
+
}, InternalPatchEvent | MutationEvent | PatchesEvent | {
|
|
2733
2729
|
type: "update readOnly";
|
|
2734
2730
|
readOnly: boolean;
|
|
2735
2731
|
} | {
|
|
@@ -2823,7 +2819,7 @@ declare const editorMachine: xstate241.StateMachine<{
|
|
|
2823
2819
|
readonly exit: readonly [() => void];
|
|
2824
2820
|
readonly on: {
|
|
2825
2821
|
readonly patches: {
|
|
2826
|
-
readonly actions: readonly [
|
|
2822
|
+
readonly actions: readonly [xstate227.ActionFunction<{
|
|
2827
2823
|
behaviors: Set<BehaviorConfig>;
|
|
2828
2824
|
behaviorsSorted: boolean;
|
|
2829
2825
|
converters: Set<Converter>;
|
|
@@ -2841,7 +2837,7 @@ declare const editorMachine: xstate241.StateMachine<{
|
|
|
2841
2837
|
};
|
|
2842
2838
|
dragGhost?: HTMLElement;
|
|
2843
2839
|
slateEditor?: PortableTextSlateEditor;
|
|
2844
|
-
}, PatchesEvent,
|
|
2840
|
+
}, PatchesEvent, InternalPatchEvent | MutationEvent | PatchesEvent | {
|
|
2845
2841
|
type: "update readOnly";
|
|
2846
2842
|
readOnly: boolean;
|
|
2847
2843
|
} | {
|
|
@@ -2888,7 +2884,7 @@ declare const editorMachine: xstate241.StateMachine<{
|
|
|
2888
2884
|
type: "dragend";
|
|
2889
2885
|
} | {
|
|
2890
2886
|
type: "drop";
|
|
2891
|
-
}, undefined, never, never, never, never, {
|
|
2887
|
+
}, undefined, never, never, never, never, InternalPatchEvent | MutationEvent | PatchesEvent | {
|
|
2892
2888
|
type: "blurred";
|
|
2893
2889
|
event: react22.FocusEvent<HTMLDivElement, Element>;
|
|
2894
2890
|
} | {
|
|
@@ -2909,7 +2905,7 @@ declare const editorMachine: xstate241.StateMachine<{
|
|
|
2909
2905
|
value: Array<PortableTextBlock> | undefined;
|
|
2910
2906
|
} | {
|
|
2911
2907
|
type: "loading";
|
|
2912
|
-
} |
|
|
2908
|
+
} | {
|
|
2913
2909
|
type: "read only";
|
|
2914
2910
|
} | {
|
|
2915
2911
|
type: "ready";
|
|
@@ -2919,7 +2915,7 @@ declare const editorMachine: xstate241.StateMachine<{
|
|
|
2919
2915
|
} | {
|
|
2920
2916
|
type: "value changed";
|
|
2921
2917
|
value: Array<PortableTextBlock> | undefined;
|
|
2922
|
-
}
|
|
2918
|
+
}>];
|
|
2923
2919
|
};
|
|
2924
2920
|
readonly 'syncing value': {
|
|
2925
2921
|
readonly target: "syncing value";
|