@portabletext/editor 2.14.0 → 2.14.1
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/README.md +44 -0
- package/lib/_chunks-dts/behavior.types.action.d.cts +113 -128
- package/lib/_chunks-dts/behavior.types.action.d.ts +122 -137
- package/lib/index.cjs +145 -138
- package/lib/index.cjs.map +1 -1
- package/lib/index.js +145 -138
- package/lib/index.js.map +1 -1
- package/package.json +1 -1
- package/src/behaviors/behavior.abstract.insert.ts +19 -0
- package/src/editor/editor-machine.ts +37 -44
- package/src/editor/editor-provider.tsx +4 -0
- package/src/editor/plugins/createWithObjectKeys.ts +19 -15
- package/src/editor/plugins/createWithPortableTextMarkModel.ts +60 -53
- package/src/editor/plugins/createWithSchemaTypes.ts +18 -15
- package/src/editor/plugins/createWithUndoRedo.ts +3 -1
- package/src/editor/with-normalizing-node.ts +14 -0
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import * as _sanity_types5 from "@sanity/types";
|
|
2
2
|
import { ArrayDefinition, ArraySchemaType, BlockDecoratorDefinition, BlockListDefinition, BlockStyleDefinition, ObjectSchemaType, Path, PortableTextBlock, PortableTextBlock as PortableTextBlock$1, PortableTextChild, PortableTextChild as PortableTextChild$1, PortableTextListBlock, PortableTextObject, PortableTextObject as PortableTextObject$2, PortableTextSpan, PortableTextSpan as PortableTextSpan$2, PortableTextTextBlock, PortableTextTextBlock as PortableTextTextBlock$2, TypedObject } from "@sanity/types";
|
|
3
3
|
import { BaseRange, Descendant, Operation } from "slate";
|
|
4
|
-
import * as
|
|
4
|
+
import * as xstate229 from "xstate";
|
|
5
5
|
import { ActorRef, ActorRefFrom, EventObject, Snapshot } from "xstate";
|
|
6
6
|
import * as react20 from "react";
|
|
7
7
|
import React$1, { BaseSyntheticEvent, ClipboardEvent, Component, FocusEvent, JSX, KeyboardEvent as KeyboardEvent$1, MutableRefObject, PropsWithChildren, ReactElement, RefObject, TextareaHTMLAttributes } from "react";
|
|
8
8
|
import { Patch, Patch as Patch$1 } from "@portabletext/patches";
|
|
9
|
-
import * as
|
|
9
|
+
import * as _portabletext_schema5 from "@portabletext/schema";
|
|
10
10
|
import { AnnotationDefinition, AnnotationSchemaType, BaseDefinition, BlockObjectDefinition, BlockObjectSchemaType, DecoratorDefinition, DecoratorSchemaType, FieldDefinition, InlineObjectDefinition, InlineObjectSchemaType, ListDefinition, ListSchemaType, PortableTextObject as PortableTextObject$1, PortableTextSpan as PortableTextSpan$1, PortableTextTextBlock as PortableTextTextBlock$1, Schema, SchemaDefinition, SchemaDefinition as SchemaDefinition$1, StyleDefinition, StyleSchemaType, defineSchema } from "@portabletext/schema";
|
|
11
11
|
import { Observable, Subject } from "rxjs";
|
|
12
12
|
import { DOMNode } from "slate-dom";
|
|
@@ -1360,7 +1360,7 @@ type EditorActor = ActorRefFrom<typeof editorMachine>;
|
|
|
1360
1360
|
/**
|
|
1361
1361
|
* @internal
|
|
1362
1362
|
*/
|
|
1363
|
-
declare const editorMachine:
|
|
1363
|
+
declare const editorMachine: xstate229.StateMachine<{
|
|
1364
1364
|
behaviors: Set<BehaviorConfig>;
|
|
1365
1365
|
behaviorsSorted: boolean;
|
|
1366
1366
|
converters: Set<Converter>;
|
|
@@ -1396,13 +1396,9 @@ declare const editorMachine: xstate227.StateMachine<{
|
|
|
1396
1396
|
} | {
|
|
1397
1397
|
type: "focus";
|
|
1398
1398
|
editor: PortableTextSlateEditor;
|
|
1399
|
-
} | {
|
|
1400
|
-
type: "normalizing";
|
|
1401
1399
|
} | {
|
|
1402
1400
|
type: "update selection";
|
|
1403
1401
|
selection: EditorSelection;
|
|
1404
|
-
} | {
|
|
1405
|
-
type: "done normalizing";
|
|
1406
1402
|
} | {
|
|
1407
1403
|
type: "done syncing value";
|
|
1408
1404
|
} | {
|
|
@@ -1425,58 +1421,65 @@ declare const editorMachine: xstate227.StateMachine<{
|
|
|
1425
1421
|
type: "dragend";
|
|
1426
1422
|
} | {
|
|
1427
1423
|
type: "drop";
|
|
1428
|
-
}
|
|
1424
|
+
} | {
|
|
1425
|
+
type: "add slate editor";
|
|
1426
|
+
editor: PortableTextSlateEditor;
|
|
1427
|
+
}, {}, never, xstate229.Values<{
|
|
1429
1428
|
"add behavior to context": {
|
|
1430
1429
|
type: "add behavior to context";
|
|
1431
|
-
params:
|
|
1430
|
+
params: xstate229.NonReducibleUnknown;
|
|
1432
1431
|
};
|
|
1433
1432
|
"remove behavior from context": {
|
|
1434
1433
|
type: "remove behavior from context";
|
|
1435
|
-
params:
|
|
1434
|
+
params: xstate229.NonReducibleUnknown;
|
|
1435
|
+
};
|
|
1436
|
+
"add slate editor to context": {
|
|
1437
|
+
type: "add slate editor to context";
|
|
1438
|
+
params: xstate229.NonReducibleUnknown;
|
|
1436
1439
|
};
|
|
1437
1440
|
"emit patch event": {
|
|
1438
1441
|
type: "emit patch event";
|
|
1439
|
-
params:
|
|
1442
|
+
params: xstate229.NonReducibleUnknown;
|
|
1440
1443
|
};
|
|
1441
1444
|
"emit mutation event": {
|
|
1442
1445
|
type: "emit mutation event";
|
|
1443
|
-
params:
|
|
1446
|
+
params: xstate229.NonReducibleUnknown;
|
|
1444
1447
|
};
|
|
1445
1448
|
"emit read only": {
|
|
1446
1449
|
type: "emit read only";
|
|
1447
|
-
params:
|
|
1450
|
+
params: xstate229.NonReducibleUnknown;
|
|
1448
1451
|
};
|
|
1449
1452
|
"emit editable": {
|
|
1450
1453
|
type: "emit editable";
|
|
1451
|
-
params:
|
|
1454
|
+
params: xstate229.NonReducibleUnknown;
|
|
1452
1455
|
};
|
|
1453
1456
|
"defer event": {
|
|
1454
1457
|
type: "defer event";
|
|
1455
|
-
params:
|
|
1458
|
+
params: xstate229.NonReducibleUnknown;
|
|
1456
1459
|
};
|
|
1457
1460
|
"emit pending events": {
|
|
1458
1461
|
type: "emit pending events";
|
|
1459
|
-
params:
|
|
1462
|
+
params: xstate229.NonReducibleUnknown;
|
|
1460
1463
|
};
|
|
1461
1464
|
"emit ready": {
|
|
1462
1465
|
type: "emit ready";
|
|
1463
|
-
params:
|
|
1466
|
+
params: xstate229.NonReducibleUnknown;
|
|
1464
1467
|
};
|
|
1465
1468
|
"clear pending events": {
|
|
1466
1469
|
type: "clear pending events";
|
|
1467
|
-
params:
|
|
1470
|
+
params: xstate229.NonReducibleUnknown;
|
|
1468
1471
|
};
|
|
1469
1472
|
"defer incoming patches": {
|
|
1470
1473
|
type: "defer incoming patches";
|
|
1471
|
-
params:
|
|
1474
|
+
params: xstate229.NonReducibleUnknown;
|
|
1472
1475
|
};
|
|
1473
1476
|
"emit pending incoming patches": {
|
|
1474
1477
|
type: "emit pending incoming patches";
|
|
1475
|
-
params:
|
|
1478
|
+
params: xstate229.NonReducibleUnknown;
|
|
1476
1479
|
};
|
|
1477
1480
|
"clear pending incoming patches": {
|
|
1478
1481
|
type: "clear pending incoming patches";
|
|
1479
|
-
params:
|
|
1482
|
+
params: xstate229.NonReducibleUnknown;
|
|
1480
1483
|
};
|
|
1481
1484
|
"handle blur": {
|
|
1482
1485
|
type: "handle blur";
|
|
@@ -1492,12 +1495,18 @@ declare const editorMachine: xstate227.StateMachine<{
|
|
|
1492
1495
|
};
|
|
1493
1496
|
"sort behaviors": {
|
|
1494
1497
|
type: "sort behaviors";
|
|
1495
|
-
params:
|
|
1498
|
+
params: xstate229.NonReducibleUnknown;
|
|
1496
1499
|
};
|
|
1497
|
-
}>, {
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1500
|
+
}>, xstate229.Values<{
|
|
1501
|
+
"slate is busy": {
|
|
1502
|
+
type: "slate is busy";
|
|
1503
|
+
params: unknown;
|
|
1504
|
+
};
|
|
1505
|
+
"slate is normalizing node": {
|
|
1506
|
+
type: "slate is normalizing node";
|
|
1507
|
+
params: unknown;
|
|
1508
|
+
};
|
|
1509
|
+
}>, never, {
|
|
1501
1510
|
"edit mode": {
|
|
1502
1511
|
editable: "dragging internally" | "idle" | {
|
|
1503
1512
|
focusing: "checking if busy" | "busy";
|
|
@@ -1509,7 +1518,7 @@ declare const editorMachine: xstate227.StateMachine<{
|
|
|
1509
1518
|
"set up": {
|
|
1510
1519
|
"value sync": "syncing value" | "idle";
|
|
1511
1520
|
writing: "dirty" | {
|
|
1512
|
-
pristine: "
|
|
1521
|
+
pristine: "idle";
|
|
1513
1522
|
};
|
|
1514
1523
|
};
|
|
1515
1524
|
};
|
|
@@ -1521,7 +1530,7 @@ declare const editorMachine: xstate227.StateMachine<{
|
|
|
1521
1530
|
readOnly?: boolean;
|
|
1522
1531
|
schema: EditorSchema;
|
|
1523
1532
|
initialValue?: Array<PortableTextBlock>;
|
|
1524
|
-
},
|
|
1533
|
+
}, xstate229.NonReducibleUnknown, InternalPatchEvent | MutationEvent | PatchesEvent | {
|
|
1525
1534
|
type: "blurred";
|
|
1526
1535
|
event: react20.FocusEvent<HTMLDivElement, Element>;
|
|
1527
1536
|
} | {
|
|
@@ -1552,19 +1561,19 @@ declare const editorMachine: xstate227.StateMachine<{
|
|
|
1552
1561
|
} | {
|
|
1553
1562
|
type: "value changed";
|
|
1554
1563
|
value: Array<PortableTextBlock> | undefined;
|
|
1555
|
-
},
|
|
1564
|
+
}, xstate229.MetaObject, {
|
|
1556
1565
|
readonly id: "editor";
|
|
1557
1566
|
readonly context: ({
|
|
1558
1567
|
input
|
|
1559
1568
|
}: {
|
|
1560
1569
|
spawn: {
|
|
1561
|
-
<TSrc extends never>(logic: TSrc, ...[options]: never):
|
|
1562
|
-
<TLogic extends
|
|
1570
|
+
<TSrc extends never>(logic: TSrc, ...[options]: never): xstate229.ActorRefFromLogic<never>;
|
|
1571
|
+
<TLogic extends xstate229.AnyActorLogic>(src: TLogic, ...[options]: xstate229.ConditionalRequired<[options?: ({
|
|
1563
1572
|
id?: never;
|
|
1564
1573
|
systemId?: string;
|
|
1565
|
-
input?:
|
|
1574
|
+
input?: xstate229.InputFrom<TLogic> | undefined;
|
|
1566
1575
|
syncSnapshot?: boolean;
|
|
1567
|
-
} & { [K in
|
|
1576
|
+
} & { [K in xstate229.RequiredLogicInput<TLogic>]: unknown }) | undefined], xstate229.IsNotNever<xstate229.RequiredLogicInput<TLogic>>>): xstate229.ActorRefFromLogic<TLogic>;
|
|
1568
1577
|
};
|
|
1569
1578
|
input: {
|
|
1570
1579
|
converters?: Array<Converter>;
|
|
@@ -1575,7 +1584,7 @@ declare const editorMachine: xstate227.StateMachine<{
|
|
|
1575
1584
|
schema: EditorSchema;
|
|
1576
1585
|
initialValue?: Array<PortableTextBlock>;
|
|
1577
1586
|
};
|
|
1578
|
-
self:
|
|
1587
|
+
self: xstate229.ActorRef<xstate229.MachineSnapshot<{
|
|
1579
1588
|
behaviors: Set<BehaviorConfig>;
|
|
1580
1589
|
behaviorsSorted: boolean;
|
|
1581
1590
|
converters: Set<Converter>;
|
|
@@ -1611,13 +1620,9 @@ declare const editorMachine: xstate227.StateMachine<{
|
|
|
1611
1620
|
} | {
|
|
1612
1621
|
type: "focus";
|
|
1613
1622
|
editor: PortableTextSlateEditor;
|
|
1614
|
-
} | {
|
|
1615
|
-
type: "normalizing";
|
|
1616
1623
|
} | {
|
|
1617
1624
|
type: "update selection";
|
|
1618
1625
|
selection: EditorSelection;
|
|
1619
|
-
} | {
|
|
1620
|
-
type: "done normalizing";
|
|
1621
1626
|
} | {
|
|
1622
1627
|
type: "done syncing value";
|
|
1623
1628
|
} | {
|
|
@@ -1640,7 +1645,10 @@ declare const editorMachine: xstate227.StateMachine<{
|
|
|
1640
1645
|
type: "dragend";
|
|
1641
1646
|
} | {
|
|
1642
1647
|
type: "drop";
|
|
1643
|
-
}
|
|
1648
|
+
} | {
|
|
1649
|
+
type: "add slate editor";
|
|
1650
|
+
editor: PortableTextSlateEditor;
|
|
1651
|
+
}, Record<string, xstate229.AnyActorRef | undefined>, xstate229.StateValue, string, unknown, any, any>, InternalPatchEvent | MutationEvent | PatchesEvent | {
|
|
1644
1652
|
type: "update readOnly";
|
|
1645
1653
|
readOnly: boolean;
|
|
1646
1654
|
} | {
|
|
@@ -1658,13 +1666,9 @@ declare const editorMachine: xstate227.StateMachine<{
|
|
|
1658
1666
|
} | {
|
|
1659
1667
|
type: "focus";
|
|
1660
1668
|
editor: PortableTextSlateEditor;
|
|
1661
|
-
} | {
|
|
1662
|
-
type: "normalizing";
|
|
1663
1669
|
} | {
|
|
1664
1670
|
type: "update selection";
|
|
1665
1671
|
selection: EditorSelection;
|
|
1666
|
-
} | {
|
|
1667
|
-
type: "done normalizing";
|
|
1668
1672
|
} | {
|
|
1669
1673
|
type: "done syncing value";
|
|
1670
1674
|
} | {
|
|
@@ -1687,7 +1691,10 @@ declare const editorMachine: xstate227.StateMachine<{
|
|
|
1687
1691
|
type: "dragend";
|
|
1688
1692
|
} | {
|
|
1689
1693
|
type: "drop";
|
|
1690
|
-
}
|
|
1694
|
+
} | {
|
|
1695
|
+
type: "add slate editor";
|
|
1696
|
+
editor: PortableTextSlateEditor;
|
|
1697
|
+
}, xstate229.AnyEventObject>;
|
|
1691
1698
|
}) => {
|
|
1692
1699
|
behaviors: Set<{
|
|
1693
1700
|
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.child" | "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.block" | "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.*" | "style.*" | "clipboard.*" | "drag.*" | "keyboard.*" | "mouse.*", true, {
|
|
@@ -1975,7 +1982,7 @@ declare const editorMachine: xstate227.StateMachine<{
|
|
|
1975
1982
|
keyGenerator: () => string;
|
|
1976
1983
|
pendingEvents: never[];
|
|
1977
1984
|
pendingIncomingPatchesEvents: never[];
|
|
1978
|
-
schema:
|
|
1985
|
+
schema: _portabletext_schema5.Schema;
|
|
1979
1986
|
selection: null;
|
|
1980
1987
|
initialReadOnly: boolean;
|
|
1981
1988
|
maxBlocks: number | undefined;
|
|
@@ -1989,7 +1996,7 @@ declare const editorMachine: xstate227.StateMachine<{
|
|
|
1989
1996
|
readonly actions: "remove behavior from context";
|
|
1990
1997
|
};
|
|
1991
1998
|
readonly 'update maxBlocks': {
|
|
1992
|
-
readonly actions:
|
|
1999
|
+
readonly actions: xstate229.ActionFunction<{
|
|
1993
2000
|
behaviors: Set<BehaviorConfig>;
|
|
1994
2001
|
behaviorsSorted: boolean;
|
|
1995
2002
|
converters: Set<Converter>;
|
|
@@ -2028,13 +2035,9 @@ declare const editorMachine: xstate227.StateMachine<{
|
|
|
2028
2035
|
} | {
|
|
2029
2036
|
type: "focus";
|
|
2030
2037
|
editor: PortableTextSlateEditor;
|
|
2031
|
-
} | {
|
|
2032
|
-
type: "normalizing";
|
|
2033
2038
|
} | {
|
|
2034
2039
|
type: "update selection";
|
|
2035
2040
|
selection: EditorSelection;
|
|
2036
|
-
} | {
|
|
2037
|
-
type: "done normalizing";
|
|
2038
2041
|
} | {
|
|
2039
2042
|
type: "done syncing value";
|
|
2040
2043
|
} | {
|
|
@@ -2057,10 +2060,16 @@ declare const editorMachine: xstate227.StateMachine<{
|
|
|
2057
2060
|
type: "dragend";
|
|
2058
2061
|
} | {
|
|
2059
2062
|
type: "drop";
|
|
2063
|
+
} | {
|
|
2064
|
+
type: "add slate editor";
|
|
2065
|
+
editor: PortableTextSlateEditor;
|
|
2060
2066
|
}, undefined, never, never, never, never, never>;
|
|
2061
2067
|
};
|
|
2068
|
+
readonly 'add slate editor': {
|
|
2069
|
+
readonly actions: "add slate editor to context";
|
|
2070
|
+
};
|
|
2062
2071
|
readonly 'update selection': {
|
|
2063
|
-
readonly actions: readonly [
|
|
2072
|
+
readonly actions: readonly [xstate229.ActionFunction<{
|
|
2064
2073
|
behaviors: Set<BehaviorConfig>;
|
|
2065
2074
|
behaviorsSorted: boolean;
|
|
2066
2075
|
converters: Set<Converter>;
|
|
@@ -2099,13 +2108,9 @@ declare const editorMachine: xstate227.StateMachine<{
|
|
|
2099
2108
|
} | {
|
|
2100
2109
|
type: "focus";
|
|
2101
2110
|
editor: PortableTextSlateEditor;
|
|
2102
|
-
} | {
|
|
2103
|
-
type: "normalizing";
|
|
2104
2111
|
} | {
|
|
2105
2112
|
type: "update selection";
|
|
2106
2113
|
selection: EditorSelection;
|
|
2107
|
-
} | {
|
|
2108
|
-
type: "done normalizing";
|
|
2109
2114
|
} | {
|
|
2110
2115
|
type: "done syncing value";
|
|
2111
2116
|
} | {
|
|
@@ -2128,7 +2133,10 @@ declare const editorMachine: xstate227.StateMachine<{
|
|
|
2128
2133
|
type: "dragend";
|
|
2129
2134
|
} | {
|
|
2130
2135
|
type: "drop";
|
|
2131
|
-
}
|
|
2136
|
+
} | {
|
|
2137
|
+
type: "add slate editor";
|
|
2138
|
+
editor: PortableTextSlateEditor;
|
|
2139
|
+
}, undefined, never, never, never, never, never>, xstate229.ActionFunction<{
|
|
2132
2140
|
behaviors: Set<BehaviorConfig>;
|
|
2133
2141
|
behaviorsSorted: boolean;
|
|
2134
2142
|
converters: Set<Converter>;
|
|
@@ -2167,13 +2175,9 @@ declare const editorMachine: xstate227.StateMachine<{
|
|
|
2167
2175
|
} | {
|
|
2168
2176
|
type: "focus";
|
|
2169
2177
|
editor: PortableTextSlateEditor;
|
|
2170
|
-
} | {
|
|
2171
|
-
type: "normalizing";
|
|
2172
2178
|
} | {
|
|
2173
2179
|
type: "update selection";
|
|
2174
2180
|
selection: EditorSelection;
|
|
2175
|
-
} | {
|
|
2176
|
-
type: "done normalizing";
|
|
2177
2181
|
} | {
|
|
2178
2182
|
type: "done syncing value";
|
|
2179
2183
|
} | {
|
|
@@ -2196,6 +2200,9 @@ declare const editorMachine: xstate227.StateMachine<{
|
|
|
2196
2200
|
type: "dragend";
|
|
2197
2201
|
} | {
|
|
2198
2202
|
type: "drop";
|
|
2203
|
+
} | {
|
|
2204
|
+
type: "add slate editor";
|
|
2205
|
+
editor: PortableTextSlateEditor;
|
|
2199
2206
|
}, undefined, never, never, never, never, InternalPatchEvent | MutationEvent | PatchesEvent | {
|
|
2200
2207
|
type: "blurred";
|
|
2201
2208
|
event: react20.FocusEvent<HTMLDivElement, Element>;
|
|
@@ -2230,7 +2237,7 @@ declare const editorMachine: xstate227.StateMachine<{
|
|
|
2230
2237
|
}>];
|
|
2231
2238
|
};
|
|
2232
2239
|
readonly 'set drag ghost': {
|
|
2233
|
-
readonly actions:
|
|
2240
|
+
readonly actions: xstate229.ActionFunction<{
|
|
2234
2241
|
behaviors: Set<BehaviorConfig>;
|
|
2235
2242
|
behaviorsSorted: boolean;
|
|
2236
2243
|
converters: Set<Converter>;
|
|
@@ -2269,13 +2276,9 @@ declare const editorMachine: xstate227.StateMachine<{
|
|
|
2269
2276
|
} | {
|
|
2270
2277
|
type: "focus";
|
|
2271
2278
|
editor: PortableTextSlateEditor;
|
|
2272
|
-
} | {
|
|
2273
|
-
type: "normalizing";
|
|
2274
2279
|
} | {
|
|
2275
2280
|
type: "update selection";
|
|
2276
2281
|
selection: EditorSelection;
|
|
2277
|
-
} | {
|
|
2278
|
-
type: "done normalizing";
|
|
2279
2282
|
} | {
|
|
2280
2283
|
type: "done syncing value";
|
|
2281
2284
|
} | {
|
|
@@ -2298,6 +2301,9 @@ declare const editorMachine: xstate227.StateMachine<{
|
|
|
2298
2301
|
type: "dragend";
|
|
2299
2302
|
} | {
|
|
2300
2303
|
type: "drop";
|
|
2304
|
+
} | {
|
|
2305
|
+
type: "add slate editor";
|
|
2306
|
+
editor: PortableTextSlateEditor;
|
|
2301
2307
|
}, undefined, never, never, never, never, never>;
|
|
2302
2308
|
};
|
|
2303
2309
|
};
|
|
@@ -2450,7 +2456,7 @@ declare const editorMachine: xstate227.StateMachine<{
|
|
|
2450
2456
|
};
|
|
2451
2457
|
readonly focus: {
|
|
2452
2458
|
readonly target: ".focusing";
|
|
2453
|
-
readonly actions: readonly [
|
|
2459
|
+
readonly actions: readonly [xstate229.ActionFunction<{
|
|
2454
2460
|
behaviors: Set<BehaviorConfig>;
|
|
2455
2461
|
behaviorsSorted: boolean;
|
|
2456
2462
|
converters: Set<Converter>;
|
|
@@ -2489,13 +2495,9 @@ declare const editorMachine: xstate227.StateMachine<{
|
|
|
2489
2495
|
} | {
|
|
2490
2496
|
type: "focus";
|
|
2491
2497
|
editor: PortableTextSlateEditor;
|
|
2492
|
-
} | {
|
|
2493
|
-
type: "normalizing";
|
|
2494
2498
|
} | {
|
|
2495
2499
|
type: "update selection";
|
|
2496
2500
|
selection: EditorSelection;
|
|
2497
|
-
} | {
|
|
2498
|
-
type: "done normalizing";
|
|
2499
2501
|
} | {
|
|
2500
2502
|
type: "done syncing value";
|
|
2501
2503
|
} | {
|
|
@@ -2518,6 +2520,9 @@ declare const editorMachine: xstate227.StateMachine<{
|
|
|
2518
2520
|
type: "dragend";
|
|
2519
2521
|
} | {
|
|
2520
2522
|
type: "drop";
|
|
2523
|
+
} | {
|
|
2524
|
+
type: "add slate editor";
|
|
2525
|
+
editor: PortableTextSlateEditor;
|
|
2521
2526
|
}, undefined, never, never, never, never, never>];
|
|
2522
2527
|
};
|
|
2523
2528
|
};
|
|
@@ -2528,7 +2533,7 @@ declare const editorMachine: xstate227.StateMachine<{
|
|
|
2528
2533
|
readonly exit: readonly [() => void];
|
|
2529
2534
|
readonly on: {
|
|
2530
2535
|
readonly dragstart: {
|
|
2531
|
-
readonly actions: readonly [
|
|
2536
|
+
readonly actions: readonly [xstate229.ActionFunction<{
|
|
2532
2537
|
behaviors: Set<BehaviorConfig>;
|
|
2533
2538
|
behaviorsSorted: boolean;
|
|
2534
2539
|
converters: Set<Converter>;
|
|
@@ -2568,13 +2573,9 @@ declare const editorMachine: xstate227.StateMachine<{
|
|
|
2568
2573
|
} | {
|
|
2569
2574
|
type: "focus";
|
|
2570
2575
|
editor: PortableTextSlateEditor;
|
|
2571
|
-
} | {
|
|
2572
|
-
type: "normalizing";
|
|
2573
2576
|
} | {
|
|
2574
2577
|
type: "update selection";
|
|
2575
2578
|
selection: EditorSelection;
|
|
2576
|
-
} | {
|
|
2577
|
-
type: "done normalizing";
|
|
2578
2579
|
} | {
|
|
2579
2580
|
type: "done syncing value";
|
|
2580
2581
|
} | {
|
|
@@ -2597,6 +2598,9 @@ declare const editorMachine: xstate227.StateMachine<{
|
|
|
2597
2598
|
type: "dragend";
|
|
2598
2599
|
} | {
|
|
2599
2600
|
type: "drop";
|
|
2601
|
+
} | {
|
|
2602
|
+
type: "add slate editor";
|
|
2603
|
+
editor: PortableTextSlateEditor;
|
|
2600
2604
|
}, undefined, never, never, never, never, never>];
|
|
2601
2605
|
readonly target: "dragging internally";
|
|
2602
2606
|
};
|
|
@@ -2631,7 +2635,7 @@ declare const editorMachine: xstate227.StateMachine<{
|
|
|
2631
2635
|
readonly entry: readonly [() => void];
|
|
2632
2636
|
readonly exit: readonly [() => void, ({
|
|
2633
2637
|
context
|
|
2634
|
-
}:
|
|
2638
|
+
}: xstate229.ActionArgs<{
|
|
2635
2639
|
behaviors: Set<BehaviorConfig>;
|
|
2636
2640
|
behaviorsSorted: boolean;
|
|
2637
2641
|
converters: Set<Converter>;
|
|
@@ -2667,13 +2671,9 @@ declare const editorMachine: xstate227.StateMachine<{
|
|
|
2667
2671
|
} | {
|
|
2668
2672
|
type: "focus";
|
|
2669
2673
|
editor: PortableTextSlateEditor;
|
|
2670
|
-
} | {
|
|
2671
|
-
type: "normalizing";
|
|
2672
2674
|
} | {
|
|
2673
2675
|
type: "update selection";
|
|
2674
2676
|
selection: EditorSelection;
|
|
2675
|
-
} | {
|
|
2676
|
-
type: "done normalizing";
|
|
2677
2677
|
} | {
|
|
2678
2678
|
type: "done syncing value";
|
|
2679
2679
|
} | {
|
|
@@ -2696,6 +2696,9 @@ declare const editorMachine: xstate227.StateMachine<{
|
|
|
2696
2696
|
type: "dragend";
|
|
2697
2697
|
} | {
|
|
2698
2698
|
type: "drop";
|
|
2699
|
+
} | {
|
|
2700
|
+
type: "add slate editor";
|
|
2701
|
+
editor: PortableTextSlateEditor;
|
|
2699
2702
|
}, InternalPatchEvent | MutationEvent | PatchesEvent | {
|
|
2700
2703
|
type: "update readOnly";
|
|
2701
2704
|
readOnly: boolean;
|
|
@@ -2714,13 +2717,9 @@ declare const editorMachine: xstate227.StateMachine<{
|
|
|
2714
2717
|
} | {
|
|
2715
2718
|
type: "focus";
|
|
2716
2719
|
editor: PortableTextSlateEditor;
|
|
2717
|
-
} | {
|
|
2718
|
-
type: "normalizing";
|
|
2719
2720
|
} | {
|
|
2720
2721
|
type: "update selection";
|
|
2721
2722
|
selection: EditorSelection;
|
|
2722
|
-
} | {
|
|
2723
|
-
type: "done normalizing";
|
|
2724
2723
|
} | {
|
|
2725
2724
|
type: "done syncing value";
|
|
2726
2725
|
} | {
|
|
@@ -2743,7 +2742,10 @@ declare const editorMachine: xstate227.StateMachine<{
|
|
|
2743
2742
|
type: "dragend";
|
|
2744
2743
|
} | {
|
|
2745
2744
|
type: "drop";
|
|
2746
|
-
}
|
|
2745
|
+
} | {
|
|
2746
|
+
type: "add slate editor";
|
|
2747
|
+
editor: PortableTextSlateEditor;
|
|
2748
|
+
}>) => void, xstate229.ActionFunction<{
|
|
2747
2749
|
behaviors: Set<BehaviorConfig>;
|
|
2748
2750
|
behaviorsSorted: boolean;
|
|
2749
2751
|
converters: Set<Converter>;
|
|
@@ -2779,13 +2781,9 @@ declare const editorMachine: xstate227.StateMachine<{
|
|
|
2779
2781
|
} | {
|
|
2780
2782
|
type: "focus";
|
|
2781
2783
|
editor: PortableTextSlateEditor;
|
|
2782
|
-
} | {
|
|
2783
|
-
type: "normalizing";
|
|
2784
2784
|
} | {
|
|
2785
2785
|
type: "update selection";
|
|
2786
2786
|
selection: EditorSelection;
|
|
2787
|
-
} | {
|
|
2788
|
-
type: "done normalizing";
|
|
2789
2787
|
} | {
|
|
2790
2788
|
type: "done syncing value";
|
|
2791
2789
|
} | {
|
|
@@ -2808,6 +2806,9 @@ declare const editorMachine: xstate227.StateMachine<{
|
|
|
2808
2806
|
type: "dragend";
|
|
2809
2807
|
} | {
|
|
2810
2808
|
type: "drop";
|
|
2809
|
+
} | {
|
|
2810
|
+
type: "add slate editor";
|
|
2811
|
+
editor: PortableTextSlateEditor;
|
|
2811
2812
|
}, InternalPatchEvent | MutationEvent | PatchesEvent | {
|
|
2812
2813
|
type: "update readOnly";
|
|
2813
2814
|
readOnly: boolean;
|
|
@@ -2826,13 +2827,9 @@ declare const editorMachine: xstate227.StateMachine<{
|
|
|
2826
2827
|
} | {
|
|
2827
2828
|
type: "focus";
|
|
2828
2829
|
editor: PortableTextSlateEditor;
|
|
2829
|
-
} | {
|
|
2830
|
-
type: "normalizing";
|
|
2831
2830
|
} | {
|
|
2832
2831
|
type: "update selection";
|
|
2833
2832
|
selection: EditorSelection;
|
|
2834
|
-
} | {
|
|
2835
|
-
type: "done normalizing";
|
|
2836
2833
|
} | {
|
|
2837
2834
|
type: "done syncing value";
|
|
2838
2835
|
} | {
|
|
@@ -2855,7 +2852,10 @@ declare const editorMachine: xstate227.StateMachine<{
|
|
|
2855
2852
|
type: "dragend";
|
|
2856
2853
|
} | {
|
|
2857
2854
|
type: "drop";
|
|
2858
|
-
}
|
|
2855
|
+
} | {
|
|
2856
|
+
type: "add slate editor";
|
|
2857
|
+
editor: PortableTextSlateEditor;
|
|
2858
|
+
}, undefined, never, never, never, never, never>, xstate229.ActionFunction<{
|
|
2859
2859
|
behaviors: Set<BehaviorConfig>;
|
|
2860
2860
|
behaviorsSorted: boolean;
|
|
2861
2861
|
converters: Set<Converter>;
|
|
@@ -2891,13 +2891,9 @@ declare const editorMachine: xstate227.StateMachine<{
|
|
|
2891
2891
|
} | {
|
|
2892
2892
|
type: "focus";
|
|
2893
2893
|
editor: PortableTextSlateEditor;
|
|
2894
|
-
} | {
|
|
2895
|
-
type: "normalizing";
|
|
2896
2894
|
} | {
|
|
2897
2895
|
type: "update selection";
|
|
2898
2896
|
selection: EditorSelection;
|
|
2899
|
-
} | {
|
|
2900
|
-
type: "done normalizing";
|
|
2901
2897
|
} | {
|
|
2902
2898
|
type: "done syncing value";
|
|
2903
2899
|
} | {
|
|
@@ -2920,6 +2916,9 @@ declare const editorMachine: xstate227.StateMachine<{
|
|
|
2920
2916
|
type: "dragend";
|
|
2921
2917
|
} | {
|
|
2922
2918
|
type: "drop";
|
|
2919
|
+
} | {
|
|
2920
|
+
type: "add slate editor";
|
|
2921
|
+
editor: PortableTextSlateEditor;
|
|
2923
2922
|
}, InternalPatchEvent | MutationEvent | PatchesEvent | {
|
|
2924
2923
|
type: "update readOnly";
|
|
2925
2924
|
readOnly: boolean;
|
|
@@ -2938,13 +2937,9 @@ declare const editorMachine: xstate227.StateMachine<{
|
|
|
2938
2937
|
} | {
|
|
2939
2938
|
type: "focus";
|
|
2940
2939
|
editor: PortableTextSlateEditor;
|
|
2941
|
-
} | {
|
|
2942
|
-
type: "normalizing";
|
|
2943
2940
|
} | {
|
|
2944
2941
|
type: "update selection";
|
|
2945
2942
|
selection: EditorSelection;
|
|
2946
|
-
} | {
|
|
2947
|
-
type: "done normalizing";
|
|
2948
2943
|
} | {
|
|
2949
2944
|
type: "done syncing value";
|
|
2950
2945
|
} | {
|
|
@@ -2967,6 +2962,9 @@ declare const editorMachine: xstate227.StateMachine<{
|
|
|
2967
2962
|
type: "dragend";
|
|
2968
2963
|
} | {
|
|
2969
2964
|
type: "drop";
|
|
2965
|
+
} | {
|
|
2966
|
+
type: "add slate editor";
|
|
2967
|
+
editor: PortableTextSlateEditor;
|
|
2970
2968
|
}, undefined, never, never, never, never, never>];
|
|
2971
2969
|
readonly tags: readonly ["dragging internally"];
|
|
2972
2970
|
readonly on: {
|
|
@@ -3014,7 +3012,7 @@ declare const editorMachine: xstate227.StateMachine<{
|
|
|
3014
3012
|
readonly exit: readonly [() => void];
|
|
3015
3013
|
readonly on: {
|
|
3016
3014
|
readonly patches: {
|
|
3017
|
-
readonly actions: readonly [
|
|
3015
|
+
readonly actions: readonly [xstate229.ActionFunction<{
|
|
3018
3016
|
behaviors: Set<BehaviorConfig>;
|
|
3019
3017
|
behaviorsSorted: boolean;
|
|
3020
3018
|
converters: Set<Converter>;
|
|
@@ -3050,13 +3048,9 @@ declare const editorMachine: xstate227.StateMachine<{
|
|
|
3050
3048
|
} | {
|
|
3051
3049
|
type: "focus";
|
|
3052
3050
|
editor: PortableTextSlateEditor;
|
|
3053
|
-
} | {
|
|
3054
|
-
type: "normalizing";
|
|
3055
3051
|
} | {
|
|
3056
3052
|
type: "update selection";
|
|
3057
3053
|
selection: EditorSelection;
|
|
3058
|
-
} | {
|
|
3059
|
-
type: "done normalizing";
|
|
3060
3054
|
} | {
|
|
3061
3055
|
type: "done syncing value";
|
|
3062
3056
|
} | {
|
|
@@ -3079,6 +3073,9 @@ declare const editorMachine: xstate227.StateMachine<{
|
|
|
3079
3073
|
type: "dragend";
|
|
3080
3074
|
} | {
|
|
3081
3075
|
type: "drop";
|
|
3076
|
+
} | {
|
|
3077
|
+
type: "add slate editor";
|
|
3078
|
+
editor: PortableTextSlateEditor;
|
|
3082
3079
|
}, undefined, never, never, never, never, InternalPatchEvent | MutationEvent | PatchesEvent | {
|
|
3083
3080
|
type: "blurred";
|
|
3084
3081
|
event: react20.FocusEvent<HTMLDivElement, Element>;
|
|
@@ -3141,32 +3138,20 @@ declare const editorMachine: xstate227.StateMachine<{
|
|
|
3141
3138
|
readonly entry: readonly [() => void];
|
|
3142
3139
|
readonly exit: readonly [() => void];
|
|
3143
3140
|
readonly on: {
|
|
3144
|
-
readonly
|
|
3145
|
-
readonly
|
|
3146
|
-
};
|
|
3147
|
-
readonly 'internal.patch': {
|
|
3141
|
+
readonly 'internal.patch': readonly [{
|
|
3142
|
+
readonly guard: "slate is normalizing node";
|
|
3148
3143
|
readonly actions: "defer event";
|
|
3149
|
-
|
|
3150
|
-
};
|
|
3151
|
-
readonly mutation: {
|
|
3144
|
+
}, {
|
|
3152
3145
|
readonly actions: "defer event";
|
|
3153
3146
|
readonly target: "#editor.setup.set up.writing.dirty";
|
|
3154
|
-
};
|
|
3155
|
-
|
|
3156
|
-
|
|
3157
|
-
readonly normalizing: {
|
|
3158
|
-
readonly entry: readonly [() => void];
|
|
3159
|
-
readonly exit: readonly [() => void];
|
|
3160
|
-
readonly on: {
|
|
3161
|
-
readonly 'done normalizing': {
|
|
3162
|
-
readonly target: "idle";
|
|
3163
|
-
};
|
|
3164
|
-
readonly 'internal.patch': {
|
|
3147
|
+
}];
|
|
3148
|
+
readonly mutation: readonly [{
|
|
3149
|
+
readonly guard: "slate is normalizing node";
|
|
3165
3150
|
readonly actions: "defer event";
|
|
3166
|
-
}
|
|
3167
|
-
readonly mutation: {
|
|
3151
|
+
}, {
|
|
3168
3152
|
readonly actions: "defer event";
|
|
3169
|
-
|
|
3153
|
+
readonly target: "#editor.setup.set up.writing.dirty";
|
|
3154
|
+
}];
|
|
3170
3155
|
};
|
|
3171
3156
|
};
|
|
3172
3157
|
};
|