@portabletext/editor 4.2.1 → 4.2.3
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.ts +25 -24
- package/lib/index.js +788 -331
- package/lib/index.js.map +1 -1
- package/package.json +8 -8
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as _portabletext_schema6 from "@portabletext/schema";
|
|
2
2
|
import { AnnotationDefinition, AnnotationSchemaType, BaseDefinition, BlockObjectDefinition, BlockObjectSchemaType, DecoratorDefinition, DecoratorSchemaType, FieldDefinition, InlineObjectDefinition, InlineObjectSchemaType, ListDefinition, ListSchemaType, 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, Schema, SchemaDefinition, SchemaDefinition as SchemaDefinition$1, StyleDefinition, StyleSchemaType, TypedObject, defineSchema } from "@portabletext/schema";
|
|
3
3
|
import { BaseRange, Descendant, Operation, Range } from "slate";
|
|
4
|
-
import * as
|
|
4
|
+
import * as xstate75 from "xstate";
|
|
5
5
|
import { ActorRef, ActorRefFrom, EventObject, Snapshot } from "xstate";
|
|
6
|
-
import * as
|
|
6
|
+
import * as react8 from "react";
|
|
7
7
|
import React$1, { BaseSyntheticEvent, ClipboardEvent, Component, FocusEvent, JSX, MutableRefObject, PropsWithChildren, ReactElement, RefObject, TextareaHTMLAttributes } from "react";
|
|
8
8
|
import { Patch, Patch as Patch$1 } from "@portabletext/patches";
|
|
9
9
|
import { Observable, Subject } from "rxjs";
|
|
@@ -306,7 +306,7 @@ declare class PortableTextEditor extends Component<PortableTextEditorProps<Inter
|
|
|
306
306
|
componentDidUpdate(prevProps: PortableTextEditorProps): void;
|
|
307
307
|
componentWillUnmount(): void;
|
|
308
308
|
setEditable: (editable: EditableAPI) => void;
|
|
309
|
-
render():
|
|
309
|
+
render(): react8.JSX.Element;
|
|
310
310
|
/**
|
|
311
311
|
* @deprecated
|
|
312
312
|
* Use built-in selectors or write your own: https://www.portabletext.org/reference/selectors/
|
|
@@ -715,7 +715,7 @@ type PortableTextEditableProps = Omit<TextareaHTMLAttributes<HTMLDivElement>, 'o
|
|
|
715
715
|
* ```
|
|
716
716
|
* @group Components
|
|
717
717
|
*/
|
|
718
|
-
declare const PortableTextEditable:
|
|
718
|
+
declare const PortableTextEditable: react8.ForwardRefExoticComponent<Omit<PortableTextEditableProps, "ref"> & react8.RefAttributes<Omit<HTMLDivElement, "as" | "onPaste" | "onBeforeInput">>>;
|
|
719
719
|
/** @beta */
|
|
720
720
|
interface EditableAPIDeleteOptions {
|
|
721
721
|
mode?: 'blocks' | 'children' | 'selected';
|
|
@@ -1375,7 +1375,7 @@ type EditorActor = ActorRefFrom<typeof editorMachine>;
|
|
|
1375
1375
|
/**
|
|
1376
1376
|
* @internal
|
|
1377
1377
|
*/
|
|
1378
|
-
declare const editorMachine:
|
|
1378
|
+
declare const editorMachine: xstate75.StateMachine<{
|
|
1379
1379
|
behaviors: Set<BehaviorConfig>;
|
|
1380
1380
|
behaviorIndex: BehaviorIndex;
|
|
1381
1381
|
abstractBehaviorIndex: BehaviorIndex;
|
|
@@ -1439,46 +1439,46 @@ declare const editorMachine: xstate71.StateMachine<{
|
|
|
1439
1439
|
editor: PortableTextSlateEditor;
|
|
1440
1440
|
}, {}, never, {
|
|
1441
1441
|
type: "add behavior to context";
|
|
1442
|
-
params:
|
|
1442
|
+
params: xstate75.NonReducibleUnknown;
|
|
1443
1443
|
} | {
|
|
1444
1444
|
type: "remove behavior from context";
|
|
1445
|
-
params:
|
|
1445
|
+
params: xstate75.NonReducibleUnknown;
|
|
1446
1446
|
} | {
|
|
1447
1447
|
type: "add slate editor to context";
|
|
1448
|
-
params:
|
|
1448
|
+
params: xstate75.NonReducibleUnknown;
|
|
1449
1449
|
} | {
|
|
1450
1450
|
type: "emit patch event";
|
|
1451
|
-
params:
|
|
1451
|
+
params: xstate75.NonReducibleUnknown;
|
|
1452
1452
|
} | {
|
|
1453
1453
|
type: "emit mutation event";
|
|
1454
|
-
params:
|
|
1454
|
+
params: xstate75.NonReducibleUnknown;
|
|
1455
1455
|
} | {
|
|
1456
1456
|
type: "emit read only";
|
|
1457
|
-
params:
|
|
1457
|
+
params: xstate75.NonReducibleUnknown;
|
|
1458
1458
|
} | {
|
|
1459
1459
|
type: "emit editable";
|
|
1460
|
-
params:
|
|
1460
|
+
params: xstate75.NonReducibleUnknown;
|
|
1461
1461
|
} | {
|
|
1462
1462
|
type: "defer event";
|
|
1463
|
-
params:
|
|
1463
|
+
params: xstate75.NonReducibleUnknown;
|
|
1464
1464
|
} | {
|
|
1465
1465
|
type: "emit pending events";
|
|
1466
|
-
params:
|
|
1466
|
+
params: xstate75.NonReducibleUnknown;
|
|
1467
1467
|
} | {
|
|
1468
1468
|
type: "emit ready";
|
|
1469
|
-
params:
|
|
1469
|
+
params: xstate75.NonReducibleUnknown;
|
|
1470
1470
|
} | {
|
|
1471
1471
|
type: "clear pending events";
|
|
1472
|
-
params:
|
|
1472
|
+
params: xstate75.NonReducibleUnknown;
|
|
1473
1473
|
} | {
|
|
1474
1474
|
type: "defer incoming patches";
|
|
1475
|
-
params:
|
|
1475
|
+
params: xstate75.NonReducibleUnknown;
|
|
1476
1476
|
} | {
|
|
1477
1477
|
type: "emit pending incoming patches";
|
|
1478
|
-
params:
|
|
1478
|
+
params: xstate75.NonReducibleUnknown;
|
|
1479
1479
|
} | {
|
|
1480
1480
|
type: "clear pending incoming patches";
|
|
1481
|
-
params:
|
|
1481
|
+
params: xstate75.NonReducibleUnknown;
|
|
1482
1482
|
} | {
|
|
1483
1483
|
type: "handle blur";
|
|
1484
1484
|
params: unknown;
|
|
@@ -1490,7 +1490,7 @@ declare const editorMachine: xstate71.StateMachine<{
|
|
|
1490
1490
|
params: unknown;
|
|
1491
1491
|
} | {
|
|
1492
1492
|
type: "index behaviors";
|
|
1493
|
-
params:
|
|
1493
|
+
params: xstate75.NonReducibleUnknown;
|
|
1494
1494
|
}, {
|
|
1495
1495
|
type: "slate is busy";
|
|
1496
1496
|
params: unknown;
|
|
@@ -1520,9 +1520,9 @@ declare const editorMachine: xstate71.StateMachine<{
|
|
|
1520
1520
|
readOnly?: boolean;
|
|
1521
1521
|
schema: EditorSchema;
|
|
1522
1522
|
initialValue?: Array<PortableTextBlock>;
|
|
1523
|
-
},
|
|
1523
|
+
}, xstate75.NonReducibleUnknown, InternalPatchEvent | MutationEvent | PatchesEvent | {
|
|
1524
1524
|
type: "blurred";
|
|
1525
|
-
event:
|
|
1525
|
+
event: react8.FocusEvent<HTMLDivElement, Element>;
|
|
1526
1526
|
} | {
|
|
1527
1527
|
type: "done loading";
|
|
1528
1528
|
} | {
|
|
@@ -1534,7 +1534,7 @@ declare const editorMachine: xstate71.StateMachine<{
|
|
|
1534
1534
|
data: unknown;
|
|
1535
1535
|
} | {
|
|
1536
1536
|
type: "focused";
|
|
1537
|
-
event:
|
|
1537
|
+
event: react8.FocusEvent<HTMLDivElement, Element>;
|
|
1538
1538
|
} | {
|
|
1539
1539
|
type: "invalid value";
|
|
1540
1540
|
resolution: InvalidValueResolution | null;
|
|
@@ -1551,7 +1551,7 @@ declare const editorMachine: xstate71.StateMachine<{
|
|
|
1551
1551
|
} | {
|
|
1552
1552
|
type: "value changed";
|
|
1553
1553
|
value: Array<PortableTextBlock> | undefined;
|
|
1554
|
-
},
|
|
1554
|
+
}, xstate75.MetaObject, {
|
|
1555
1555
|
id: "editor";
|
|
1556
1556
|
states: {
|
|
1557
1557
|
readonly 'edit mode': {
|
|
@@ -1695,6 +1695,7 @@ type SyntheticBehaviorEvent = {
|
|
|
1695
1695
|
} | {
|
|
1696
1696
|
type: StrictExtract<SyntheticBehaviorEventType, 'decorator.remove'>;
|
|
1697
1697
|
decorator: string;
|
|
1698
|
+
at?: NonNullable<EditorSelection>;
|
|
1698
1699
|
} | {
|
|
1699
1700
|
type: StrictExtract<SyntheticBehaviorEventType, 'delete'>;
|
|
1700
1701
|
at?: NonNullable<EditorSelection>;
|