@portabletext/editor 6.6.8 → 6.6.9

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,6 +1,6 @@
1
1
  import * as _portabletext_schema6 from "@portabletext/schema";
2
2
  import { AnnotationDefinition, AnnotationSchemaType, AnnotationSchemaType as AnnotationSchemaType$1, BaseDefinition, BlockObjectDefinition, BlockObjectSchemaType, BlockObjectSchemaType as BlockObjectSchemaType$1, DecoratorDefinition, DecoratorSchemaType, DecoratorSchemaType as DecoratorSchemaType$1, FieldDefinition, InlineObjectDefinition, InlineObjectSchemaType, InlineObjectSchemaType as InlineObjectSchemaType$1, ListDefinition, ListSchemaType, ListSchemaType as ListSchemaType$1, PortableTextBlock, PortableTextBlock as PortableTextBlock$1, PortableTextChild, PortableTextChild as PortableTextChild$1, PortableTextObject, PortableTextObject as PortableTextObject$1, PortableTextSpan, PortableTextSpan as PortableTextSpan$1, PortableTextTextBlock, PortableTextTextBlock as PortableTextTextBlock$1, Schema, SchemaDefinition, SchemaDefinition as SchemaDefinition$1, StyleDefinition, StyleSchemaType, StyleSchemaType as StyleSchemaType$1, TypedObject, defineSchema } from "@portabletext/schema";
3
- import * as xstate73 from "xstate";
3
+ import * as xstate72 from "xstate";
4
4
  import { ActorRef, ActorRefFrom, EventObject, Snapshot } from "xstate";
5
5
  import * as react4 from "react";
6
6
  import React$1, { BaseSyntheticEvent, ClipboardEvent as ClipboardEvent$1, FocusEvent, JSX, PropsWithChildren, ReactElement, RefObject, TextareaHTMLAttributes } from "react";
@@ -1448,7 +1448,7 @@ type EditorActor = ActorRefFrom<typeof editorMachine>;
1448
1448
  /**
1449
1449
  * @internal
1450
1450
  */
