@portabletext/editor 2.3.3 → 2.3.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.
Files changed (37) hide show
  1. package/lib/_chunks-dts/behavior.types.action.d.cts +5 -142
  2. package/lib/_chunks-dts/behavior.types.action.d.ts +69 -206
  3. package/lib/index.cjs +43 -279
  4. package/lib/index.cjs.map +1 -1
  5. package/lib/index.js +5 -245
  6. package/lib/index.js.map +1 -1
  7. package/lib/utils/index.d.cts +2 -2
  8. package/package.json +7 -5
  9. package/src/converters/converter.portable-text.deserialize.test.ts +6 -4
  10. package/src/converters/converter.text-html.deserialize.test.ts +15 -15
  11. package/src/converters/converter.text-html.serialize.test.ts +8 -8
  12. package/src/converters/converter.text-plain.test.ts +8 -8
  13. package/src/editor/create-editor.ts +12 -10
  14. package/src/editor/editor-schema.ts +2 -312
  15. package/src/editor/plugins/__tests__/withEditableAPIGetFragment.test.tsx +2 -2
  16. package/src/editor.ts +1 -1
  17. package/src/index.ts +3 -3
  18. package/src/internal-utils/__tests__/values.test.ts +2 -3
  19. package/src/internal-utils/apply-operation-to-portable-text.test.ts +2 -3
  20. package/src/internal-utils/build-index-maps.test.ts +2 -3
  21. package/src/internal-utils/create-test-snapshot.ts +2 -4
  22. package/src/internal-utils/drag-selection.test.ts +2 -5
  23. package/src/internal-utils/operation-to-patches.test.ts +5 -7
  24. package/src/internal-utils/parse-blocks.test.ts +21 -30
  25. package/src/internal-utils/selection-text.ts +2 -3
  26. package/src/internal-utils/terse-pt.test.ts +2 -3
  27. package/src/internal-utils/test-editor.tsx +1 -4
  28. package/src/internal-utils/to-slate-range.test.ts +2 -3
  29. package/src/plugins/plugin.internal.auto-close-brackets.test.tsx +1 -1
  30. package/src/plugins/plugin.markdown.test.tsx +1 -1
  31. package/src/selectors/selector.get-selection-text.test.ts +2 -3
  32. package/src/selectors/selector.get-trimmed-selection.test.ts +2 -3
  33. package/src/utils/util.block-offset.test.ts +2 -3
  34. package/src/utils/util.slice-blocks.test.ts +2 -3
  35. package/src/utils/util.slice-text-block.test.ts +2 -3
  36. package/src/editor/editor-schema-definition.ts +0 -105
  37. package/src/editor/legacy-schema.ts +0 -115
@@ -1,12 +1,14 @@
1
1
  import { Patch, Patch as Patch$1 } from "@portabletext/patches";
2
2
  import * as _sanity_types5 from "@sanity/types";
3
3
  import { ArrayDefinition, ArraySchemaType, BlockDecoratorDefinition, BlockListDefinition, BlockStyleDefinition, ObjectSchemaType, Path, 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, TypedObject } from "@sanity/types";
4
- import * as xstate227 from "xstate";
4
+ import * as _portabletext_schema5 from "@portabletext/schema";
5
+ import { AnnotationDefinition, AnnotationSchemaType, BaseDefinition, BlockObjectDefinition, BlockObjectSchemaType, DecoratorDefinition, DecoratorSchemaType, FieldDefinition, InlineObjectDefinition, InlineObjectSchemaType, ListDefinition, ListSchemaType, Schema, SchemaDefinition, SchemaDefinition as SchemaDefinition$1, StyleDefinition, StyleSchemaType, defineSchema } from "@portabletext/schema";
6
+ import * as xstate241 from "xstate";
5
7
  import { ActorRef, ActorRefFrom, EventObject, Snapshot } from "xstate";
6
8
  import { BaseRange, Descendant, Operation } from "slate";
7
9
  import * as react22 from "react";
8
10
  import React$1, { BaseSyntheticEvent, ClipboardEvent, Component, FocusEvent, JSX, KeyboardEvent as KeyboardEvent$1, MutableRefObject, PropsWithChildren, ReactElement, RefObject, TextareaHTMLAttributes } from "react";
9
- import * as xstate_guards12 from "xstate/guards";
11
+ import * as xstate_guards14 from "xstate/guards";
10
12
  import { Observable, Subject } from "rxjs";
11
13
  import { DOMNode } from "slate-dom";
12
14
  import { ReactEditor } from "slate-react";
