@portabletext/editor 4.2.3 → 4.2.4

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.
@@ -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 xstate75 from "xstate";
4
+ import * as xstate71 from "xstate";
5
5
  import { ActorRef, ActorRefFrom, EventObject, Snapshot } from "xstate";
6
- import * as react8 from "react";
6
+ import * as react10 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(): react8.JSX.Element;
309
+ render(): react10.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: react8.ForwardRefExoticComponent<Omit<PortableTextEditableProps, "ref"> & react8.RefAttributes<Omit<HTMLDivElement, "as" | "onPaste" | "onBeforeInput">>>;
718
+ declare const PortableTextEditable: react10.ForwardRefExoticComponent<Omit<PortableTextEditableProps, "ref"> & react10.RefAttributes<Omit<HTMLDivElement, "as" | "onPaste" | "onBeforeInput">>>;
719
719
  /** @beta */
720
720
  interface EditableAPIDeleteOptions {
721
721
  mode?: 'blocks' | 'children' | 'selected';
@@ -1335,20 +1335,6 @@ type BehaviorConfig = {
1335
1335
  behavior: Behavior;
1336
1336
  priority: EditorPriority;
1337
1337
  };
1338
- type BehaviorIndex = {
1339
- global: Array<SortedBehavior>;
1340
- namespaced: Map<string, Array<SortedBehavior>>;
1341
- exact: Map<string, Array<SortedBehavior>>;
1342
- };
1343
- type SortedBehavior = {
1344
- behavior: Behavior;
1345
- sortOrder: number;
1346
- };
1347
- /**
1348
- * Given an array of Behaviors, build a `BehaviorIndex` where the `sortOrder`
1349
- * of each Behavior is preserved.
1350
- */
1351
-
1352
1338
  /**
1353
1339
  * @public
1354
1340
  */
@@ -1375,11 +1361,9 @@ type EditorActor = ActorRefFrom<typeof editorMachine>;
1375
1361
  /**
1376
1362
  * @internal
1377
1363
  */
1378
- declare const editorMachine: xstate75.StateMachine<{
1364
+ declare const editorMachine: xstate71.StateMachine<{
1379
1365
  behaviors: Set<BehaviorConfig>;
1380
- behaviorIndex: BehaviorIndex;
1381
- abstractBehaviorIndex: BehaviorIndex;
1382
- behaviorsIndexed: boolean;
1366
+ behaviorsSorted: boolean;
1383
1367
  converters: Set<Converter>;
1384
1368
  getLegacySchema: () => PortableTextMemberSchemaTypes;
1385
1369
  keyGenerator: () => string;
@@ -1439,46 +1423,46 @@ declare const editorMachine: xstate75.StateMachine<{
1439
1423
  editor: PortableTextSlateEditor;
1440
1424
  }, {}, never, {
1441
1425
  type: "add behavior to context";
1442
- params: xstate75.NonReducibleUnknown;
1426
+ params: xstate71.NonReducibleUnknown;
1443
1427
  } | {
1444
1428
  type: "remove behavior from context";
1445
- params: xstate75.NonReducibleUnknown;
1429
+ params: xstate71.NonReducibleUnknown;
1446
1430
  } | {
1447
1431
  type: "add slate editor to context";
1448
- params: xstate75.NonReducibleUnknown;
1432
+ params: xstate71.NonReducibleUnknown;
1449
1433
  } | {
1450
1434
  type: "emit patch event";
1451
- params: xstate75.NonReducibleUnknown;
1435
+ params: xstate71.NonReducibleUnknown;
1452
1436
  } | {
1453
1437
  type: "emit mutation event";
1454
- params: xstate75.NonReducibleUnknown;
1438
+ params: xstate71.NonReducibleUnknown;
1455
1439
  } | {
1456
1440
  type: "emit read only";
1457
- params: xstate75.NonReducibleUnknown;
1441
+ params: xstate71.NonReducibleUnknown;
1458
1442
  } | {
1459
1443
  type: "emit editable";
1460
- params: xstate75.NonReducibleUnknown;
1444
+ params: xstate71.NonReducibleUnknown;
1461
1445
  } | {
1462
1446
  type: "defer event";
1463
- params: xstate75.NonReducibleUnknown;
1447
+ params: xstate71.NonReducibleUnknown;
1464
1448
  } | {
1465
1449
  type: "emit pending events";
1466
- params: xstate75.NonReducibleUnknown;
1450
+ params: xstate71.NonReducibleUnknown;
1467
1451
  } | {
1468
1452
  type: "emit ready";
1469
- params: xstate75.NonReducibleUnknown;
1453
+ params: xstate71.NonReducibleUnknown;
1470
1454
  } | {
1471
1455
  type: "clear pending events";
1472
- params: xstate75.NonReducibleUnknown;
1456
+ params: xstate71.NonReducibleUnknown;
1473
1457
  } | {
1474
1458
  type: "defer incoming patches";
1475
- params: xstate75.NonReducibleUnknown;
1459
+ params: xstate71.NonReducibleUnknown;
1476
1460
  } | {
1477
1461
  type: "emit pending incoming patches";
1478
- params: xstate75.NonReducibleUnknown;
1462
+ params: xstate71.NonReducibleUnknown;
1479
1463
  } | {
1480
1464
  type: "clear pending incoming patches";
1481
- params: xstate75.NonReducibleUnknown;
1465
+ params: xstate71.NonReducibleUnknown;
1482
1466
  } | {
1483
1467
  type: "handle blur";
1484
1468
  params: unknown;
@@ -1489,8 +1473,8 @@ declare const editorMachine: xstate75.StateMachine<{
1489
1473
  type: "handle behavior event";
1490
1474
  params: unknown;
1491
1475
  } | {
1492
- type: "index behaviors";
1493
- params: xstate75.NonReducibleUnknown;
1476
+ type: "sort behaviors";
1477
+ params: xstate71.NonReducibleUnknown;
1494
1478
  }, {
1495
1479
  type: "slate is busy";
1496
1480
  params: unknown;
@@ -1520,9 +1504,9 @@ declare const editorMachine: xstate75.StateMachine<{
1520
1504
  readOnly?: boolean;
1521
1505
  schema: EditorSchema;
1522
1506
  initialValue?: Array<PortableTextBlock>;
1523
- }, xstate75.NonReducibleUnknown, InternalPatchEvent | MutationEvent | PatchesEvent | {
1507
+ }, xstate71.NonReducibleUnknown, InternalPatchEvent | MutationEvent | PatchesEvent | {
1524
1508
  type: "blurred";
1525
- event: react8.FocusEvent<HTMLDivElement, Element>;
1509
+ event: react10.FocusEvent<HTMLDivElement, Element>;
1526
1510
  } | {
1527
1511
  type: "done loading";
1528
1512
  } | {
@@ -1534,7 +1518,7 @@ declare const editorMachine: xstate75.StateMachine<{
1534
1518
  data: unknown;
1535
1519
  } | {
1536
1520
  type: "focused";
1537
- event: react8.FocusEvent<HTMLDivElement, Element>;
1521
+ event: react10.FocusEvent<HTMLDivElement, Element>;
1538
1522
  } | {
1539
1523
  type: "invalid value";
1540
1524
  resolution: InvalidValueResolution | null;
@@ -1551,7 +1535,7 @@ declare const editorMachine: xstate75.StateMachine<{
1551
1535
  } | {
1552
1536
  type: "value changed";
1553
1537
  value: Array<PortableTextBlock> | undefined;
1554
- }, xstate75.MetaObject, {
1538
+ }, xstate71.MetaObject, {
1555
1539
  id: "editor";
1556
1540
  states: {
1557
1541
  readonly 'edit mode': {