@portabletext/editor 2.17.2 → 2.18.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.
Files changed (43) hide show
  1. package/lib/_chunks-dts/{behavior.types.action.d.cts → index.d.ts} +63 -63
  2. package/lib/behaviors/index.d.ts +1 -1
  3. package/lib/index.d.ts +1 -1
  4. package/lib/plugins/index.d.ts +2 -2
  5. package/lib/selectors/index.d.ts +2 -2
  6. package/lib/utils/index.d.ts +1 -1
  7. package/package.json +22 -33
  8. package/src/test/vitest/step-definitions.tsx +2 -0
  9. package/src/test/vitest/test-editor.tsx +18 -4
  10. package/lib/_chunks-cjs/selector.get-selection-text.cjs +0 -89
  11. package/lib/_chunks-cjs/selector.get-selection-text.cjs.map +0 -1
  12. package/lib/_chunks-cjs/selector.get-text-before.cjs +0 -34
  13. package/lib/_chunks-cjs/selector.get-text-before.cjs.map +0 -1
  14. package/lib/_chunks-cjs/selector.is-at-the-start-of-block.cjs +0 -875
  15. package/lib/_chunks-cjs/selector.is-at-the-start-of-block.cjs.map +0 -1
  16. package/lib/_chunks-cjs/use-editor.cjs +0 -28
  17. package/lib/_chunks-cjs/use-editor.cjs.map +0 -1
  18. package/lib/_chunks-cjs/util.child-selection-point-to-block-offset.cjs +0 -79
  19. package/lib/_chunks-cjs/util.child-selection-point-to-block-offset.cjs.map +0 -1
  20. package/lib/_chunks-cjs/util.get-text-block-text.cjs +0 -473
  21. package/lib/_chunks-cjs/util.get-text-block-text.cjs.map +0 -1
  22. package/lib/_chunks-cjs/util.is-empty-text-block.cjs +0 -38
  23. package/lib/_chunks-cjs/util.is-empty-text-block.cjs.map +0 -1
  24. package/lib/_chunks-cjs/util.merge-text-blocks.cjs +0 -23
  25. package/lib/_chunks-cjs/util.merge-text-blocks.cjs.map +0 -1
  26. package/lib/_chunks-cjs/util.slice-text-block.cjs +0 -63
  27. package/lib/_chunks-cjs/util.slice-text-block.cjs.map +0 -1
  28. package/lib/_chunks-dts/behavior.types.action.d.ts +0 -3650
  29. package/lib/behaviors/index.cjs +0 -35
  30. package/lib/behaviors/index.cjs.map +0 -1
  31. package/lib/behaviors/index.d.cts +0 -2
  32. package/lib/index.cjs +0 -12952
  33. package/lib/index.cjs.map +0 -1
  34. package/lib/index.d.cts +0 -2
  35. package/lib/plugins/index.cjs +0 -826
  36. package/lib/plugins/index.cjs.map +0 -1
  37. package/lib/plugins/index.d.cts +0 -196
  38. package/lib/selectors/index.cjs +0 -243
  39. package/lib/selectors/index.cjs.map +0 -1
  40. package/lib/selectors/index.d.cts +0 -357
  41. package/lib/utils/index.cjs +0 -97
  42. package/lib/utils/index.cjs.map +0 -1
  43. package/lib/utils/index.d.cts +0 -186
@@ -1,26 +1,26 @@
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 xstate229 from "xstate";
4
+ import * as xstate243 from "xstate";
5
5
  import { ActorRef, ActorRefFrom, EventObject, Snapshot } from "xstate";
6
- import * as react20 from "react";
6
+ import * as react11 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 _portabletext_schema5 from "@portabletext/schema";
9
+ import * as _portabletext_schema6 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";
13
13
  import { ReactEditor } from "slate-react";
14
- import * as xstate_guards12 from "xstate/guards";
14
+ import * as xstate_guards14 from "xstate/guards";
15
15
  type MIMEType = `${string}/${string}`;
16
16
  /**
17
17
  * @internal
18
18
  */
19
19
  type PickFromUnion<TUnion, TTagKey extends keyof TUnion, TPickedTags extends TUnion[TTagKey]> = TUnion extends Record<TTagKey, TPickedTags> ? TUnion : never;