1451
- declare const editorMachine: xstate73.StateMachine<{
1451
+ declare const editorMachine: xstate72.StateMachine<{
1452
1452
  behaviors: Set<BehaviorConfig>;
1453
1453
  behaviorsSorted: boolean;
1454
1454
  converters: Set<Converter>;
@@ -1509,52 +1509,52 @@ declare const editorMachine: xstate73.StateMachine<{
1509
1509
  editor: PortableTextSlateEditor;
1510
1510
  }, {}, never, {
1511
1511
  type: "add behavior to context";
1512
- params: xstate73.NonReducibleUnknown;
1512
+ params: xstate72.NonReducibleUnknown;
1513
1513
  } | {
1514
1514
  type: "remove behavior from context";
1515
- params: xstate73.NonReducibleUnknown;
1515
+ params: xstate72.NonReducibleUnknown;
1516
1516
  } | {
1517
1517
  type: "add slate editor to context";
1518
- params: xstate73.NonReducibleUnknown;
1518
+ params: xstate72.NonReducibleUnknown;
1519
1519
  } | {
1520
1520
  type: "emit patch event";
1521
- params: xstate73.NonReducibleUnknown;
1521
+ params: xstate72.NonReducibleUnknown;
1522
1522
  } | {
1523
1523
  type: "emit mutation event";
1524
- params: xstate73.NonReducibleUnknown;
1524
+ params: xstate72.NonReducibleUnknown;
1525
1525
  } | {
1526
1526
  type: "emit read only";
1527
- params: xstate73.NonReducibleUnknown;
1527
+ params: xstate72.NonReducibleUnknown;
1528
1528
  } | {
1529
1529
  type: "emit editable";
1530
- params: xstate73.NonReducibleUnknown;
1530
+ params: xstate72.NonReducibleUnknown;
1531
1531
  } | {
1532
1532
  type: "defer event";
1533
- params: xstate73.NonReducibleUnknown;
1533
+ params: xstate72.NonReducibleUnknown;
1534
1534
  } | {
1535
1535
  type: "emit pending events";
1536
- params: xstate73.NonReducibleUnknown;
1536
+ params: xstate72.NonReducibleUnknown;
1537
1537
  } | {
1538
1538
  type: "emit ready";
1539
- params: xstate73.NonReducibleUnknown;
1539
+ params: xstate72.NonReducibleUnknown;
1540
1540
  } | {
1541
1541
  type: "clear pending events";
1542
- params: xstate73.NonReducibleUnknown;
1542
+ params: xstate72.NonReducibleUnknown;
1543
1543
  } | {
1544
1544
  type: "discard conflicting pending patches";
1545
- params: xstate73.NonReducibleUnknown;
1545
+ params: xstate72.NonReducibleUnknown;
1546
1546
  } | {
1547
1547
  type: "discard all pending events";
1548
- params: xstate73.NonReducibleUnknown;
1548
+ params: xstate72.NonReducibleUnknown;
1549
1549
  } | {
1550
1550
  type: "defer incoming patches";
1551
- params: xstate73.NonReducibleUnknown;
1551
+ params: xstate72.NonReducibleUnknown;
1552
1552
  } | {
1553
1553
  type: "emit pending incoming patches";
1554
- params: xstate73.NonReducibleUnknown;
1554
+ params: xstate72.NonReducibleUnknown;
1555
1555
  } | {
1556
1556
  type: "clear pending incoming patches";
1557
- params: xstate73.NonReducibleUnknown;
1557
+ params: xstate72.NonReducibleUnknown;
1558
1558
  } | {
1559
1559
  type: "handle blur";
1560
1560
  params: unknown;
@@ -1566,7 +1566,7 @@ declare const editorMachine: xstate73.StateMachine<{
1566
1566
  params: unknown;
1567
1567
  } | {
1568
1568
  type: "sort behaviors";
1569
- params: xstate73.NonReducibleUnknown;
1569
+ params: xstate72.NonReducibleUnknown;
1570
1570
  }, {
1571
1571
  type: "slate is busy";
1572
1572
  params: unknown;
@@ -1595,7 +1595,7 @@ declare const editorMachine: xstate73.StateMachine<{
1595
1595
  readOnly?: boolean;
1596
1596
  schema: EditorSchema;
1597
1597
  initialValue?: Array<PortableTextBlock>;
1598
- }, xstate73.NonReducibleUnknown, InternalPatchEvent | MutationEvent | PatchesEvent | {
1598
+ }, xstate72.NonReducibleUnknown, InternalPatchEvent | MutationEvent | PatchesEvent | {
1599
1599
  type: "blurred";
1600
1600
  event: react4.FocusEvent<HTMLDivElement, Element>;
1601
1601
  } | {
@@ -1626,7 +1626,7 @@ declare const editorMachine: xstate73.StateMachine<{
1626
1626
  } | {
1627
1627
  type: "value changed";
1628
1628
  value: Array<PortableTextBlock> | undefined;
1629
- }, xstate73.MetaObject, {
1629
+ }, xstate72.MetaObject, {
1630
1630
  id: "editor";
1631
1631
  states: {
1632
1632
  readonly 'edit mode': {
package/lib/index.js CHANGED
@@ -17504,6 +17504,13 @@ const editorMachine = setup({
17504
17504
  }) => event), assign({
17505
17505
  lastEventWasFocused: !1
17506
17506
  })]
17507
+ }, {
17508
+ // Without an unguarded fallback, a deduped `selection` event falls
17509
+ // through to the `'*'` wildcard below and gets emitted anyway,
17510
+ // defeating the dedupe above.
17511
+ actions: [assign({
17512
+ lastEventWasFocused: !1
17513
+ })]
17507
17514
  }],
17508
17515
  "*": {
17509
17516
  actions: [emit(({