@@ -127,146 +129,7 @@ type SlateEditor = {
127
129
  /**
128
130
  * @public
129
131
  */
130
- type BaseDefinition = {
131
- name: string;
132
- title?: string;
133
- };
134
- /**
135
- * @public
136
- */
137
- type FieldDefinition = BaseDefinition & {
138
- type: 'string' | 'number' | 'boolean' | 'array' | 'object';
139
- };
140
- /**
141
- * @public
142
- */
143
- type DecoratorDefinition<TBaseDefinition extends BaseDefinition = BaseDefinition> = TBaseDefinition;
144
- /**
145
- * @public
146
- */
147
- type AnnotationDefinition<TBaseDefinition extends BaseDefinition = BaseDefinition> = TBaseDefinition & {
148
- fields?: ReadonlyArray<FieldDefinition>;
149
- };
150
- /**
151
- * @public
152
- */
153
- type BlockObjectDefinition<TBaseDefinition extends BaseDefinition = BaseDefinition> = TBaseDefinition & {
154
- fields?: ReadonlyArray<FieldDefinition>;
155
- };
156
- /**
157
- * @public
158
- */
159
- type InlineObjectDefinition<TBaseDefinition extends BaseDefinition = BaseDefinition> = TBaseDefinition & {
160
- fields?: ReadonlyArray<FieldDefinition>;
161
- };
162
- /**
163
- * @public
164
- */
165
- type ListDefinition<TBaseDefinition extends BaseDefinition = BaseDefinition> = TBaseDefinition;
166
- /**
167
- * @public
168
- */
169
- type StyleDefinition<TBaseDefinition extends BaseDefinition = BaseDefinition> = TBaseDefinition;
170
- /**
171
- * @public
172
- */
173
- type SchemaDefinition<TBaseDefinition extends BaseDefinition = BaseDefinition> = {
174
- decorators?: ReadonlyArray<DecoratorDefinition<TBaseDefinition>>;
175
- blockObjects?: ReadonlyArray<BlockObjectDefinition<TBaseDefinition>>;
176
- inlineObjects?: ReadonlyArray<InlineObjectDefinition<TBaseDefinition>>;
177
- annotations?: ReadonlyArray<AnnotationDefinition<TBaseDefinition>>;
178
- lists?: ReadonlyArray<ListDefinition<TBaseDefinition>>;
179
- styles?: ReadonlyArray<StyleDefinition<TBaseDefinition>>;
180
- };
181
- /**
182
- * @public
183
- * A helper wrapper that adds editor support, such as autocomplete and type checking, for a schema definition.
184
- * @example
185
- * ```ts
186
- * import { defineSchema } from '@portabletext/editor'
187
- *
188
- * const schemaDefinition = defineSchema({
189
- * decorators: [{name: 'strong'}, {name: 'em'}, {name: 'underline'}],
190
- * annotations: [{name: 'link'}],
191
- * styles: [
192
- * {name: 'normal'},
193
- * {name: 'h1'},
194
- * {name: 'h2'},
195
- * {name: 'h3'},
196
- * {name: 'blockquote'},
197
- * ],
198
- * lists: [],
199
- * inlineObjects: [],
200
- * blockObjects: [],
201
- * }
202
- * ```
203
- */
204
- declare function defineSchema<const TSchemaDefinition extends SchemaDefinition>(definition: TSchemaDefinition): TSchemaDefinition;
205
- /**
206
- * @public
207
- */
208
- type EditorSchema = {
209
- annotations: ReadonlyArray<AnnotationSchemaType>;
210
- block: {
211
- name: string;
212
- };
213
- blockObjects: ReadonlyArray<BlockObjectSchemaType>;
214
- decorators: ReadonlyArray<DecoratorSchemaType>;
215
- inlineObjects: ReadonlyArray<InlineObjectSchemaType>;
216
- span: {
217
- name: string;
218
- };
219
- styles: ReadonlyArray<StyleSchemaType>;
220
- lists: ReadonlyArray<ListSchemaType>;
221
- };
222
- /**
223
- * @public
224
- */
225
- type AnnotationSchemaType = BaseDefinition & {
226
- fields: ReadonlyArray<FieldDefinition>;
227
- };
228
- /**
229
- * @public
230
- */
231
- type BlockObjectSchemaType = BaseDefinition & {
232
- fields: ReadonlyArray<FieldDefinition>;
233
- };
234
- /**
235
- * @public
236
- */
237
- type DecoratorSchemaType = BaseDefinition & {
238
- /**
239
- * @deprecated
240
- * Use `name` instead
241
- */
242
- value: string;
243
- };
244
- /**
245
- * @public
246
- */
247
- type InlineObjectSchemaType = BaseDefinition & {
248
- fields: ReadonlyArray<FieldDefinition>;
249
- };
250
- /**
251
- * @public
252
- */
253
- type ListSchemaType = BaseDefinition & {
254
- /**
255
- * @deprecated
256
- * Use `name` instead
257
- */
258
- value: string;
259
- };
260
- /**
261
- * @public
262
- */
263
- type StyleSchemaType = BaseDefinition & {
264
- /**
265
- * @deprecated
266
- * Use `name` instead
267
- */
268
- value: string;
269
- };
132
+ type EditorSchema = Schema;
270
133
  type InternalEditor = Editor & {
271
134
  _internal: {
272
135
  editable: EditableAPI;
@@ -1313,7 +1176,7 @@ type EditorActor = ActorRefFrom<typeof editorMachine>;
1313
1176
  /**
1314
1177
  * @internal
1315
1178
  */
1316
- declare const editorMachine: xstate227.StateMachine<{
1179
+ declare const editorMachine: xstate241.StateMachine<{
1317
1180
  behaviors: Set<BehaviorConfig>;
1318
1181
  behaviorsSorted: boolean;
1319
1182
  converters: Set<Converter>;
@@ -1331,7 +1194,7 @@ declare const editorMachine: xstate227.StateMachine<{
1331
1194
  };
1332
1195
  dragGhost?: HTMLElement;
1333
1196
  slateEditor?: PortableTextSlateEditor;
1334
- }, InternalPatchEvent | MutationEvent | PatchesEvent | {
1197
+ }, MutationEvent | InternalPatchEvent | PatchesEvent | {
1335
1198
  type: "update readOnly";
1336
1199
  readOnly: boolean;
1337
1200
  } | {
@@ -1378,58 +1241,58 @@ declare const editorMachine: xstate227.StateMachine<{
1378
1241
  type: "dragend";
1379
1242
  } | {
1380
1243
  type: "drop";
1381
- }, {}, never, xstate227.Values<{
1244
+ }, {}, never, xstate241.Values<{
1382
1245
  "add behavior to context": {
1383
1246
  type: "add behavior to context";
1384
- params: xstate227.NonReducibleUnknown;
1247
+ params: xstate241.NonReducibleUnknown;
1385
1248
  };
1386
1249
  "remove behavior from context": {
1387
1250
  type: "remove behavior from context";
1388
- params: xstate227.NonReducibleUnknown;
1251
+ params: xstate241.NonReducibleUnknown;
1389
1252
  };
1390
1253
  "emit patch event": {
1391
1254
  type: "emit patch event";
1392
- params: xstate227.NonReducibleUnknown;
1255
+ params: xstate241.NonReducibleUnknown;
1393
1256
  };
1394
1257
  "emit mutation event": {
1395
1258
  type: "emit mutation event";
1396
- params: xstate227.NonReducibleUnknown;
1259
+ params: xstate241.NonReducibleUnknown;
1397
1260
  };
1398
1261
  "emit read only": {
1399
1262
  type: "emit read only";
1400
- params: xstate227.NonReducibleUnknown;
1263
+ params: xstate241.NonReducibleUnknown;
1401
1264
  };
1402
1265
  "emit editable": {
1403
1266
  type: "emit editable";
1404
- params: xstate227.NonReducibleUnknown;
1267
+ params: xstate241.NonReducibleUnknown;
1405
1268
  };
1406
1269
  "defer event": {
1407
1270
  type: "defer event";
1408
- params: xstate227.NonReducibleUnknown;
1271
+ params: xstate241.NonReducibleUnknown;
1409
1272
  };
1410
1273
  "emit pending events": {
1411
1274
  type: "emit pending events";
1412
- params: xstate227.NonReducibleUnknown;
1275
+ params: xstate241.NonReducibleUnknown;
1413
1276
  };
1414
1277
  "emit ready": {
1415
1278
  type: "emit ready";
1416
- params: xstate227.NonReducibleUnknown;
1279
+ params: xstate241.NonReducibleUnknown;
1417
1280
  };
1418
1281
  "clear pending events": {
1419
1282
  type: "clear pending events";
1420
- params: xstate227.NonReducibleUnknown;
1283
+ params: xstate241.NonReducibleUnknown;
1421
1284
  };
1422
1285
  "defer incoming patches": {
1423
1286
  type: "defer incoming patches";
1424
- params: xstate227.NonReducibleUnknown;
1287
+ params: xstate241.NonReducibleUnknown;
1425
1288
  };
1426
1289
  "emit pending incoming patches": {
1427
1290
  type: "emit pending incoming patches";
1428
- params: xstate227.NonReducibleUnknown;
1291
+ params: xstate241.NonReducibleUnknown;
1429
1292
  };
1430
1293
  "clear pending incoming patches": {
1431
1294
  type: "clear pending incoming patches";
1432
- params: xstate227.NonReducibleUnknown;
1295
+ params: xstate241.NonReducibleUnknown;
1433
1296
  };
1434
1297
  "handle blur": {
1435
1298
  type: "handle blur";
@@ -1445,7 +1308,7 @@ declare const editorMachine: xstate227.StateMachine<{
1445
1308
  };
1446
1309
  "sort behaviors": {
1447
1310
  type: "sort behaviors";
1448
- params: xstate227.NonReducibleUnknown;
1311
+ params: xstate241.NonReducibleUnknown;
1449
1312
  };
1450
1313
  }>, {
1451
1314
  type: "slate is busy";
@@ -1474,7 +1337,7 @@ declare const editorMachine: xstate227.StateMachine<{
1474
1337
  readOnly?: boolean;
1475
1338
  schema: EditorSchema;
1476
1339
  initialValue?: Array<PortableTextBlock>;
1477
- }, xstate227.NonReducibleUnknown, InternalPatchEvent | MutationEvent | PatchesEvent | {
1340
+ }, xstate241.NonReducibleUnknown, {
1478
1341
  type: "blurred";
1479
1342
  event: react22.FocusEvent<HTMLDivElement, Element>;
1480
1343
  } | {
@@ -1495,7 +1358,7 @@ declare const editorMachine: xstate227.StateMachine<{
1495
1358
  value: Array<PortableTextBlock> | undefined;
1496
1359
  } | {
1497
1360
  type: "loading";
1498
- } | {
1361
+ } | MutationEvent | {
1499
1362
  type: "read only";
1500
1363
  } | {
1501
1364
  type: "ready";
@@ -1505,19 +1368,19 @@ declare const editorMachine: xstate227.StateMachine<{
1505
1368
  } | {
1506
1369
  type: "value changed";
1507
1370
  value: Array<PortableTextBlock> | undefined;
1508
- }, xstate227.MetaObject, {
1371
+ } | InternalPatchEvent | PatchesEvent, xstate241.MetaObject, {
1509
1372
  readonly id: "editor";
1510
1373
  readonly context: ({
1511
1374
  input
1512
1375
  }: {
1513
1376
  spawn: {
1514
- <TSrc extends never>(logic: TSrc, ...[options]: never): xstate227.ActorRefFromLogic<never>;
1515
- <TLogic extends xstate227.AnyActorLogic>(src: TLogic, ...[options]: xstate227.ConditionalRequired<[options?: ({
1377
+ <TSrc extends never>(logic: TSrc, ...[options]: never): xstate241.ActorRefFromLogic<never>;
1378
+ <TLogic extends xstate241.AnyActorLogic>(src: TLogic, ...[options]: xstate241.ConditionalRequired<[options?: ({
1516
1379
  id?: never;
1517
1380
  systemId?: string;
1518
- input?: xstate227.InputFrom<TLogic> | undefined;
1381
+ input?: xstate241.InputFrom<TLogic> | undefined;
1519
1382
  syncSnapshot?: boolean;
1520
- } & { [K in xstate227.RequiredLogicInput<TLogic>]: unknown }) | undefined], xstate227.IsNotNever<xstate227.RequiredLogicInput<TLogic>>>): xstate227.ActorRefFromLogic<TLogic>;
1383
+ } & { [K in xstate241.RequiredLogicInput<TLogic>]: unknown }) | undefined], xstate241.IsNotNever<xstate241.RequiredLogicInput<TLogic>>>): xstate241.ActorRefFromLogic<TLogic>;
1521
1384
  };
1522
1385
  input: {
1523
1386
  converters?: Array<Converter>;
@@ -1528,7 +1391,7 @@ declare const editorMachine: xstate227.StateMachine<{
1528
1391
  schema: EditorSchema;
1529
1392
  initialValue?: Array<PortableTextBlock>;
1530
1393
  };
1531
- self: xstate227.ActorRef<xstate227.MachineSnapshot<{
1394
+ self: xstate241.ActorRef<xstate241.MachineSnapshot<{
1532
1395
  behaviors: Set<BehaviorConfig>;
1533
1396
  behaviorsSorted: boolean;
1534
1397
  converters: Set<Converter>;
@@ -1546,7 +1409,7 @@ declare const editorMachine: xstate227.StateMachine<{
1546
1409
  };
1547
1410
  dragGhost?: HTMLElement;
1548
1411
  slateEditor?: PortableTextSlateEditor;
1549
- }, InternalPatchEvent | MutationEvent | PatchesEvent | {
1412
+ }, MutationEvent | InternalPatchEvent | PatchesEvent | {
1550
1413
  type: "update readOnly";
1551
1414
  readOnly: boolean;
1552
1415
  } | {
@@ -1593,7 +1456,7 @@ declare const editorMachine: xstate227.StateMachine<{
1593
1456
  type: "dragend";
1594
1457
  } | {
1595
1458
  type: "drop";
1596
- }, Record<string, xstate227.AnyActorRef | undefined>, xstate227.StateValue, string, unknown, any, any>, InternalPatchEvent | MutationEvent | PatchesEvent | {
1459
+ }, Record<string, xstate241.AnyActorRef | undefined>, xstate241.StateValue, string, unknown, any, any>, MutationEvent | InternalPatchEvent | PatchesEvent | {
1597
1460
  type: "update readOnly";
1598
1461
  readOnly: boolean;
1599
1462
  } | {
@@ -1640,10 +1503,10 @@ declare const editorMachine: xstate227.StateMachine<{
1640
1503
  type: "dragend";
1641
1504
  } | {
1642
1505
  type: "drop";
1643
- }, xstate227.AnyEventObject>;
1506
+ }, xstate241.AnyEventObject>;
1644
1507
  }) => {
1645
1508
  behaviors: Set<{
1646
- 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.inline object" | "insert.block" | "insert.span" | "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" | "deserialization.success" | "deserialization.failure" | "insert.blocks" | "insert.break" | "insert.soft break" | "list item.add" | "list item.remove" | "list item.toggle" | "move.block down" | "move.block up" | "select.previous block" | "select.next block" | "serialize" | "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" | "style.*" | "history.*" | "split.*" | "delete.*" | "select.*" | "deserialize.*" | "serialize.*" | "annotation.*" | "block.*" | "child.*" | "decorator.*" | "insert.*" | "move.*" | "deserialization.*" | "list item.*" | "serialization.*" | "clipboard.*" | "drag.*" | "keyboard.*" | "mouse.*", true, {
1509
+ 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.inline object" | "insert.block" | "insert.span" | "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" | "deserialization.success" | "deserialization.failure" | "insert.blocks" | "insert.break" | "insert.soft break" | "list item.add" | "list item.remove" | "list item.toggle" | "move.block down" | "move.block up" | "select.previous block" | "select.next block" | "serialize" | "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.*" | "style.*" | "delete.*" | "select.*" | "deserialize.*" | "serialize.*" | "annotation.*" | "block.*" | "child.*" | "decorator.*" | "insert.*" | "move.*" | "deserialization.*" | "list item.*" | "serialization.*" | "clipboard.*" | "drag.*" | "keyboard.*" | "mouse.*", true, {
1647
1510
  type: StrictExtract<"split" | "annotation.add" | "annotation.remove" | "block.set" | "block.unset" | "child.set" | "child.unset" | "decorator.add" | "decorator.remove" | "delete" | "history.redo" | "history.undo" | "insert.inline object" | "insert.block" | "insert.span" | "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" | "deserialization.success" | "deserialization.failure" | "insert.blocks" | "insert.break" | "insert.soft break" | "list item.add" | "list item.remove" | "list item.toggle" | "move.block down" | "move.block up" | "select.previous block" | "select.next block" | "serialize" | "serialization.success" | "serialization.failure" | "style.add" | "style.remove" | "style.toggle", "annotation.add">;
1648
1511
  annotation: {
1649
1512
  name: string;
@@ -1912,7 +1775,7 @@ declare const editorMachine: xstate227.StateMachine<{
1912
1775
  keyGenerator: () => string;
1913
1776
  pendingEvents: never[];
1914
1777
  pendingIncomingPatchesEvents: never[];
1915
- schema: EditorSchema;
1778
+ schema: _portabletext_schema5.Schema;
1916
1779
  selection: null;
1917
1780
  initialReadOnly: boolean;
1918
1781
  maxBlocks: number | undefined;
@@ -1926,7 +1789,7 @@ declare const editorMachine: xstate227.StateMachine<{
1926
1789
  readonly actions: "remove behavior from context";
1927
1790
  };
1928
1791
  readonly 'update maxBlocks': {
1929
- readonly actions: xstate227.ActionFunction<{
1792
+ readonly actions: xstate241.ActionFunction<{
1930
1793
  behaviors: Set<BehaviorConfig>;
1931
1794
  behaviorsSorted: boolean;
1932
1795
  converters: Set<Converter>;
@@ -1947,7 +1810,7 @@ declare const editorMachine: xstate227.StateMachine<{
1947
1810
  }, {
1948
1811
  type: "update maxBlocks";
1949
1812
  maxBlocks: number | undefined;
1950
- }, InternalPatchEvent | MutationEvent | PatchesEvent | {
1813
+ }, MutationEvent | InternalPatchEvent | PatchesEvent | {
1951
1814
  type: "update readOnly";
1952
1815
  readOnly: boolean;
1953
1816
  } | {
@@ -1997,7 +1860,7 @@ declare const editorMachine: xstate227.StateMachine<{
1997
1860
  }, undefined, never, never, never, never, never>;
1998
1861
  };
1999
1862
  readonly 'update selection': {
2000
- readonly actions: readonly [xstate227.ActionFunction<{
1863
+ readonly actions: readonly [xstate241.ActionFunction<{
2001
1864
  behaviors: Set<BehaviorConfig>;
2002
1865
  behaviorsSorted: boolean;
2003
1866
  converters: Set<Converter>;
@@ -2018,7 +1881,7 @@ declare const editorMachine: xstate227.StateMachine<{
2018
1881
  }, {
2019
1882
  type: "update selection";
2020
1883
  selection: EditorSelection;
2021
- }, InternalPatchEvent | MutationEvent | PatchesEvent | {
1884
+ }, MutationEvent | InternalPatchEvent | PatchesEvent | {
2022
1885
  type: "update readOnly";
2023
1886
  readOnly: boolean;
2024
1887
  } | {
@@ -2065,7 +1928,7 @@ declare const editorMachine: xstate227.StateMachine<{
2065
1928
  type: "dragend";
2066
1929
  } | {
2067
1930
  type: "drop";
2068
- }, undefined, never, never, never, never, never>, xstate227.ActionFunction<{
1931
+ }, undefined, never, never, never, never, never>, xstate241.ActionFunction<{
2069
1932
  behaviors: Set<BehaviorConfig>;
2070
1933
  behaviorsSorted: boolean;
2071
1934
  converters: Set<Converter>;
@@ -2086,7 +1949,7 @@ declare const editorMachine: xstate227.StateMachine<{
2086
1949
  }, {
2087
1950
  type: "update selection";
2088
1951
  selection: EditorSelection;
2089
- }, InternalPatchEvent | MutationEvent | PatchesEvent | {
1952
+ }, MutationEvent | InternalPatchEvent | PatchesEvent | {
2090
1953
  type: "update readOnly";
2091
1954
  readOnly: boolean;
2092
1955
  } | {
@@ -2133,7 +1996,7 @@ declare const editorMachine: xstate227.StateMachine<{
2133
1996
  type: "dragend";
2134
1997
  } | {
2135
1998
  type: "drop";
2136
- }, undefined, never, never, never, never, InternalPatchEvent | MutationEvent | PatchesEvent | {
1999
+ }, undefined, never, never, never, never, {
2137
2000
  type: "blurred";
2138
2001
  event: react22.FocusEvent<HTMLDivElement, Element>;
2139
2002
  } | {
@@ -2154,7 +2017,7 @@ declare const editorMachine: xstate227.StateMachine<{
2154
2017
  value: Array<PortableTextBlock> | undefined;
2155
2018
  } | {
2156
2019
  type: "loading";
2157
- } | {
2020
+ } | MutationEvent | {
2158
2021
  type: "read only";
2159
2022
  } | {
2160
2023
  type: "ready";
@@ -2164,10 +2027,10 @@ declare const editorMachine: xstate227.StateMachine<{
2164
2027
  } | {
2165
2028
  type: "value changed";
2166
2029
  value: Array<PortableTextBlock> | undefined;
2167
- }>];
2030
+ } | InternalPatchEvent | PatchesEvent>];
2168
2031
  };
2169
2032
  readonly 'set drag ghost': {
2170
- readonly actions: xstate227.ActionFunction<{
2033
+ readonly actions: xstate241.ActionFunction<{
2171
2034
  behaviors: Set<BehaviorConfig>;
2172
2035
  behaviorsSorted: boolean;
2173
2036
  converters: Set<Converter>;
@@ -2188,7 +2051,7 @@ declare const editorMachine: xstate227.StateMachine<{
2188
2051
  }, {
2189
2052
  type: "set drag ghost";
2190
2053
  ghost: HTMLElement;
2191
- }, InternalPatchEvent | MutationEvent | PatchesEvent | {
2054
+ }, MutationEvent | InternalPatchEvent | PatchesEvent | {
2192
2055
  type: "update readOnly";
2193
2056
  readOnly: boolean;
2194
2057
  } | {
@@ -2250,7 +2113,7 @@ declare const editorMachine: xstate227.StateMachine<{
2250
2113
  readonly actions: readonly ["sort behaviors", "handle behavior event"];
2251
2114
  readonly guard: ({
2252
2115
  event
2253
- }: xstate_guards12.GuardArgs<{
2116
+ }: xstate_guards14.GuardArgs<{
2254
2117
  behaviors: Set<BehaviorConfig>;
2255
2118
  behaviorsSorted: boolean;
2256
2119
  converters: Set<Converter>;
@@ -2287,7 +2150,7 @@ declare const editorMachine: xstate227.StateMachine<{
2287
2150
  readonly target: "#editor.edit mode.read only.read only";
2288
2151
  readonly guard: ({
2289
2152
  context
2290
- }: xstate_guards12.GuardArgs<{
2153
+ }: xstate_guards14.GuardArgs<{
2291
2154
  behaviors: Set<BehaviorConfig>;
2292
2155
  behaviorsSorted: boolean;
2293
2156
  converters: Set<Converter>;
@@ -2320,7 +2183,7 @@ declare const editorMachine: xstate227.StateMachine<{
2320
2183
  readonly 'update readOnly': {
2321
2184
  readonly guard: ({
2322
2185
  event
2323
- }: xstate_guards12.GuardArgs<{
2186
+ }: xstate_guards14.GuardArgs<{
2324
2187
  behaviors: Set<BehaviorConfig>;
2325
2188
  behaviorsSorted: boolean;
2326
2189
  converters: Set<Converter>;
@@ -2354,7 +2217,7 @@ declare const editorMachine: xstate227.StateMachine<{
2354
2217
  readonly 'update readOnly': {
2355
2218
  readonly guard: ({
2356
2219
  event
2357
- }: xstate_guards12.GuardArgs<{
2220
+ }: xstate_guards14.GuardArgs<{
2358
2221
  behaviors: Set<BehaviorConfig>;
2359
2222
  behaviorsSorted: boolean;
2360
2223
  converters: Set<Converter>;
@@ -2387,7 +2250,7 @@ declare const editorMachine: xstate227.StateMachine<{
2387
2250
  };
2388
2251
  readonly focus: {
2389
2252
  readonly target: ".focusing";
2390
- readonly actions: readonly [xstate227.ActionFunction<{
2253
+ readonly actions: readonly [xstate241.ActionFunction<{
2391
2254
  behaviors: Set<BehaviorConfig>;
2392
2255
  behaviorsSorted: boolean;
2393
2256
  converters: Set<Converter>;
@@ -2408,7 +2271,7 @@ declare const editorMachine: xstate227.StateMachine<{
2408
2271
  }, {
2409
2272
  type: "focus";
2410
2273
  editor: PortableTextSlateEditor;
2411
- }, InternalPatchEvent | MutationEvent | PatchesEvent | {
2274
+ }, MutationEvent | InternalPatchEvent | PatchesEvent | {
2412
2275
  type: "update readOnly";
2413
2276
  readOnly: boolean;
2414
2277
  } | {
@@ -2465,7 +2328,7 @@ declare const editorMachine: xstate227.StateMachine<{
2465
2328
  readonly exit: readonly [() => void];
2466
2329
  readonly on: {
2467
2330
  readonly dragstart: {
2468
- readonly actions: readonly [xstate227.ActionFunction<{
2331
+ readonly actions: readonly [xstate241.ActionFunction<{
2469
2332
  behaviors: Set<BehaviorConfig>;
2470
2333
  behaviorsSorted: boolean;
2471
2334
  converters: Set<Converter>;
@@ -2487,7 +2350,7 @@ declare const editorMachine: xstate227.StateMachine<{
2487
2350
  type: "dragstart";
2488
2351
  ghost?: HTMLElement;
2489
2352
  origin: Pick<EventPosition, "selection">;
2490
- }, InternalPatchEvent | MutationEvent | PatchesEvent | {
2353
+ }, MutationEvent | InternalPatchEvent | PatchesEvent | {
2491
2354
  type: "update readOnly";
2492
2355
  readOnly: boolean;
2493
2356
  } | {
@@ -2568,7 +2431,7 @@ declare const editorMachine: xstate227.StateMachine<{
2568
2431
  readonly entry: readonly [() => void];
2569
2432
  readonly exit: readonly [() => void, ({
2570
2433
  context
2571
- }: xstate227.ActionArgs<{
2434
+ }: xstate241.ActionArgs<{
2572
2435
  behaviors: Set<BehaviorConfig>;
2573
2436
  behaviorsSorted: boolean;
2574
2437
  converters: Set<Converter>;
@@ -2586,7 +2449,7 @@ declare const editorMachine: xstate227.StateMachine<{
2586
2449
  };
2587
2450
  dragGhost?: HTMLElement;
2588
2451
  slateEditor?: PortableTextSlateEditor;
2589
- }, InternalPatchEvent | MutationEvent | PatchesEvent | {
2452
+ }, MutationEvent | InternalPatchEvent | PatchesEvent | {
2590
2453
  type: "update readOnly";
2591
2454
  readOnly: boolean;
2592
2455
  } | {
@@ -2633,7 +2496,7 @@ declare const editorMachine: xstate227.StateMachine<{
2633
2496
  type: "dragend";
2634
2497
  } | {
2635
2498
  type: "drop";
2636
- }, InternalPatchEvent | MutationEvent | PatchesEvent | {
2499
+ }, MutationEvent | InternalPatchEvent | PatchesEvent | {
2637
2500
  type: "update readOnly";
2638
2501
  readOnly: boolean;
2639
2502
  } | {
@@ -2680,7 +2543,7 @@ declare const editorMachine: xstate227.StateMachine<{
2680
2543
  type: "dragend";
2681
2544
  } | {
2682
2545
  type: "drop";
2683
- }>) => void, xstate227.ActionFunction<{
2546
+ }>) => void, xstate241.ActionFunction<{
2684
2547
  behaviors: Set<BehaviorConfig>;
2685
2548
  behaviorsSorted: boolean;
2686
2549
  converters: Set<Converter>;
@@ -2698,7 +2561,7 @@ declare const editorMachine: xstate227.StateMachine<{
2698
2561
  };
2699
2562
  dragGhost?: HTMLElement;
2700
2563
  slateEditor?: PortableTextSlateEditor;
2701
- }, InternalPatchEvent | MutationEvent | PatchesEvent | {
2564
+ }, MutationEvent | InternalPatchEvent | PatchesEvent | {
2702
2565
  type: "update readOnly";
2703
2566
  readOnly: boolean;
2704
2567
  } | {
@@ -2745,7 +2608,7 @@ declare const editorMachine: xstate227.StateMachine<{
2745
2608
  type: "dragend";
2746
2609
  } | {
2747
2610
  type: "drop";
2748
- }, InternalPatchEvent | MutationEvent | PatchesEvent | {
2611
+ }, MutationEvent | InternalPatchEvent | PatchesEvent | {
2749
2612
  type: "update readOnly";
2750
2613
  readOnly: boolean;
2751
2614
  } | {
@@ -2792,7 +2655,7 @@ declare const editorMachine: xstate227.StateMachine<{
2792
2655
  type: "dragend";
2793
2656
  } | {
2794
2657
  type: "drop";
2795
- }, undefined, never, never, never, never, never>, xstate227.ActionFunction<{
2658
+ }, undefined, never, never, never, never, never>, xstate241.ActionFunction<{
2796
2659
  behaviors: Set<BehaviorConfig>;
2797
2660
  behaviorsSorted: boolean;
2798
2661
  converters: Set<Converter>;
@@ -2810,7 +2673,7 @@ declare const editorMachine: xstate227.StateMachine<{
2810
2673
  };
2811
2674
  dragGhost?: HTMLElement;
2812
2675
  slateEditor?: PortableTextSlateEditor;
2813
- }, InternalPatchEvent | MutationEvent | PatchesEvent | {
2676
+ }, MutationEvent | InternalPatchEvent | PatchesEvent | {
2814
2677
  type: "update readOnly";
2815
2678
  readOnly: boolean;
2816
2679
  } | {
@@ -2857,7 +2720,7 @@ declare const editorMachine: xstate227.StateMachine<{
2857
2720
  type: "dragend";
2858
2721
  } | {
2859
2722
  type: "drop";
2860
- }, InternalPatchEvent | MutationEvent | PatchesEvent | {
2723
+ }, MutationEvent | InternalPatchEvent | PatchesEvent | {
2861
2724
  type: "update readOnly";
2862
2725
  readOnly: boolean;
2863
2726
  } | {
@@ -2951,7 +2814,7 @@ declare const editorMachine: xstate227.StateMachine<{
2951
2814
  readonly exit: readonly [() => void];
2952
2815
  readonly on: {
2953
2816
  readonly patches: {
2954
- readonly actions: readonly [xstate227.ActionFunction<{
2817
+ readonly actions: readonly [xstate241.ActionFunction<{
2955
2818
  behaviors: Set<BehaviorConfig>;
2956
2819
  behaviorsSorted: boolean;
2957
2820
  converters: Set<Converter>;
@@ -2969,7 +2832,7 @@ declare const editorMachine: xstate227.StateMachine<{
2969
2832
  };
2970
2833
  dragGhost?: HTMLElement;
2971
2834
  slateEditor?: PortableTextSlateEditor;
2972
- }, PatchesEvent, InternalPatchEvent | MutationEvent | PatchesEvent | {
2835
+ }, PatchesEvent, MutationEvent | InternalPatchEvent | PatchesEvent | {
2973
2836
  type: "update readOnly";
2974
2837
  readOnly: boolean;
2975
2838
  } | {
@@ -3016,7 +2879,7 @@ declare const editorMachine: xstate227.StateMachine<{
3016
2879
  type: "dragend";
3017
2880
  } | {
3018
2881
  type: "drop";
3019
- }, undefined, never, never, never, never, InternalPatchEvent | MutationEvent | PatchesEvent | {
2882
+ }, undefined, never, never, never, never, {
3020
2883
  type: "blurred";
3021
2884
  event: react22.FocusEvent<HTMLDivElement, Element>;
3022
2885
  } | {
@@ -3037,7 +2900,7 @@ declare const editorMachine: xstate227.StateMachine<{
3037
2900
  value: Array<PortableTextBlock> | undefined;
3038
2901
  } | {
3039
2902
  type: "loading";
3040
- } | {
2903
+ } | MutationEvent | {
3041
2904
  type: "read only";
3042
2905
  } | {
3043
2906
  type: "ready";
@@ -3047,7 +2910,7 @@ declare const editorMachine: xstate227.StateMachine<{
3047
2910
  } | {
3048
2911
  type: "value changed";
3049
2912
  value: Array<PortableTextBlock> | undefined;
3050
- }>];
2913
+ } | InternalPatchEvent | PatchesEvent>];
3051
2914
  };
3052
2915
  readonly 'syncing value': {
3053
2916
  readonly target: "syncing value";
@@ -3747,4 +3610,4 @@ type BehaviorActionSet<TBehaviorEvent, TGuardResponse> = (payload: {
3747
3610
  event: TBehaviorEvent;
3748
3611
  dom: EditorDom;
3749
3612
  }, guardResponse: TGuardResponse) => Array<BehaviorAction>;
3750
- 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$1 as PortableTextObject, type PortableTextSpan$1 as PortableTextSpan, type PortableTextTextBlock$1 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, 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 };
3613
+ 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$1 as PortableTextObject, type PortableTextSpan$1 as PortableTextSpan, type PortableTextTextBlock$1 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 };