20
- type NamespaceEvent<TEvent, TNamespace extends string> = TEvent extends {
20
+ type NamespaceEvent<TEvent, TNamespace$1 extends string> = TEvent extends {
21
21
  type: infer TEventType;
22
- } ? { [K in keyof TEvent]: K extends 'type' ? `${TNamespace}.${TEventType & string}` : TEvent[K] } : never;
23
- type StrictExtract<T, U extends T> = U;
22
+ } ? { [K in keyof TEvent]: K extends 'type' ? `${TNamespace$1}.${TEventType & string}` : TEvent[K] } : never;
23
+ type StrictExtract<T$1, U extends T$1> = U;
24
24
  type Converter<TMIMEType extends MIMEType = MIMEType> = {
25
25
  mimeType: TMIMEType;
26
26
  serialize: Serializer<TMIMEType>;
@@ -219,7 +219,7 @@ declare class PortableTextEditor extends Component<PortableTextEditorProps<Inter
219
219
  componentDidUpdate(prevProps: PortableTextEditorProps): void;
220
220
  componentWillUnmount(): void;
221
221
  setEditable: (editable: EditableAPI) => void;
222
- render(): react20.JSX.Element;
222
+ render(): react11.JSX.Element;
223
223
  /**
224
224
  * @deprecated
225
225
  * Use built-in selectors or write your own: https://www.portabletext.org/reference/selectors/
@@ -614,7 +614,7 @@ type PortableTextEditableProps = Omit<TextareaHTMLAttributes<HTMLDivElement>, 'o
614
614
  * ```
615
615
  * @group Components
616
616
  */
617
- declare const PortableTextEditable: react20.ForwardRefExoticComponent<Omit<PortableTextEditableProps, "ref"> & react20.RefAttributes<Omit<HTMLDivElement, "as" | "onPaste" | "onBeforeInput">>>;
617
+ declare const PortableTextEditable: react11.ForwardRefExoticComponent<Omit<PortableTextEditableProps, "ref"> & react11.RefAttributes<Omit<HTMLDivElement, "as" | "onPaste" | "onBeforeInput">>>;
618
618
  type DecoratedRange = BaseRange & {
619
619
  rangeDecoration: RangeDecoration;
620
620
  };
@@ -1360,7 +1360,7 @@ type EditorActor = ActorRefFrom<typeof editorMachine>;
1360
1360
  /**
1361
1361
  * @internal
1362
1362
  */
1363
- declare const editorMachine: xstate229.StateMachine<{
1363
+ declare const editorMachine: xstate243.StateMachine<{
1364
1364
  behaviors: Set<BehaviorConfig>;
1365
1365
  behaviorsSorted: boolean;
1366
1366
  converters: Set<Converter>;
@@ -1424,62 +1424,62 @@ declare const editorMachine: xstate229.StateMachine<{
1424
1424
  } | {
1425
1425
  type: "add slate editor";
1426
1426
  editor: PortableTextSlateEditor;
1427
- }, {}, never, xstate229.Values<{
1427
+ }, {}, never, xstate243.Values<{
1428
1428
  "add behavior to context": {
1429
1429
  type: "add behavior to context";
1430
- params: xstate229.NonReducibleUnknown;
1430
+ params: xstate243.NonReducibleUnknown;
1431
1431
  };
1432
1432
  "remove behavior from context": {
1433
1433
  type: "remove behavior from context";
1434
- params: xstate229.NonReducibleUnknown;
1434
+ params: xstate243.NonReducibleUnknown;
1435
1435
  };
1436
1436
  "add slate editor to context": {
1437
1437
  type: "add slate editor to context";
1438
- params: xstate229.NonReducibleUnknown;
1438
+ params: xstate243.NonReducibleUnknown;
1439
1439
  };
1440
1440
  "emit patch event": {
1441
1441
  type: "emit patch event";
1442
- params: xstate229.NonReducibleUnknown;
1442
+ params: xstate243.NonReducibleUnknown;
1443
1443
  };
1444
1444
  "emit mutation event": {
1445
1445
  type: "emit mutation event";
1446
- params: xstate229.NonReducibleUnknown;
1446
+ params: xstate243.NonReducibleUnknown;
1447
1447
  };
1448
1448
  "emit read only": {
1449
1449
  type: "emit read only";
1450
- params: xstate229.NonReducibleUnknown;
1450
+ params: xstate243.NonReducibleUnknown;
1451
1451
  };
1452
1452
  "emit editable": {
1453
1453
  type: "emit editable";
1454
- params: xstate229.NonReducibleUnknown;
1454
+ params: xstate243.NonReducibleUnknown;
1455
1455
  };
1456
1456
  "defer event": {
1457
1457
  type: "defer event";
1458
- params: xstate229.NonReducibleUnknown;
1458
+ params: xstate243.NonReducibleUnknown;
1459
1459
  };
1460
1460
  "emit pending events": {
1461
1461
  type: "emit pending events";
1462
- params: xstate229.NonReducibleUnknown;
1462
+ params: xstate243.NonReducibleUnknown;
1463
1463
  };
1464
1464
  "emit ready": {
1465
1465
  type: "emit ready";
1466
- params: xstate229.NonReducibleUnknown;
1466
+ params: xstate243.NonReducibleUnknown;
1467
1467
  };
1468
1468
  "clear pending events": {
1469
1469
  type: "clear pending events";
1470
- params: xstate229.NonReducibleUnknown;
1470
+ params: xstate243.NonReducibleUnknown;
1471
1471
  };
1472
1472
  "defer incoming patches": {
1473
1473
  type: "defer incoming patches";
1474
- params: xstate229.NonReducibleUnknown;
1474
+ params: xstate243.NonReducibleUnknown;
1475
1475
  };
1476
1476
  "emit pending incoming patches": {
1477
1477
  type: "emit pending incoming patches";
1478
- params: xstate229.NonReducibleUnknown;
1478
+ params: xstate243.NonReducibleUnknown;
1479
1479
  };
1480
1480
  "clear pending incoming patches": {
1481
1481
  type: "clear pending incoming patches";
1482
- params: xstate229.NonReducibleUnknown;
1482
+ params: xstate243.NonReducibleUnknown;
1483
1483
  };
1484
1484
  "handle blur": {
1485
1485
  type: "handle blur";
@@ -1495,9 +1495,9 @@ declare const editorMachine: xstate229.StateMachine<{
1495
1495
  };
1496
1496
  "sort behaviors": {
1497
1497
  type: "sort behaviors";
1498
- params: xstate229.NonReducibleUnknown;
1498
+ params: xstate243.NonReducibleUnknown;
1499
1499
  };
1500
- }>, xstate229.Values<{
1500
+ }>, xstate243.Values<{
1501
1501
  "slate is busy": {
1502
1502
  type: "slate is busy";
1503
1503
  params: unknown;
@@ -1530,9 +1530,9 @@ declare const editorMachine: xstate229.StateMachine<{
1530
1530
  readOnly?: boolean;
1531
1531
  schema: EditorSchema;
1532
1532
  initialValue?: Array<PortableTextBlock>;
1533
- }, xstate229.NonReducibleUnknown, InternalPatchEvent | MutationEvent | PatchesEvent | {
1533
+ }, xstate243.NonReducibleUnknown, InternalPatchEvent | MutationEvent | PatchesEvent | {
1534
1534
  type: "blurred";
1535
- event: react20.FocusEvent<HTMLDivElement, Element>;
1535
+ event: react11.FocusEvent<HTMLDivElement, Element>;
1536
1536
  } | {
1537
1537
  type: "done loading";
1538
1538
  } | {
@@ -1544,7 +1544,7 @@ declare const editorMachine: xstate229.StateMachine<{
1544
1544
  data: unknown;
1545
1545
  } | {
1546
1546
  type: "focused";
1547
- event: react20.FocusEvent<HTMLDivElement, Element>;
1547
+ event: react11.FocusEvent<HTMLDivElement, Element>;
1548
1548
  } | {
1549
1549
  type: "invalid value";
1550
1550
  resolution: InvalidValueResolution | null;
@@ -1561,19 +1561,19 @@ declare const editorMachine: xstate229.StateMachine<{
1561
1561
  } | {
1562
1562
  type: "value changed";
1563
1563
  value: Array<PortableTextBlock> | undefined;
1564
- }, xstate229.MetaObject, {
1564
+ }, xstate243.MetaObject, {
1565
1565
  readonly id: "editor";
1566
1566
  readonly context: ({
1567
1567
  input
1568
1568
  }: {
1569
1569
  spawn: {
1570
- <TSrc extends never>(logic: TSrc, ...[options]: never): xstate229.ActorRefFromLogic<never>;
1571
- <TLogic extends xstate229.AnyActorLogic>(src: TLogic, ...[options]: xstate229.ConditionalRequired<[options?: ({
1570
+ <TSrc extends never>(logic: TSrc, ...[options]: never): xstate243.ActorRefFromLogic<never>;
1571
+ <TLogic extends xstate243.AnyActorLogic>(src: TLogic, ...[options]: xstate243.ConditionalRequired<[options?: ({
1572
1572
  id?: never;
1573
1573
  systemId?: string;
1574
- input?: xstate229.InputFrom<TLogic> | undefined;
1574
+ input?: xstate243.InputFrom<TLogic> | undefined;
1575
1575
  syncSnapshot?: boolean;
1576
- } & { [K in xstate229.RequiredLogicInput<TLogic>]: unknown }) | undefined], xstate229.IsNotNever<xstate229.RequiredLogicInput<TLogic>>>): xstate229.ActorRefFromLogic<TLogic>;
1576
+ } & { [K in xstate243.RequiredLogicInput<TLogic>]: unknown }) | undefined], xstate243.IsNotNever<xstate243.RequiredLogicInput<TLogic>>>): xstate243.ActorRefFromLogic<TLogic>;
1577
1577
  };
1578
1578
  input: {
1579
1579
  converters?: Array<Converter>;
@@ -1584,7 +1584,7 @@ declare const editorMachine: xstate229.StateMachine<{
1584
1584
  schema: EditorSchema;
1585
1585
  initialValue?: Array<PortableTextBlock>;
1586
1586
  };
1587
- self: xstate229.ActorRef<xstate229.MachineSnapshot<{
1587
+ self: xstate243.ActorRef<xstate243.MachineSnapshot<{
1588
1588
  behaviors: Set<BehaviorConfig>;
1589
1589
  behaviorsSorted: boolean;
1590
1590
  converters: Set<Converter>;
@@ -1648,7 +1648,7 @@ declare const editorMachine: xstate229.StateMachine<{
1648
1648
  } | {
1649
1649
  type: "add slate editor";
1650
1650
  editor: PortableTextSlateEditor;
1651
- }, Record<string, xstate229.AnyActorRef | undefined>, xstate229.StateValue, string, unknown, any, any>, InternalPatchEvent | MutationEvent | PatchesEvent | {
1651
+ }, Record<string, xstate243.AnyActorRef | undefined>, xstate243.StateValue, string, unknown, any, any>, InternalPatchEvent | MutationEvent | PatchesEvent | {
1652
1652
  type: "update readOnly";
1653
1653
  readOnly: boolean;
1654
1654
  } | {
@@ -1694,7 +1694,7 @@ declare const editorMachine: xstate229.StateMachine<{
1694
1694
  } | {
1695
1695
  type: "add slate editor";
1696
1696
  editor: PortableTextSlateEditor;
1697
- }, xstate229.AnyEventObject>;
1697
+ }, xstate243.AnyEventObject>;
1698
1698
  }) => {
1699
1699
  behaviors: Set<{
1700
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, {
@@ -1982,7 +1982,7 @@ declare const editorMachine: xstate229.StateMachine<{
1982
1982
  keyGenerator: () => string;
1983
1983
  pendingEvents: never[];
1984
1984
  pendingIncomingPatchesEvents: never[];
1985
- schema: _portabletext_schema5.Schema;
1985
+ schema: _portabletext_schema6.Schema;
1986
1986
  selection: null;
1987
1987
  initialReadOnly: boolean;
1988
1988
  maxBlocks: number | undefined;
@@ -1996,7 +1996,7 @@ declare const editorMachine: xstate229.StateMachine<{
1996
1996
  readonly actions: "remove behavior from context";
1997
1997
  };
1998
1998
  readonly 'update maxBlocks': {
1999
- readonly actions: xstate229.ActionFunction<{
1999
+ readonly actions: xstate243.ActionFunction<{
2000
2000
  behaviors: Set<BehaviorConfig>;
2001
2001
  behaviorsSorted: boolean;
2002
2002
  converters: Set<Converter>;
@@ -2069,7 +2069,7 @@ declare const editorMachine: xstate229.StateMachine<{
2069
2069
  readonly actions: "add slate editor to context";
2070
2070
  };
2071
2071
  readonly 'update selection': {
2072
- readonly actions: readonly [xstate229.ActionFunction<{
2072
+ readonly actions: readonly [xstate243.ActionFunction<{
2073
2073
  behaviors: Set<BehaviorConfig>;
2074
2074
  behaviorsSorted: boolean;
2075
2075
  converters: Set<Converter>;
@@ -2136,7 +2136,7 @@ declare const editorMachine: xstate229.StateMachine<{
2136
2136
  } | {
2137
2137
  type: "add slate editor";
2138
2138
  editor: PortableTextSlateEditor;
2139
- }, undefined, never, never, never, never, never>, xstate229.ActionFunction<{
2139
+ }, undefined, never, never, never, never, never>, xstate243.ActionFunction<{
2140
2140
  behaviors: Set<BehaviorConfig>;
2141
2141
  behaviorsSorted: boolean;
2142
2142
  converters: Set<Converter>;
@@ -2205,7 +2205,7 @@ declare const editorMachine: xstate229.StateMachine<{
2205
2205
  editor: PortableTextSlateEditor;
2206
2206
  }, undefined, never, never, never, never, InternalPatchEvent | MutationEvent | PatchesEvent | {
2207
2207
  type: "blurred";
2208
- event: react20.FocusEvent<HTMLDivElement, Element>;
2208
+ event: react11.FocusEvent<HTMLDivElement, Element>;
2209
2209
  } | {
2210
2210
  type: "done loading";
2211
2211
  } | {
@@ -2217,7 +2217,7 @@ declare const editorMachine: xstate229.StateMachine<{
2217
2217
  data: unknown;
2218
2218
  } | {
2219
2219
  type: "focused";
2220
- event: react20.FocusEvent<HTMLDivElement, Element>;
2220
+ event: react11.FocusEvent<HTMLDivElement, Element>;
2221
2221
  } | {
2222
2222
  type: "invalid value";
2223
2223
  resolution: InvalidValueResolution | null;
@@ -2237,7 +2237,7 @@ declare const editorMachine: xstate229.StateMachine<{
2237
2237
  }>];
2238
2238
  };
2239
2239
  readonly 'set drag ghost': {
2240
- readonly actions: xstate229.ActionFunction<{
2240
+ readonly actions: xstate243.ActionFunction<{
2241
2241
  behaviors: Set<BehaviorConfig>;
2242
2242
  behaviorsSorted: boolean;
2243
2243
  converters: Set<Converter>;
@@ -2319,7 +2319,7 @@ declare const editorMachine: xstate229.StateMachine<{
2319
2319
  readonly actions: readonly ["sort behaviors", "handle behavior event"];
2320
2320
  readonly guard: ({
2321
2321
  event
2322
- }: xstate_guards12.GuardArgs<{
2322
+ }: xstate_guards14.GuardArgs<{
2323
2323
  behaviors: Set<BehaviorConfig>;
2324
2324
  behaviorsSorted: boolean;
2325
2325
  converters: Set<Converter>;
@@ -2356,7 +2356,7 @@ declare const editorMachine: xstate229.StateMachine<{
2356
2356
  readonly target: "#editor.edit mode.read only.read only";
2357
2357
  readonly guard: ({
2358
2358
  context
2359
- }: xstate_guards12.GuardArgs<{
2359
+ }: xstate_guards14.GuardArgs<{
2360
2360
  behaviors: Set<BehaviorConfig>;
2361
2361
  behaviorsSorted: boolean;
2362
2362
  converters: Set<Converter>;
@@ -2389,7 +2389,7 @@ declare const editorMachine: xstate229.StateMachine<{
2389
2389
  readonly 'update readOnly': {
2390
2390
  readonly guard: ({
2391
2391
  event
2392
- }: xstate_guards12.GuardArgs<{
2392
+ }: xstate_guards14.GuardArgs<{
2393
2393
  behaviors: Set<BehaviorConfig>;
2394
2394
  behaviorsSorted: boolean;
2395
2395
  converters: Set<Converter>;
@@ -2423,7 +2423,7 @@ declare const editorMachine: xstate229.StateMachine<{
2423
2423
  readonly 'update readOnly': {
2424
2424
  readonly guard: ({
2425
2425
  event
2426
- }: xstate_guards12.GuardArgs<{
2426
+ }: xstate_guards14.GuardArgs<{
2427
2427
  behaviors: Set<BehaviorConfig>;
2428
2428
  behaviorsSorted: boolean;
2429
2429
  converters: Set<Converter>;
@@ -2456,7 +2456,7 @@ declare const editorMachine: xstate229.StateMachine<{
2456
2456
  };
2457
2457
  readonly focus: {
2458
2458
  readonly target: ".focusing";
2459
- readonly actions: readonly [xstate229.ActionFunction<{
2459
+ readonly actions: readonly [xstate243.ActionFunction<{
2460
2460
  behaviors: Set<BehaviorConfig>;
2461
2461
  behaviorsSorted: boolean;
2462
2462
  converters: Set<Converter>;
@@ -2533,7 +2533,7 @@ declare const editorMachine: xstate229.StateMachine<{
2533
2533
  readonly exit: readonly [() => void];
2534
2534
  readonly on: {
2535
2535
  readonly dragstart: {
2536
- readonly actions: readonly [xstate229.ActionFunction<{
2536
+ readonly actions: readonly [xstate243.ActionFunction<{
2537
2537
  behaviors: Set<BehaviorConfig>;
2538
2538
  behaviorsSorted: boolean;
2539
2539
  converters: Set<Converter>;
@@ -2635,7 +2635,7 @@ declare const editorMachine: xstate229.StateMachine<{
2635
2635
  readonly entry: readonly [() => void];
2636
2636
  readonly exit: readonly [() => void, ({
2637
2637
  context
2638
- }: xstate229.ActionArgs<{
2638
+ }: xstate243.ActionArgs<{
2639
2639
  behaviors: Set<BehaviorConfig>;
2640
2640
  behaviorsSorted: boolean;
2641
2641
  converters: Set<Converter>;
@@ -2745,7 +2745,7 @@ declare const editorMachine: xstate229.StateMachine<{
2745
2745
  } | {
2746
2746
  type: "add slate editor";
2747
2747
  editor: PortableTextSlateEditor;
2748
- }>) => void, xstate229.ActionFunction<{
2748
+ }>) => void, xstate243.ActionFunction<{
2749
2749
  behaviors: Set<BehaviorConfig>;
2750
2750
  behaviorsSorted: boolean;
2751
2751
  converters: Set<Converter>;
@@ -2855,7 +2855,7 @@ declare const editorMachine: xstate229.StateMachine<{
2855
2855
  } | {
2856
2856
  type: "add slate editor";
2857
2857
  editor: PortableTextSlateEditor;
2858
- }, undefined, never, never, never, never, never>, xstate229.ActionFunction<{
2858
+ }, undefined, never, never, never, never, never>, xstate243.ActionFunction<{
2859
2859
  behaviors: Set<BehaviorConfig>;
2860
2860
  behaviorsSorted: boolean;
2861
2861
  converters: Set<Converter>;
@@ -3012,7 +3012,7 @@ declare const editorMachine: xstate229.StateMachine<{
3012
3012
  readonly exit: readonly [() => void];
3013
3013
  readonly on: {
3014
3014
  readonly patches: {
3015
- readonly actions: readonly [xstate229.ActionFunction<{
3015
+ readonly actions: readonly [xstate243.ActionFunction<{
3016
3016
  behaviors: Set<BehaviorConfig>;
3017
3017
  behaviorsSorted: boolean;
3018
3018
  converters: Set<Converter>;
@@ -3078,7 +3078,7 @@ declare const editorMachine: xstate229.StateMachine<{
3078
3078
  editor: PortableTextSlateEditor;
3079
3079
  }, undefined, never, never, never, never, InternalPatchEvent | MutationEvent | PatchesEvent | {
3080
3080
  type: "blurred";
3081
- event: react20.FocusEvent<HTMLDivElement, Element>;
3081
+ event: react11.FocusEvent<HTMLDivElement, Element>;
3082
3082
  } | {
3083
3083
  type: "done loading";
3084
3084
  } | {
@@ -3090,7 +3090,7 @@ declare const editorMachine: xstate229.StateMachine<{
3090
3090
  data: unknown;
3091
3091
  } | {
3092
3092
  type: "focused";
3093
- event: react20.FocusEvent<HTMLDivElement, Element>;
3093
+ event: react11.FocusEvent<HTMLDivElement, Element>;
3094
3094
  } | {
3095
3095
  type: "invalid value";
3096
3096
  resolution: InvalidValueResolution | null;
@@ -3189,12 +3189,12 @@ type EventPosition = {
3189
3189
  */
3190
3190
  type BehaviorEvent = SyntheticBehaviorEvent | NativeBehaviorEvent | CustomBehaviorEvent;
3191
3191
  type BehaviorEventTypeNamespace = SyntheticBehaviorEventNamespace | NativeBehaviorEventNamespace | CustomBehaviorEventNamespace;
3192
- type NamespacedBehaviorEventType<TNamespace extends BehaviorEventTypeNamespace | ''> = TNamespace extends '' ? BehaviorEvent['type'] : Extract<BehaviorEvent['type'], TNamespace | `${TNamespace}.${string}`>;
3192
+ type NamespacedBehaviorEventType<TNamespace$1 extends BehaviorEventTypeNamespace | ''> = TNamespace$1 extends '' ? BehaviorEvent['type'] : Extract<BehaviorEvent['type'], TNamespace$1 | `${TNamespace$1}.${string}`>;
3193
3193
  /**************************************
3194
3194
  * External events
3195
3195
  **************************************/
3196
3196
  type ExternalBehaviorEventNamespace = 'blur' | 'focus' | 'insert';
3197
- type ExternalBehaviorEventType<TNamespace extends ExternalBehaviorEventNamespace, TType extends string = ''> = TType extends '' ? `${TNamespace}` : `${TNamespace}.${TType}`;
3197
+ type ExternalBehaviorEventType<TNamespace$1 extends ExternalBehaviorEventNamespace, TType$1 extends string = ''> = TType$1 extends '' ? `${TNamespace$1}` : `${TNamespace$1}.${TType$1}`;
3198
3198
  type ExternalBehaviorEvent = {
3199
3199
  type: ExternalBehaviorEventType<'blur'>;
3200
3200
  } | {
@@ -3548,18 +3548,18 @@ type MouseBehaviorEvent = {
3548
3548
  * Custom events
3549
3549
  **************************************/
3550
3550
  type CustomBehaviorEventNamespace = 'custom';
3551
- type CustomBehaviorEventType<TNamespace extends CustomBehaviorEventNamespace, TType extends string = ''> = TType extends '' ? `${TNamespace}` : `${TNamespace}.${TType}`;
3551
+ type CustomBehaviorEventType<TNamespace$1 extends CustomBehaviorEventNamespace, TType$1 extends string = ''> = TType$1 extends '' ? `${TNamespace$1}` : `${TNamespace$1}.${TType$1}`;
3552
3552
  /**
3553
3553
  * @beta
3554
3554
  */
3555
- type CustomBehaviorEvent<TPayload extends Record<string, unknown> = Record<string, unknown>, TType extends string = string, TInternalType extends CustomBehaviorEventType<'custom', TType> = CustomBehaviorEventType<'custom', TType>> = {
3555
+ type CustomBehaviorEvent<TPayload extends Record<string, unknown> = Record<string, unknown>, TType$1 extends string = string, TInternalType extends CustomBehaviorEventType<'custom', TType$1> = CustomBehaviorEventType<'custom', TType$1>> = {
3556
3556
  type: TInternalType;
3557
3557
  } & TPayload;
3558
3558
  /**************************************
3559
3559
  * Resolve behavior event
3560
3560
  **************************************/
3561
3561
  type ResolveBehaviorEvent<TBehaviorEventType extends '*' | `${BehaviorEventTypeNamespace}.*` | BehaviorEvent['type'], TPayload extends Record<string, unknown> = Record<string, unknown>> = TBehaviorEventType extends '*' ? BehaviorEvent : TBehaviorEventType extends `${infer TNamespace}.*` ? TNamespace extends BehaviorEventTypeNamespace ? PickFromUnion<BehaviorEvent, 'type', NamespacedBehaviorEventType<TNamespace>> : never : TBehaviorEventType extends `custom.${infer TType}` ? CustomBehaviorEvent<TPayload, TType> : TBehaviorEventType extends BehaviorEvent['type'] ? PickFromUnion<BehaviorEvent, 'type', TBehaviorEventType> : never;
3562
- type ExtractNamespace<TType extends string> = TType extends `${infer Namespace}.${string}` ? Namespace : TType;
3562
+ type ExtractNamespace<TType$1 extends string> = TType$1 extends `${infer Namespace}.${string}` ? Namespace : TType$1;
3563
3563
  type EditorDom = {
3564
3564
  getBlockNodes: (snapshot: EditorSnapshot) => Array<Node>;
3565
3565
  getChildNodes: (snapshot: EditorSnapshot) => Array<Node>;
@@ -3647,4 +3647,4 @@ type BehaviorActionSet<TBehaviorEvent, TGuardResponse> = (payload: {
3647
3647
  event: TBehaviorEvent;
3648
3648
  dom: EditorDom;
3649
3649
  }, guardResponse: TGuardResponse) => Array<BehaviorAction>;
3650
- export { type AddedAnnotationPaths, type AnnotationDefinition, type AnnotationPath, type AnnotationSchemaType, type BaseDefinition, Behavior, BehaviorAction, BehaviorActionSet, BehaviorEvent, BehaviorGuard, type BlockAnnotationRenderProps, type BlockChildRenderProps, type BlockDecoratorRenderProps, type BlockListItemRenderProps, type BlockObjectDefinition, type BlockObjectSchemaType, type BlockOffset, type BlockPath, type BlockRenderProps, type BlockStyleRenderProps, type BlurChange, type ChildPath, type ConnectionChange, CustomBehaviorEvent, type DecoratorDefinition, type DecoratorSchemaType, type EditableAPI, type EditableAPIDeleteOptions, type Editor, type EditorChange, type EditorChanges, type EditorConfig, type EditorContext, type EditorEmittedEvent, type EditorEvent, EditorEventListener, EditorProvider, type EditorProviderProps, type EditorSchema, type EditorSelection, type EditorSelectionPoint, type EditorSelector, type EditorSnapshot, type ErrorChange, type FieldDefinition, type FocusChange, type HotkeyOptions, type InlineObjectDefinition, type InlineObjectSchemaType, InsertPlacement, type InvalidValue, type InvalidValueResolution, type ListDefinition, type ListSchemaType, type LoadingChange, type MutationChange, type MutationEvent, NativeBehaviorEvent, type OnBeforeInputFn, type OnCopyFn, type OnPasteFn, type OnPasteResult, type OnPasteResultOrPromise, type PasteData, type Patch$1 as Patch, type PatchChange, type PatchObservable, type PatchesEvent, type PortableTextBlock$1 as PortableTextBlock, type PortableTextChild$1 as PortableTextChild, PortableTextEditable, type PortableTextEditableProps, PortableTextEditor, type PortableTextEditorProps, type PortableTextMemberSchemaTypes, type PortableTextObject$2 as PortableTextObject, type PortableTextSpan$2 as PortableTextSpan, type PortableTextTextBlock$2 as PortableTextTextBlock, type RangeDecoration, type RangeDecorationOnMovedDetails, type ReadyChange, type RedoChange, type RenderAnnotationFunction, type RenderBlockFunction, type RenderChildFunction, type RenderDecoratorFunction, type RenderEditableFunction, type RenderListItemFunction, type RenderPlaceholderFunction, type RenderStyleFunction, type SchemaDefinition$1 as SchemaDefinition, type ScrollSelectionIntoViewFunction, type SelectionChange, type StyleDefinition, type StyleSchemaType, SyntheticBehaviorEvent, type UndoChange, type UnsetChange, type ValueChange, defaultKeyGenerator, defineBehavior, defineSchema, effect, execute, forward, raise, useEditor, useEditorSelector, usePortableTextEditor, usePortableTextEditorSelection };
3650
+ export { AddedAnnotationPaths as $, PortableTextEditorProps as $t, PortableTextTextBlock$2 as A, RangeDecorationOnMovedDetails as At, EditorSelector as B, RenderStyleFunction as Bt, ListDefinition as C, OnPasteResult as Ct, PortableTextChild$1 as D, PatchObservable as Dt, PortableTextBlock$1 as E, PatchChange as Et, BlockOffset as F, RenderChildFunction as Ft, Editor as G, ValueChange as Gt, EditorProvider as H, SelectionChange as Ht, useEditor as I, RenderDecoratorFunction as It, Behavior as J, ChildPath as Jt, EditorConfig as K, AnnotationPath as Kt, defaultKeyGenerator as L, RenderEditableFunction as Lt, StyleDefinition as M, RedoChange as Mt, StyleSchemaType as N, RenderAnnotationFunction as Nt, PortableTextObject$2 as O, PortableTextMemberSchemaTypes as Ot, defineSchema as P, RenderBlockFunction as Pt, EditorSnapshot as Q, PortableTextEditor as Qt, usePortableTextEditorSelection as R, RenderListItemFunction as Rt, InlineObjectSchemaType as S, OnPasteFn as St, Patch$1 as T, PasteData as Tt, EditorProviderProps as U, UndoChange as Ut, useEditorSelector as V, ScrollSelectionIntoViewFunction as Vt, EditorEventListener as W, UnsetChange as Wt, BehaviorGuard as X, PortableTextEditableProps as Xt, defineBehavior as Y, PortableTextEditable as Yt, EditorContext as Z, HotkeyOptions as Zt, BlockObjectSchemaType as _, InvalidValueResolution as _t, forward as a, BlockStyleRenderProps as at, FieldDefinition as b, OnBeforeInputFn as bt, CustomBehaviorEvent as c, EditableAPI as ct, SyntheticBehaviorEvent as d, EditorChanges as dt, EditorSchema as en, BlockAnnotationRenderProps as et, PatchesEvent as f, EditorSelection as ft, BlockObjectDefinition as g, InvalidValue as gt, BaseDefinition as h, FocusChange as ht, execute as i, BlockRenderProps as it, SchemaDefinition$1 as j, ReadyChange as jt, PortableTextSpan$2 as k, RangeDecoration as kt, InsertPlacement as l, EditableAPIDeleteOptions as lt, AnnotationSchemaType as m, ErrorChange as mt, BehaviorActionSet as n, MutationEvent as nn, BlockDecoratorRenderProps as nt, raise as o, BlurChange as ot, AnnotationDefinition as p, EditorSelectionPoint as pt, EditorEvent as q, BlockPath as qt, effect as r, BlockListItemRenderProps as rt, BehaviorEvent as s, ConnectionChange as st, BehaviorAction as t, EditorEmittedEvent as tn, BlockChildRenderProps as tt, NativeBehaviorEvent as u, EditorChange as ut, DecoratorDefinition as v, LoadingChange as vt, ListSchemaType as w, OnPasteResultOrPromise as wt, InlineObjectDefinition as x, OnCopyFn as xt, DecoratorSchemaType as y, MutationChange as yt, usePortableTextEditor as z, RenderPlaceholderFunction as zt };
@@ -1,2 +1,2 @@
1
- import { Behavior, BehaviorAction, BehaviorActionSet, BehaviorEvent, BehaviorGuard, CustomBehaviorEvent, InsertPlacement, NativeBehaviorEvent, SyntheticBehaviorEvent, defineBehavior, effect, execute, forward, raise } from "../_chunks-dts/behavior.types.action.js";
1
+ import { J as Behavior, X as BehaviorGuard, Y as defineBehavior, a as forward, c as CustomBehaviorEvent, d as SyntheticBehaviorEvent, i as execute, l as InsertPlacement, n as BehaviorActionSet, o as raise, r as effect, s as BehaviorEvent, t as BehaviorAction, u as NativeBehaviorEvent } from "../_chunks-dts/index.js";
2
2
  export { Behavior, BehaviorAction, BehaviorActionSet, BehaviorEvent, BehaviorGuard, CustomBehaviorEvent, InsertPlacement, NativeBehaviorEvent, SyntheticBehaviorEvent, defineBehavior, effect, execute, forward, raise };
package/lib/index.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import { AddedAnnotationPaths, AnnotationDefinition, AnnotationPath, AnnotationSchemaType, BaseDefinition, BlockAnnotationRenderProps, BlockChildRenderProps, BlockDecoratorRenderProps, BlockListItemRenderProps, BlockObjectDefinition, BlockObjectSchemaType, BlockOffset, BlockPath, BlockRenderProps, BlockStyleRenderProps, BlurChange, ChildPath, ConnectionChange, DecoratorDefinition, DecoratorSchemaType, EditableAPI, EditableAPIDeleteOptions, Editor, EditorChange, EditorChanges, EditorConfig, EditorContext, EditorEmittedEvent, EditorEvent, EditorEventListener, EditorProvider, EditorProviderProps, EditorSchema, EditorSelection, EditorSelectionPoint, EditorSelector, EditorSnapshot, ErrorChange, FieldDefinition, FocusChange, HotkeyOptions, InlineObjectDefinition, InlineObjectSchemaType, InvalidValue, InvalidValueResolution, ListDefinition, ListSchemaType, LoadingChange, MutationChange, MutationEvent, OnBeforeInputFn, OnCopyFn, OnPasteFn, OnPasteResult, OnPasteResultOrPromise, PasteData, Patch, PatchChange, PatchObservable, PatchesEvent, PortableTextBlock, PortableTextChild, PortableTextEditable, PortableTextEditableProps, PortableTextEditor, PortableTextEditorProps, PortableTextMemberSchemaTypes, PortableTextObject, PortableTextSpan, PortableTextTextBlock, RangeDecoration, RangeDecorationOnMovedDetails, ReadyChange, RedoChange, RenderAnnotationFunction, RenderBlockFunction, RenderChildFunction, RenderDecoratorFunction, RenderEditableFunction, RenderListItemFunction, RenderPlaceholderFunction, RenderStyleFunction, SchemaDefinition, ScrollSelectionIntoViewFunction, SelectionChange, StyleDefinition, StyleSchemaType, UndoChange, UnsetChange, ValueChange, defaultKeyGenerator, defineSchema, useEditor, useEditorSelector, usePortableTextEditor, usePortableTextEditorSelection } from "./_chunks-dts/behavior.types.action.js";
1
+ import { $ as AddedAnnotationPaths, $t as PortableTextEditorProps, A as PortableTextTextBlock, At as RangeDecorationOnMovedDetails, B as EditorSelector, Bt as RenderStyleFunction, C as ListDefinition, Ct as OnPasteResult, D as PortableTextChild, Dt as PatchObservable, E as PortableTextBlock, Et as PatchChange, F as BlockOffset, Ft as RenderChildFunction, G as Editor, Gt as ValueChange, H as EditorProvider, Ht as SelectionChange, I as useEditor, It as RenderDecoratorFunction, Jt as ChildPath, K as EditorConfig, Kt as AnnotationPath, L as defaultKeyGenerator, Lt as RenderEditableFunction, M as StyleDefinition, Mt as RedoChange, N as StyleSchemaType, Nt as RenderAnnotationFunction, O as PortableTextObject, Ot as PortableTextMemberSchemaTypes, P as defineSchema, Pt as RenderBlockFunction, Q as EditorSnapshot, Qt as PortableTextEditor, R as usePortableTextEditorSelection, Rt as RenderListItemFunction, S as InlineObjectSchemaType, St as OnPasteFn, T as Patch, Tt as PasteData, U as EditorProviderProps, Ut as UndoChange, V as useEditorSelector, Vt as ScrollSelectionIntoViewFunction, W as EditorEventListener, Wt as UnsetChange, Xt as PortableTextEditableProps, Yt as PortableTextEditable, Z as EditorContext, Zt as HotkeyOptions, _ as BlockObjectSchemaType, _t as InvalidValueResolution, at as BlockStyleRenderProps, b as FieldDefinition, bt as OnBeforeInputFn, ct as EditableAPI, dt as EditorChanges, en as EditorSchema, et as BlockAnnotationRenderProps, f as PatchesEvent, ft as EditorSelection, g as BlockObjectDefinition, gt as InvalidValue, h as BaseDefinition, ht as FocusChange, it as BlockRenderProps, j as SchemaDefinition, jt as ReadyChange, k as PortableTextSpan, kt as RangeDecoration, lt as EditableAPIDeleteOptions, m as AnnotationSchemaType, mt as ErrorChange, nn as MutationEvent, nt as BlockDecoratorRenderProps, ot as BlurChange, p as AnnotationDefinition, pt as EditorSelectionPoint, q as EditorEvent, qt as BlockPath, rt as BlockListItemRenderProps, st as ConnectionChange, tn as EditorEmittedEvent, tt as BlockChildRenderProps, ut as EditorChange, v as DecoratorDefinition, vt as LoadingChange, w as ListSchemaType, wt as OnPasteResultOrPromise, x as InlineObjectDefinition, xt as OnCopyFn, y as DecoratorSchemaType, yt as MutationChange, z as usePortableTextEditor, zt as RenderPlaceholderFunction } from "./_chunks-dts/index.js";
2
2
  export { AddedAnnotationPaths, AnnotationDefinition, AnnotationPath, AnnotationSchemaType, BaseDefinition, BlockAnnotationRenderProps, BlockChildRenderProps, BlockDecoratorRenderProps, BlockListItemRenderProps, BlockObjectDefinition, BlockObjectSchemaType, BlockOffset, BlockPath, BlockRenderProps, BlockStyleRenderProps, BlurChange, ChildPath, ConnectionChange, DecoratorDefinition, DecoratorSchemaType, EditableAPI, EditableAPIDeleteOptions, Editor, EditorChange, EditorChanges, EditorConfig, EditorContext, EditorEmittedEvent, EditorEvent, EditorEventListener, EditorProvider, EditorProviderProps, EditorSchema, EditorSelection, EditorSelectionPoint, EditorSelector, EditorSnapshot, ErrorChange, FieldDefinition, FocusChange, HotkeyOptions, InlineObjectDefinition, InlineObjectSchemaType, InvalidValue, InvalidValueResolution, ListDefinition, ListSchemaType, LoadingChange, MutationChange, MutationEvent, OnBeforeInputFn, OnCopyFn, OnPasteFn, OnPasteResult, OnPasteResultOrPromise, PasteData, Patch, PatchChange, PatchObservable, PatchesEvent, PortableTextBlock, PortableTextChild, PortableTextEditable, PortableTextEditableProps, PortableTextEditor, PortableTextEditorProps, PortableTextMemberSchemaTypes, PortableTextObject, PortableTextSpan, PortableTextTextBlock, RangeDecoration, RangeDecorationOnMovedDetails, ReadyChange, RedoChange, RenderAnnotationFunction, RenderBlockFunction, RenderChildFunction, RenderDecoratorFunction, RenderEditableFunction, RenderListItemFunction, RenderPlaceholderFunction, RenderStyleFunction, SchemaDefinition, ScrollSelectionIntoViewFunction, SelectionChange, StyleDefinition, StyleSchemaType, UndoChange, UnsetChange, ValueChange, defineSchema, defaultKeyGenerator as keyGenerator, useEditor, useEditorSelector, usePortableTextEditor, usePortableTextEditorSelection };
@@ -1,4 +1,4 @@
1
- import { Behavior, Editor, EditorEmittedEvent, EditorSchema } from "../_chunks-dts/behavior.types.action.js";
1
+ import { G as Editor, J as Behavior, en as EditorSchema, tn as EditorEmittedEvent } from "../_chunks-dts/index.js";
2
2
  import * as react22 from "react";
3
3
  import React from "react";
4
4
  /**
@@ -193,4 +193,4 @@ declare function MarkdownPlugin(props: {
193
193
  * @deprecated Install the plugin from `@portabletext/plugin-one-line`
194
194
  */
195
195
  declare function OneLinePlugin(): react22.JSX.Element;
196
- export { BehaviorPlugin, DecoratorShortcutPlugin, EditorRefPlugin, EventListenerPlugin, MarkdownPlugin, MarkdownPluginConfig, OneLinePlugin };
196
+ export { BehaviorPlugin, DecoratorShortcutPlugin, EditorRefPlugin, EventListenerPlugin, MarkdownPlugin, type MarkdownPluginConfig, OneLinePlugin };
@@ -1,4 +1,4 @@
1
- import { BlockOffset, BlockPath, ChildPath, EditorSelection, EditorSelectionPoint, EditorSelector } from "../_chunks-dts/behavior.types.action.js";
1
+ import { B as EditorSelector, F as BlockOffset, Jt as ChildPath, ft as EditorSelection, pt as EditorSelectionPoint, qt as BlockPath } from "../_chunks-dts/index.js";
2
2
  import { KeyedSegment, PortableTextBlock, PortableTextListBlock, PortableTextObject, PortableTextSpan, PortableTextTextBlock } from "@sanity/types";
3
3
  /**
4
4
  * @public
@@ -354,4 +354,4 @@ declare const isSelectionCollapsed: EditorSelector<boolean>;
354
354
  * @public
355
355
  */
356
356
  declare const isSelectionExpanded: EditorSelector<boolean>;
357
- export { MarkState, getActiveAnnotations, getActiveListItem, getActiveStyle, getAnchorBlock, getAnchorChild, getAnchorSpan, getAnchorTextBlock, getBlockOffsets, getBlockTextAfter, getBlockTextBefore, getCaretWordSelection, getFirstBlock, getFocusBlock, getFocusBlockObject, getFocusChild, getFocusInlineObject, getFocusListBlock, getFocusSpan, getFocusTextBlock, getLastBlock, getListIndex, getMarkState, getNextBlock, getNextInlineObject, getNextInlineObjects, getNextSpan, getPreviousBlock, getPreviousInlineObject, getPreviousInlineObjects, getPreviousSpan, getSelectedBlocks, getSelectedSlice, getSelectedSpans, getSelectedTextBlocks, getSelectedValue, getSelection, getSelectionEndBlock, getSelectionEndChild, getSelectionEndPoint, getSelectionStartBlock, getSelectionStartChild, getSelectionStartPoint, getSelectionText, getTrimmedSelection, getValue, isActiveAnnotation, isActiveDecorator, isActiveListItem, isActiveStyle, isAtTheEndOfBlock, isAtTheStartOfBlock, isOverlappingSelection, isPointAfterSelection, isPointBeforeSelection, isSelectingEntireBlocks, isSelectionCollapsed, isSelectionExpanded };
357
+ export { type MarkState, getActiveAnnotations, getActiveListItem, getActiveStyle, getAnchorBlock, getAnchorChild, getAnchorSpan, getAnchorTextBlock, getBlockOffsets, getBlockTextAfter, getBlockTextBefore, getCaretWordSelection, getFirstBlock, getFocusBlock, getFocusBlockObject, getFocusChild, getFocusInlineObject, getFocusListBlock, getFocusSpan, getFocusTextBlock, getLastBlock, getListIndex, getMarkState, getNextBlock, getNextInlineObject, getNextInlineObjects, getNextSpan, getPreviousBlock, getPreviousInlineObject, getPreviousInlineObjects, getPreviousSpan, getSelectedBlocks, getSelectedSlice, getSelectedSpans, getSelectedTextBlocks, getSelectedValue, getSelection, getSelectionEndBlock, getSelectionEndChild, getSelectionEndPoint, getSelectionStartBlock, getSelectionStartChild, getSelectionStartPoint, getSelectionText, getTrimmedSelection, getValue, isActiveAnnotation, isActiveDecorator, isActiveListItem, isActiveStyle, isAtTheEndOfBlock, isAtTheStartOfBlock, isOverlappingSelection, isPointAfterSelection, isPointBeforeSelection, isSelectingEntireBlocks, isSelectionCollapsed, isSelectionExpanded };
@@ -1,4 +1,4 @@
1
- import { BlockOffset, BlockPath, ChildPath, EditorContext, EditorSelection, EditorSelectionPoint } from "../_chunks-dts/behavior.types.action.js";
1
+ import { F as BlockOffset, Jt as ChildPath, Z as EditorContext, ft as EditorSelection, pt as EditorSelectionPoint, qt as BlockPath } from "../_chunks-dts/index.js";
2
2
  import * as _sanity_types8 from "@sanity/types";
3
3
  import { KeyedSegment, PortableTextBlock, PortableTextTextBlock } from "@sanity/types";
4
4
  import { isSpan, isTextBlock } from "@portabletext/schema";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@portabletext/editor",
3
- "version": "2.17.2",
3
+ "version": "2.18.1",
4
4
  "description": "Portable Text Editor made in React",
5
5
  "keywords": [
6
6
  "sanity",
@@ -29,26 +29,18 @@
29
29
  "exports": {
30
30
  ".": {
31
31
  "source": "./src/index.ts",
32
- "import": "./lib/index.js",
33
- "require": "./lib/index.cjs",
34
32
  "default": "./lib/index.js"
35
33
  },
36
34
  "./behaviors": {
37
35
  "source": "./src/behaviors/_exports/index.ts",
38
- "import": "./lib/behaviors/index.js",
39
- "require": "./lib/behaviors/index.cjs",
40
36
  "default": "./lib/behaviors/index.js"
41
37
  },
42
38
  "./plugins": {
43
39
  "source": "./src/plugins/_exports/index.ts",
44
- "import": "./lib/plugins/index.js",
45
- "require": "./lib/plugins/index.cjs",
46
40
  "default": "./lib/plugins/index.js"
47
41
  },
48
42
  "./selectors": {
49
43
  "source": "./src/selectors/_exports/index.ts",
50
- "import": "./lib/selectors/index.js",
51
- "require": "./lib/selectors/index.cjs",
52
44
  "default": "./lib/selectors/index.js"
53
45
  },
54
46
  "./test": {
@@ -59,21 +51,18 @@
59
51
  },
60
52
  "./utils": {
61
53
  "source": "./src/utils/_exports/index.ts",
62
- "import": "./lib/utils/index.js",
63
- "require": "./lib/utils/index.cjs",
64
54
  "default": "./lib/utils/index.js"
65
55
  },
66
56
  "./package.json": "./package.json"
67
57
  },
68
- "main": "./lib/index.cjs",
69
- "module": "./lib/index.js",
58
+ "main": "./lib/index.js",
70
59
  "types": "./lib/index.d.ts",
71
60
  "files": [
72
61
  "lib",
73
62
  "src"
74
63
  ],
75
64
  "dependencies": {
76
- "@portabletext/to-html": "^3.0.0",
65
+ "@portabletext/to-html": "^4.0.1",
77
66
  "@xstate/react": "^6.0.0",
78
67
  "debug": "^4.4.3",
79
68
  "immer": "^10.2.0",
@@ -84,26 +73,26 @@
84
73
  "slate-dom": "^0.118.1",
85
74
  "slate-react": "0.118.2",
86
75
  "xstate": "^5.23.0",
87
- "@portabletext/block-tools": "^3.5.14",
88
- "@portabletext/keyboard-shortcuts": "^1.1.1",
89
- "@portabletext/patches": "^1.1.8",
90
- "@portabletext/schema": "^1.2.0"
76
+ "@portabletext/block-tools": "^4.0.0",
77
+ "@portabletext/keyboard-shortcuts": "^2.0.0",
78
+ "@portabletext/patches": "^2.0.0",
79
+ "@portabletext/schema": "^2.0.0"
91
80
  },
92
81
  "devDependencies": {
93
82
  "@sanity/diff-match-patch": "^3.2.0",
94
- "@sanity/pkg-utils": "^8.1.14",
95
- "@sanity/schema": "^4.12.0",
96
- "@sanity/types": "^4.12.0",
83
+ "@sanity/pkg-utils": "^9.0.1",
84
+ "@sanity/schema": "^4.13.0",
85
+ "@sanity/types": "^4.13.0",
97
86
  "@types/debug": "^4.1.12",
98
87
  "@types/lodash": "^4.17.20",
99
88
  "@types/lodash.startcase": "^4.4.9",
100
89
  "@types/node": "^20",
101
- "@types/react": "^19.2.0",
102
- "@types/react-dom": "^19.2.0",
90
+ "@types/react": "^19.2.2",
91
+ "@types/react-dom": "^19.2.2",
103
92
  "@vitejs/plugin-react": "^5.0.4",
104
- "@vitest/browser": "^4.0.5",
105
- "@vitest/browser-playwright": "^4.0.5",
106
- "@vitest/coverage-istanbul": "^4.0.5",
93
+ "@vitest/browser": "^4.0.6",
94
+ "@vitest/browser-playwright": "^4.0.6",
95
+ "@vitest/coverage-istanbul": "^4.0.6",
107
96
  "babel-plugin-react-compiler": "1.0.0",
108
97
  "eslint": "^9.38.0",
109
98
  "eslint-formatter-gha": "^1.6.0",
@@ -114,17 +103,17 @@
114
103
  "rxjs": "^7.8.2",
115
104
  "typescript": "5.9.3",
116
105
  "typescript-eslint": "^8.46.1",
117
- "vite": "^7.1.10",
118
- "vitest": "^4.0.5",
106
+ "vite": "^7.1.12",
107
+ "vitest": "^4.0.6",
119
108
  "vitest-browser-react": "^2.0.2",
120
- "@portabletext/sanity-bridge": "1.1.17",
109
+ "@portabletext/sanity-bridge": "1.2.0",
121
110
  "@portabletext/test": "^0.0.0",
122
- "racejar": "1.3.2"
111
+ "racejar": "2.0.0"
123
112
  },
124
113
  "peerDependencies": {
125
- "@portabletext/sanity-bridge": "^1.1.17",
126
- "@sanity/schema": "^4.12.0",
127
- "@sanity/types": "^4.12.0",
114
+ "@portabletext/sanity-bridge": "^1.2.0",
115
+ "@sanity/schema": "^4.13.0",
116
+ "@sanity/types": "^4.13.0",
128
117
  "react": "^18.3 || ^19",
129
118
  "rxjs": "^7.8.2"
130
119
  },