@portabletext/editor 1.48.8 → 1.48.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.d.cts CHANGED
@@ -1,8 +1,22 @@
1
1
  import {Patch} from '@portabletext/patches'
2
- import {ClientPerspective, SanityClient} from '@sanity/client'
2
+ import type {
3
+ ArrayDefinition,
4
+ ArraySchemaType,
5
+ BlockDecoratorDefinition,
6
+ BlockListDefinition,
7
+ BlockStyleDefinition,
8
+ KeyedSegment,
9
+ ObjectSchemaType,
10
+ Path,
11
+ PortableTextListBlock,
12
+ PortableTextObject,
13
+ TypedObject,
14
+ } from '@sanity/types'
3
15
  import {
4
- PortableTextSpan as PortableTextSpan_2,
5
- PortableTextTextBlock as PortableTextTextBlock_2,
16
+ PortableTextBlock,
17
+ PortableTextChild,
18
+ PortableTextSpan,
19
+ PortableTextTextBlock,
6
20
  } from '@sanity/types'
7
21
  import type {
8
22
  BaseSyntheticEvent,
@@ -14,14 +28,11 @@ import type {
14
28
  } from 'react'
15
29
  import {
16
30
  Component,
17
- ComponentType,
18
- ElementType,
19
31
  ForwardRefExoticComponent,
20
32
  JSX,
21
33
  MutableRefObject,
22
34
  PropsWithChildren,
23
35
  default as React_2,
24
- ReactNode,
25
36
  RefAttributes,
26
37
  TextareaHTMLAttributes,
27
38
  } from 'react'
@@ -243,277 +254,6 @@ export declare type AddedAnnotationPaths = {
243
254
  spanPath: Path
244
255
  }
245
256
 
246
- /**
247
- * Types of array actions that can be performed
248
- * @beta
249
- */
250
- declare type ArrayActionName =
251
- /**
252
- * Add any item to the array at any position
253
- */
254
- | 'add'
255
- /**
256
- * Add item after an existing item
257
- */
258
- | 'addBefore'
259
- /**
260
- * Add item after an existing item
261
- */
262
- | 'addAfter'
263
- /**
264
- * Remove any item
265
- */
266
- | 'remove'
267
- /**
268
- * Duplicate item
269
- */
270
- | 'duplicate'
271
- /**
272
- * Copy item
273
- */
274
- | 'copy'
275
-
276
- /** @public */
277
- declare interface ArrayDefinition extends BaseSchemaDefinition {
278
- type: 'array'
279
- of: ArrayOfType[]
280
- initialValue?: InitialValueProperty<any, unknown[]>
281
- validation?: ValidationBuilder<ArrayRule<unknown[]>, unknown[]>
282
- options?: ArrayOptions
283
- }
284
-
285
- /** @public */
286
- declare type ArrayOfEntry<T> = Omit<T, 'name' | 'hidden'> & {
287
- name?: string
288
- }
289
-
290
- /** @public */
291
- declare type ArrayOfType<
292
- TType extends IntrinsicTypeName = IntrinsicTypeName,
293
- TAlias extends IntrinsicTypeName | undefined = undefined,
294
- > =
295
- | IntrinsicArrayOfDefinition[TType]
296
- | ArrayOfEntry<TypeAliasDefinition<string, TAlias>>
297
-
298
- /** @public */
299
- declare interface ArrayOptions<V = unknown>
300
- extends SearchConfiguration,
301
- BaseSchemaTypeOptions {
302
- list?: TitledListValue<V>[] | V[]
303
- layout?: 'list' | 'tags' | 'grid'
304
- /** @deprecated This option does not have any effect anymore */
305
- direction?: 'horizontal' | 'vertical'
306
- sortable?: boolean
307
- modal?: {
308
- type?: 'dialog' | 'popover'
309
- width?: number | 'auto'
310
- }
311
- /** @alpha This API may change */
312
- insertMenu?: InsertMenuOptions
313
- /**
314
- * A boolean flag to enable or disable tree editing for the array.
315
- * If there are any nested arrays, they will inherit this value.
316
- * @deprecated tree editing beta feature has been disabled
317
- */
318
- treeEditing?: boolean
319
- /**
320
- * A list of array actions to disable
321
- * Possible options are defined by {@link ArrayActionName}
322
- * @beta
323
- */
324
- disableActions?: ArrayActionName[]
325
- }
326
-
327
- /** @public */
328
- declare interface ArrayRule<Value> extends RuleDef<ArrayRule<Value>, Value> {
329
- min: (length: number | FieldReference) => ArrayRule<Value>
330
- max: (length: number | FieldReference) => ArrayRule<Value>
331
- length: (length: number | FieldReference) => ArrayRule<Value>
332
- unique: () => ArrayRule<Value>
333
- }
334
-
335
- /** @public */
336
- declare interface ArraySchemaType<V = unknown> extends BaseSchemaType {
337
- jsonType: 'array'
338
- of: (Exclude<SchemaType, ArraySchemaType> | ReferenceSchemaType)[]
339
- options?: ArrayOptions<V> & {
340
- layout?: V extends string ? 'tag' : 'grid'
341
- }
342
- }
343
-
344
- /** @public */
345
- declare interface Asset extends SanityDocument {
346
- url: string
347
- path: string
348
- assetId: string
349
- extension: string
350
- mimeType: string
351
- sha1hash: string
352
- size: number
353
- originalFilename?: string
354
- label?: string
355
- title?: string
356
- description?: string
357
- creditLine?: string
358
- source?: AssetSourceSpec
359
- }
360
-
361
- /** @public */
362
- declare type AssetFromSource = {
363
- kind: 'assetDocumentId' | 'file' | 'base64' | 'url'
364
- value: string | File_2
365
- assetDocumentProps?: ImageAsset
366
- mediaLibraryProps?: {
367
- mediaLibraryId: string
368
- assetId: string
369
- assetInstanceId: string
370
- }
371
- }
372
-
373
- /** @public */
374
- declare interface AssetSource {
375
- name: string
376
- /** @deprecated provide `i18nKey` instead */
377
- title?: string
378
- i18nKey?: string
379
- component: ComponentType<AssetSourceComponentProps>
380
- icon?: ComponentType<EmptyProps>
381
- /** @beta */
382
- uploader?: AssetSourceUploader
383
- }
384
-
385
- /** @public */
386
- declare interface AssetSourceComponentProps {
387
- action?: 'select' | 'upload'
388
- assetSource: AssetSource
389
- assetType?: 'file' | 'image'
390
- accept: string
391
- selectionType: 'single'
392
- dialogHeaderTitle?: React.ReactNode
393
- selectedAssets: Asset[]
394
- onClose: () => void
395
- onSelect: (assetFromSource: AssetFromSource[]) => void
396
- }
397
-
398
- /** @public */
399
- declare interface AssetSourceSpec {
400
- id: string
401
- name: string
402
- url?: string
403
- }
404
-
405
- /** @beta */
406
- declare interface AssetSourceUploader {
407
- upload(
408
- files: globalThis.File[],
409
- options?: {
410
- /**
411
- * The schema type of the field the asset is being uploaded to.
412
- * May be of interest to the uploader to read file and image options.
413
- */
414
- schemaType?: SchemaType
415
- /**
416
- * The uploader may send patches directly to the field
417
- * Typed 'unknown' as we don't have patch definitions in sanity/types yet.
418
- */
419
- onChange?: (patch: unknown) => void
420
- },
421
- ): AssetSourceUploadFile[]
422
- /**
423
- * Abort the upload of a file
424
- */
425
- abort(file?: AssetSourceUploadFile): void
426
- /**
427
- * Get the files that are currently being uploaded
428
- */
429
- getFiles(): AssetSourceUploadFile[]
430
- /**
431
- * Subscribe to upload events from the uploader
432
- */
433
- subscribe(subscriber: (event: AssetSourceUploadEvent) => void): () => void
434
- /**
435
- * Update the status of a file. Will be emitted to subscribers.
436
- */
437
- updateFile(
438
- fileId: string,
439
- data: {
440
- progress?: number
441
- status?: string
442
- error?: Error
443
- },
444
- ): void
445
- /**
446
- * Reset the uploader (clear files). Should be called by the uploader when all files are done.
447
- */
448
- reset(): void
449
- }
450
-
451
- /** @beta */
452
- declare type AssetSourceUploadEvent =
453
- | AssetSourceUploadEventProgress
454
- | AssetSourceUploadEventStatus
455
- | AssetSourceUploadEventAllComplete
456
- | AssetSourceUploadEventError
457
- | AssetSourceUploadEventAbort
458
-
459
- /**
460
- * Emitted when all files are done, either successfully, aborted or with errors
461
- * @beta */
462
- declare type AssetSourceUploadEventAbort = {
463
- type: 'abort'
464
- /**
465
- * Files aborted
466
- */
467
- files: AssetSourceUploadFile[]
468
- }
469
-
470
- /**
471
- * Emitted when all files are done, either successfully, aborted or with errors
472
- * @beta */
473
- declare type AssetSourceUploadEventAllComplete = {
474
- type: 'all-complete'
475
- files: AssetSourceUploadFile[]
476
- }
477
-
478
- /**
479
- * Emitted when all files are done, either successfully, aborted or with errors
480
- * @beta */
481
- declare type AssetSourceUploadEventError = {
482
- type: 'error'
483
- /**
484
- * Files errored
485
- */
486
- files: AssetSourceUploadFile[]
487
- }
488
-
489
- /**
490
- * Emitted when a file upload is progressing
491
- * @beta */
492
- declare type AssetSourceUploadEventProgress = {
493
- type: 'progress'
494
- file: AssetSourceUploadFile
495
- progress: number
496
- }
497
-
498
- /**
499
- * Emitted when a file upload is changing status
500
- * @beta */
501
- declare type AssetSourceUploadEventStatus = {
502
- type: 'status'
503
- file: AssetSourceUploadFile
504
- status: AssetSourceUploadFile['status']
505
- }
506
-
507
- /** @beta */
508
- declare interface AssetSourceUploadFile {
509
- id: string
510
- file: globalThis.File
511
- progress: number
512
- status: 'pending' | 'uploading' | 'complete' | 'error' | 'aborted'
513
- error?: Error
514
- result?: unknown
515
- }
516
-
517
257
  /**
518
258
  * @public
519
259
  */
@@ -522,60 +262,6 @@ export declare type BaseDefinition = {
522
262
  title?: string
523
263
  }
524
264
 
525
- /** @public */
526
- declare interface BaseSchemaDefinition {
527
- name: string
528
- title?: string
529
- description?: string | React.JSX.Element
530
- hidden?: ConditionalProperty
531
- readOnly?: ConditionalProperty
532
- icon?: ComponentType | ReactNode
533
- validation?: unknown
534
- initialValue?: unknown
535
- deprecated?: DeprecatedProperty
536
- }
537
-
538
- /** @public */
539
- declare interface BaseSchemaType extends Partial<DeprecationConfiguration> {
540
- name: string
541
- title?: string
542
- description?: string
543
- type?: SchemaType
544
- liveEdit?: boolean
545
- readOnly?: ConditionalProperty
546
- hidden?: ConditionalProperty
547
- icon?: ComponentType
548
- initialValue?: InitialValueProperty<any, any>
549
- validation?: SchemaValidationValue
550
- preview?: PreviewConfig
551
- /** @beta */
552
- components?: {
553
- block?: ComponentType<any>
554
- inlineBlock?: ComponentType<any>
555
- annotation?: ComponentType<any>
556
- diff?: ComponentType<any>
557
- field?: ComponentType<any>
558
- input?: ComponentType<any>
559
- item?: ComponentType<any>
560
- preview?: ComponentType<any>
561
- }
562
- /**
563
- * @deprecated This will be removed.
564
- */
565
- placeholder?: string
566
- }
567
-
568
- /**
569
- * `BaseOptions` applies to all type options.
570
- *
571
- * It can be extended by interface declaration merging in plugins to provide generic options to all types and fields.
572
- *
573
- * @public
574
- * */
575
- declare interface BaseSchemaTypeOptions {
576
- sanityCreate?: SanityCreateOptions
577
- }
578
-
579
265
  /**
580
266
  * @beta
581
267
  */
@@ -689,40 +375,6 @@ export declare interface BlockChildRenderProps {
689
375
  value: PortableTextChild
690
376
  }
691
377
 
692
- /**
693
- * Schema definition for text block decorators.
694
- *
695
- * @public
696
- * @example The default set of decorators
697
- * ```ts
698
- * {
699
- * name: 'blockContent',
700
- * title: 'Content',
701
- * type: 'array',
702
- * of: [
703
- * {
704
- * type: 'block',
705
- * marks: {
706
- * decorators: [
707
- * {title: 'Strong', value: 'strong'},
708
- * {title: 'Emphasis', value: 'em'},
709
- * {title: 'Underline', value: 'underline'},
710
- * {title: 'Strike', value: 'strike'},
711
- * {title: 'Code', value: 'code'},
712
- * ]
713
- * }
714
- * }
715
- * ]
716
- * }
717
- * ```
718
- */
719
- declare interface BlockDecoratorDefinition {
720
- title: string
721
- i18nTitleKey?: string
722
- value: string
723
- icon?: ReactNode | ComponentType
724
- }
725
-
726
378
  /** @beta */
727
379
  export declare interface BlockDecoratorRenderProps {
728
380
  children: ReactElement<any>
@@ -736,99 +388,6 @@ export declare interface BlockDecoratorRenderProps {
736
388
  value: string
737
389
  }
738
390
 
739
- /**
740
- * Schema definition for text blocks.
741
- *
742
- * @public
743
- * @example the default block definition
744
- * ```ts
745
- * {
746
- * name: 'blockContent',
747
- * title: 'Content',
748
- * type: 'array',
749
- * of: [
750
- * {
751
- * type: 'block',
752
- * marks: {
753
- * decorators: [
754
- * {title: 'Strong', value: 'strong'},
755
- * {title: 'Emphasis', value: 'em'},
756
- * {title: 'Underline', value: 'underline'},
757
- * {title: 'Strike', value: 'strike'},
758
- * {title: 'Code', value: 'code'},
759
- * ],
760
- * annotations: [
761
- * {
762
- * type: 'object',
763
- * name: 'link',
764
- * fields: [
765
- * {
766
- * type: 'string',
767
- * name: 'href',
768
- * },
769
- * ],
770
- * },
771
- * ]
772
- * },
773
- * styles: [
774
- * {title: 'Normal', value: 'normal'},
775
- * {title: 'H1', value: 'h1'},
776
- * {title: 'H2', value: 'h2'},
777
- * {title: 'H3', value: 'h3'},
778
- * {title: 'H4', value: 'h4'},
779
- * {title: 'H5', value: 'h5'},
780
- * {title: 'H6', value: 'h6'},
781
- * {title: 'Quote', value: 'blockquote'}
782
- * ],
783
- * lists: [
784
- * {title: 'Bullet', value: 'bullet'},
785
- * {title: 'Number', value: 'number'},
786
- * ],
787
- * },
788
- * ]
789
- * }
790
- * ```
791
- */
792
- declare interface BlockDefinition extends BaseSchemaDefinition {
793
- type: 'block'
794
- styles?: BlockStyleDefinition[]
795
- lists?: BlockListDefinition[]
796
- marks?: BlockMarksDefinition
797
- of?: ArrayOfType<'object' | 'reference'>[]
798
- initialValue?: InitialValueProperty<any, any[]>
799
- options?: BlockOptions
800
- validation?: ValidationBuilder<BlockRule, any[]>
801
- }
802
-
803
- /**
804
- * Schema definition for a text block list style.
805
- *
806
- * @public
807
- * @example The defaults lists
808
- * ```ts
809
- * {
810
- * name: 'blockContent',
811
- * title: 'Content',
812
- * type: 'array',
813
- * of: [
814
- * {
815
- * type: 'block',
816
- * lists: [
817
- * {title: 'Bullet', value: 'bullet'},
818
- * {title: 'Number', value: 'number'},
819
- * ]
820
- * }
821
- * ]
822
- * }
823
- * ```
824
- */
825
- declare interface BlockListDefinition {
826
- title: string
827
- i18nTitleKey?: string
828
- value: string
829
- icon?: ReactNode | ComponentType
830
- }
831
-
832
391
  /** @beta */
833
392
  export declare interface BlockListItemRenderProps {
834
393
  block: PortableTextTextBlock
@@ -842,15 +401,6 @@ export declare interface BlockListItemRenderProps {
842
401
  value: string
843
402
  }
844
403
 
845
- /**
846
- * Schema definition for text block marks (decorators and annotations).
847
- *
848
- * @public */
849
- declare interface BlockMarksDefinition {
850
- decorators?: BlockDecoratorDefinition[]
851
- annotations?: ArrayOfType<'object' | 'reference'>[]
852
- }
853
-
854
404
  /**
855
405
  * @beta
856
406
  */
@@ -859,17 +409,6 @@ export declare type BlockOffset = {
859
409
  offset: number
860
410
  }
861
411
 
862
- /**
863
- * Schema options for a Block schema definition
864
- * @public */
865
- declare interface BlockOptions extends BaseSchemaTypeOptions {
866
- /**
867
- * Turn on or off the builtin browser spellchecking. Default is on.
868
- */
869
- spellCheck?: boolean
870
- unstable_whitespaceOnPasteMode?: 'preserve' | 'normalize' | 'remove'
871
- }
872
-
873
412
  /** @beta */
874
413
  export declare interface BlockRenderProps {
875
414
  children: ReactElement<any>
@@ -886,70 +425,6 @@ export declare interface BlockRenderProps {
886
425
  value: PortableTextBlock
887
426
  }
888
427
 
889
- /** @public */
890
- declare interface BlockRule extends RuleDef<BlockRule, any[]> {}
891
-
892
- /**
893
- * Schema definition for a text block style.
894
- * A text block may have a block style like 'header', 'normal', 'lead'
895
- * attached to it, which is stored on the `.style` property for that block.
896
- *
897
- * @public
898
- * @remarks The first defined style will become the default style.´´
899
- * @example The default set of styles
900
- * ```ts
901
- * {
902
- * name: 'blockContent',
903
- * title: 'Content',
904
- * type: 'array',
905
- * of: [
906
- * {
907
- * type: 'block',
908
- * styles: [
909
- * {title: 'Normal', value: 'normal'},
910
- * {title: 'H1', value: 'h1'},
911
- * {title: 'H2', value: 'h2'},
912
- * {title: 'H3', value: 'h3'},
913
- * {title: 'H4', value: 'h4'},
914
- * {title: 'H5', value: 'h5'},
915
- * {title: 'H6', value: 'h6'},
916
- * {title: 'Quote', value: 'blockquote'}
917
- * ]
918
- * }
919
- * ]
920
- * }
921
- * ```
922
- * @example Example of defining a block type with custom styles and render components.
923
- * ```ts
924
- * defineArrayMember({
925
- * type: 'block',
926
- * styles: [
927
- * {
928
- * title: 'Paragraph',
929
- * value: 'paragraph',
930
- * component: ParagraphStyle,
931
- * },
932
- * {
933
- * title: 'Lead',
934
- * value: 'lead',
935
- * component: LeadStyle,
936
- * },
937
- * {
938
- * title: 'Heading',
939
- * value: 'heading',
940
- * component: HeadingStyle,
941
- * },
942
- * ],
943
- * })
944
- * ```
945
- */
946
- declare interface BlockStyleDefinition {
947
- title: string
948
- value: string
949
- i18nTitleKey?: string
950
- icon?: ReactNode | ComponentType
951
- }
952
-
953
428
  /** @beta */
954
429
  export declare interface BlockStyleRenderProps {
955
430
  block: PortableTextTextBlock
@@ -974,29 +449,6 @@ export declare type BlurChange = {
974
449
  event: FocusEvent_2<HTMLDivElement, Element>
975
450
  }
976
451
 
977
- /** @public */
978
- declare interface BooleanDefinition extends BaseSchemaDefinition {
979
- type: 'boolean'
980
- options?: BooleanOptions
981
- initialValue?: InitialValueProperty<any, boolean>
982
- validation?: ValidationBuilder<BooleanRule, boolean>
983
- }
984
-
985
- /** @public */
986
- declare interface BooleanOptions extends BaseSchemaTypeOptions {
987
- layout?: 'switch' | 'checkbox'
988
- }
989
-
990
- /** @public */
991
- declare interface BooleanRule extends RuleDef<BooleanRule, boolean> {}
992
-
993
- /** @public */
994
- declare interface BooleanSchemaType extends BaseSchemaType {
995
- jsonType: 'boolean'
996
- options?: BooleanOptions
997
- initialValue?: InitialValueProperty<any, boolean>
998
- }
999
-
1000
452
  declare type ClipboardBehaviorEvent =
1001
453
  | {
1002
454
  type: StrictExtract<NativeBehaviorEventType, 'clipboard.copy'>
@@ -1020,35 +472,6 @@ declare type ClipboardBehaviorEvent =
1020
472
  position: Pick<EventPosition, 'selection'>
1021
473
  }
1022
474
 
1023
- /** @public */
1024
- declare interface CollapseOptions {
1025
- collapsed?: boolean
1026
- collapsible?: boolean
1027
- /**
1028
- * @deprecated Use `collapsible` instead
1029
- */
1030
- collapsable?: boolean
1031
- }
1032
-
1033
- /** @public */
1034
- declare type ConditionalProperty =
1035
- | boolean
1036
- | ConditionalPropertyCallback
1037
- | undefined
1038
-
1039
- /** @public */
1040
- declare type ConditionalPropertyCallback = (
1041
- context: ConditionalPropertyCallbackContext,
1042
- ) => boolean
1043
-
1044
- /** @public */
1045
- declare interface ConditionalPropertyCallbackContext {
1046
- document: SanityDocument | undefined
1047
- parent: any
1048
- value: any
1049
- currentUser: Omit<CurrentUser, 'role'> | null
1050
- }
1051
-
1052
475
  /**
1053
476
  * The editor was either connected or disconnected to the network
1054
477
  * To show out of sync warnings etc when in collaborative mode.
@@ -1096,46 +519,6 @@ declare type ConverterEvent<TMIMEType extends MIMEType = MIMEType> =
1096
519
  mimeType: TMIMEType
1097
520
  }
1098
521
 
1099
- /** @public */
1100
- declare interface CrossDatasetReferenceDefinition extends BaseSchemaDefinition {
1101
- type: 'crossDatasetReference'
1102
- weak?: boolean
1103
- to: {
1104
- type: string
1105
- title?: string
1106
- icon?: ComponentType
1107
- preview?: PreviewConfig
1108
- /**
1109
- * @deprecated Unused. Configuring search is no longer supported.
1110
- */
1111
- __experimental_search?: {
1112
- path: string | string[]
1113
- weight?: number
1114
- mapWith?: string
1115
- }[]
1116
- }[]
1117
- dataset: string
1118
- studioUrl?: (document: {id: string; type?: string}) => string | null
1119
- tokenId?: string
1120
- options?: ReferenceOptions
1121
- /**
1122
- * @deprecated Cross-project references are no longer supported, only cross-dataset
1123
- */
1124
- projectId?: string
1125
- }
1126
-
1127
- /** @public */
1128
- declare interface CurrentUser {
1129
- id: string
1130
- name: string
1131
- email: string
1132
- profileImage?: string
1133
- provider?: string
1134
- /** @deprecated use `roles` instead */
1135
- role: string
1136
- roles: Role[]
1137
- }
1138
-
1139
522
  /**
1140
523
  * @beta
1141
524
  */
@@ -1160,77 +543,6 @@ declare type CustomBehaviorEventType<
1160
543
  TType extends string = '',
1161
544
  > = TType extends '' ? `${TNamespace}` : `${TNamespace}.${TType}`
1162
545
 
1163
- /** @public */
1164
- declare interface CustomValidator<T = unknown> {
1165
- (
1166
- value: T,
1167
- context: ValidationContext,
1168
- ): CustomValidatorResult | Promise<CustomValidatorResult>
1169
- bypassConcurrencyLimit?: boolean
1170
- }
1171
-
1172
- /** @public */
1173
- declare type CustomValidatorResult =
1174
- | true
1175
- | string
1176
- | ValidationError
1177
- | ValidationError[]
1178
- | LocalizedValidationMessages
1179
-
1180
- /** @public */
1181
- declare interface DateDefinition extends BaseSchemaDefinition {
1182
- type: 'date'
1183
- options?: DateOptions
1184
- placeholder?: string
1185
- validation?: ValidationBuilder<DateRule, string>
1186
- initialValue?: InitialValueProperty<any, string>
1187
- }
1188
-
1189
- /** @public */
1190
- declare interface DateOptions extends BaseSchemaTypeOptions {
1191
- dateFormat?: string
1192
- }
1193
-
1194
- /** @public */
1195
- declare interface DateRule extends RuleDef<DateRule, string> {
1196
- /**
1197
- * @param minDate - Minimum date (inclusive). minDate should be in ISO 8601 format.
1198
- */
1199
- min: (minDate: string | FieldReference) => DateRule
1200
- /**
1201
- * @param maxDate - Maximum date (inclusive). maxDate should be in ISO 8601 format.
1202
- */
1203
- max: (maxDate: string | FieldReference) => DateRule
1204
- }
1205
-
1206
- /** @public */
1207
- declare interface DatetimeDefinition extends BaseSchemaDefinition {
1208
- type: 'datetime'
1209
- options?: DatetimeOptions
1210
- placeholder?: string
1211
- validation?: ValidationBuilder<DatetimeRule, string>
1212
- initialValue?: InitialValueProperty<any, string>
1213
- }
1214
-
1215
- /** @public */
1216
- declare interface DatetimeOptions extends BaseSchemaTypeOptions {
1217
- dateFormat?: string
1218
- timeFormat?: string
1219
- timeStep?: number
1220
- }
1221
-
1222
- /** @public */
1223
- declare interface DatetimeRule extends RuleDef<DatetimeRule, string> {
1224
- /**
1225
- * @param minDate - Minimum date (inclusive). minDate should be in ISO 8601 format.
1226
- */
1227
- min: (minDate: string | FieldReference) => DatetimeRule
1228
- /**
1229
- * @param maxDate - Maximum date (inclusive). maxDate should be in ISO 8601 format.
1230
- */
1231
- max: (maxDate: string | FieldReference) => DatetimeRule
1232
- }
1233
-
1234
546
  /**
1235
547
  * @public
1236
548
  * A helper wrapper that adds editor support, such as autocomplete and type checking, for a schema definition.
@@ -1258,18 +570,6 @@ export declare function defineSchema<
1258
570
  const TSchemaDefinition extends SchemaDefinition,
1259
571
  >(definition: TSchemaDefinition): TSchemaDefinition
1260
572
 
1261
- /** @public */
1262
- declare interface DeprecatedProperty {
1263
- reason: string
1264
- }
1265
-
1266
- /**
1267
- * @public
1268
- */
1269
- declare interface DeprecationConfiguration {
1270
- deprecated: DeprecatedProperty
1271
- }
1272
-
1273
573
  declare type Deserializer<TMIMEType extends MIMEType> = ({
1274
574
  snapshot,
1275
575
  event,
@@ -1282,40 +582,6 @@ declare type Deserializer<TMIMEType extends MIMEType> = ({
1282
582
  'deserialization.success' | 'deserialization.failure'
1283
583
  >
1284
584
 
1285
- /** @public */
1286
- declare interface DocumentDefinition extends Omit<ObjectDefinition, 'type'> {
1287
- type: 'document'
1288
- liveEdit?: boolean
1289
- /** @beta */
1290
- orderings?: SortOrdering[]
1291
- options?: DocumentOptions
1292
- validation?: ValidationBuilder<DocumentRule, SanityDocument>
1293
- initialValue?: InitialValueProperty<any, Record<string, unknown>>
1294
- /** @deprecated Unused. Use the new field-level search config. */
1295
- __experimental_search?: {
1296
- path: string
1297
- weight: number
1298
- mapWith?: string
1299
- }[]
1300
- /** @alpha */
1301
- __experimental_omnisearch_visibility?: boolean
1302
- /**
1303
- * Determines whether the large preview title is displayed in the document pane form
1304
- * @alpha
1305
- * */
1306
- __experimental_formPreviewTitle?: boolean
1307
- }
1308
-
1309
- /**
1310
- * This exists only to allow for extensions using declaration-merging.
1311
- *
1312
- * @public
1313
- */
1314
- declare interface DocumentOptions extends BaseSchemaTypeOptions {}
1315
-
1316
- /** @public */
1317
- declare interface DocumentRule extends RuleDef<DocumentRule, SanityDocument> {}
1318
-
1319
585
  declare type DragBehaviorEvent =
1320
586
  | {
1321
587
  type: StrictExtract<NativeBehaviorEventType, 'drag.dragstart'>
@@ -1611,6 +877,7 @@ declare const editorMachine: StateMachine<
1611
877
  getLegacySchema: () => PortableTextMemberSchemaTypes
1612
878
  keyGenerator: () => string
1613
879
  pendingEvents: Array<InternalPatchEvent | MutationEvent>
880
+ pendingIncomingPatchesEvents: Array<PatchesEvent>
1614
881
  schema: EditorSchema
1615
882
  initialReadOnly: boolean
1616
883
  maxBlocks: number | undefined
@@ -1624,6 +891,7 @@ declare const editorMachine: StateMachine<
1624
891
  },
1625
892
  | InternalPatchEvent
1626
893
  | MutationEvent
894
+ | PatchesEvent
1627
895
  | {
1628
896
  type: 'add behavior'
1629
897
  behavior: Behavior
@@ -1656,7 +924,6 @@ declare const editorMachine: StateMachine<
1656
924
  type: 'update maxBlocks'
1657
925
  maxBlocks: number | undefined
1658
926
  }
1659
- | PatchesEvent
1660
927
  | {
1661
928
  type: 'blur'
1662
929
  editor: PortableTextSlateEditor
@@ -1672,7 +939,10 @@ declare const editorMachine: StateMachine<
1672
939
  type: 'done normalizing'
1673
940
  }
1674
941
  | {
1675
- type: 'done syncing initial value'
942
+ type: 'done syncing value'
943
+ }
944
+ | {
945
+ type: 'syncing value'
1676
946
  }
1677
947
  | {
1678
948
  type: 'behavior event'
@@ -1800,6 +1070,18 @@ declare const editorMachine: StateMachine<
1800
1070
  type: 'clear pending events'
1801
1071
  params: NonReducibleUnknown
1802
1072
  }
1073
+ 'defer incoming patches': {
1074
+ type: 'defer incoming patches'
1075
+ params: NonReducibleUnknown
1076
+ }
1077
+ 'emit pending incoming patches': {
1078
+ type: 'emit pending incoming patches'
1079
+ params: NonReducibleUnknown
1080
+ }
1081
+ 'clear pending incoming patches': {
1082
+ type: 'clear pending incoming patches'
1083
+ params: NonReducibleUnknown
1084
+ }
1803
1085
  'handle blur': {
1804
1086
  type: 'handle blur'
1805
1087
  params: unknown
@@ -1833,9 +1115,15 @@ declare const editorMachine: StateMachine<
1833
1115
  }
1834
1116
  'setup':
1835
1117
  | 'setting up'
1836
- | 'dirty'
1837
1118
  | {
1838
- pristine: 'normalizing' | 'idle'
1119
+ 'set up': {
1120
+ 'value sync': 'syncing value' | 'idle'
1121
+ 'writing':
1122
+ | 'dirty'
1123
+ | {
1124
+ pristine: 'normalizing' | 'idle'
1125
+ }
1126
+ }
1839
1127
  }
1840
1128
  },
1841
1129
  'dragging internally',
@@ -1943,6 +1231,7 @@ declare const editorMachine: StateMachine<
1943
1231
  getLegacySchema: () => PortableTextMemberSchemaTypes
1944
1232
  keyGenerator: () => string
1945
1233
  pendingEvents: Array<InternalPatchEvent | MutationEvent>
1234
+ pendingIncomingPatchesEvents: Array<PatchesEvent>
1946
1235
  schema: EditorSchema
1947
1236
  initialReadOnly: boolean
1948
1237
  maxBlocks: number | undefined
@@ -1956,6 +1245,7 @@ declare const editorMachine: StateMachine<
1956
1245
  },
1957
1246
  | InternalPatchEvent
1958
1247
  | MutationEvent
1248
+ | PatchesEvent
1959
1249
  | {
1960
1250
  type: 'add behavior'
1961
1251
  behavior: Behavior
@@ -1988,7 +1278,6 @@ declare const editorMachine: StateMachine<
1988
1278
  type: 'update maxBlocks'
1989
1279
  maxBlocks: number | undefined
1990
1280
  }
1991
- | PatchesEvent
1992
1281
  | {
1993
1282
  type: 'blur'
1994
1283
  editor: PortableTextSlateEditor
@@ -2004,7 +1293,10 @@ declare const editorMachine: StateMachine<
2004
1293
  type: 'done normalizing'
2005
1294
  }
2006
1295
  | {
2007
- type: 'done syncing initial value'
1296
+ type: 'done syncing value'
1297
+ }
1298
+ | {
1299
+ type: 'syncing value'
2008
1300
  }
2009
1301
  | {
2010
1302
  type: 'behavior event'
@@ -2090,6 +1382,7 @@ declare const editorMachine: StateMachine<
2090
1382
  >,
2091
1383
  | InternalPatchEvent
2092
1384
  | MutationEvent
1385
+ | PatchesEvent
2093
1386
  | {
2094
1387
  type: 'add behavior'
2095
1388
  behavior: Behavior
@@ -2122,7 +1415,6 @@ declare const editorMachine: StateMachine<
2122
1415
  type: 'update maxBlocks'
2123
1416
  maxBlocks: number | undefined
2124
1417
  }
2125
- | PatchesEvent
2126
1418
  | {
2127
1419
  type: 'blur'
2128
1420
  editor: PortableTextSlateEditor
@@ -2138,7 +1430,10 @@ declare const editorMachine: StateMachine<
2138
1430
  type: 'done normalizing'
2139
1431
  }
2140
1432
  | {
2141
- type: 'done syncing initial value'
1433
+ type: 'done syncing value'
1434
+ }
1435
+ | {
1436
+ type: 'syncing value'
2142
1437
  }
2143
1438
  | {
2144
1439
  type: 'behavior event'
@@ -2223,6 +1518,7 @@ declare const editorMachine: StateMachine<
2223
1518
  getLegacySchema: () => PortableTextMemberSchemaTypes
2224
1519
  keyGenerator: () => string
2225
1520
  pendingEvents: never[]
1521
+ pendingIncomingPatchesEvents: never[]
2226
1522
  schema: EditorSchema
2227
1523
  selection: null
2228
1524
  initialReadOnly: boolean
@@ -2238,6 +1534,7 @@ declare const editorMachine: StateMachine<
2238
1534
  getLegacySchema: () => PortableTextMemberSchemaTypes
2239
1535
  keyGenerator: () => string
2240
1536
  pendingEvents: Array<InternalPatchEvent | MutationEvent>
1537
+ pendingIncomingPatchesEvents: Array<PatchesEvent>
2241
1538
  schema: EditorSchema
2242
1539
  initialReadOnly: boolean
2243
1540
  maxBlocks: number | undefined
@@ -2255,6 +1552,7 @@ declare const editorMachine: StateMachine<
2255
1552
  },
2256
1553
  | InternalPatchEvent
2257
1554
  | MutationEvent
1555
+ | PatchesEvent
2258
1556
  | {
2259
1557
  type: 'add behavior'
2260
1558
  behavior: Behavior
@@ -2287,7 +1585,6 @@ declare const editorMachine: StateMachine<
2287
1585
  type: 'update maxBlocks'
2288
1586
  maxBlocks: number | undefined
2289
1587
  }
2290
- | PatchesEvent
2291
1588
  | {
2292
1589
  type: 'blur'
2293
1590
  editor: PortableTextSlateEditor
@@ -2303,7 +1600,10 @@ declare const editorMachine: StateMachine<
2303
1600
  type: 'done normalizing'
2304
1601
  }
2305
1602
  | {
2306
- type: 'done syncing initial value'
1603
+ type: 'done syncing value'
1604
+ }
1605
+ | {
1606
+ type: 'syncing value'
2307
1607
  }
2308
1608
  | {
2309
1609
  type: 'behavior event'
@@ -2442,6 +1742,7 @@ declare const editorMachine: StateMachine<
2442
1742
  getLegacySchema: () => PortableTextMemberSchemaTypes
2443
1743
  keyGenerator: () => string
2444
1744
  pendingEvents: Array<InternalPatchEvent | MutationEvent>
1745
+ pendingIncomingPatchesEvents: Array<PatchesEvent>
2445
1746
  schema: EditorSchema
2446
1747
  initialReadOnly: boolean
2447
1748
  maxBlocks: number | undefined
@@ -2458,6 +1759,7 @@ declare const editorMachine: StateMachine<
2458
1759
  },
2459
1760
  | InternalPatchEvent
2460
1761
  | MutationEvent
1762
+ | PatchesEvent
2461
1763
  | {
2462
1764
  type: 'add behavior'
2463
1765
  behavior: Behavior
@@ -2490,7 +1792,6 @@ declare const editorMachine: StateMachine<
2490
1792
  type: 'update maxBlocks'
2491
1793
  maxBlocks: number | undefined
2492
1794
  }
2493
- | PatchesEvent
2494
1795
  | {
2495
1796
  type: 'blur'
2496
1797
  editor: PortableTextSlateEditor
@@ -2506,7 +1807,10 @@ declare const editorMachine: StateMachine<
2506
1807
  type: 'done normalizing'
2507
1808
  }
2508
1809
  | {
2509
- type: 'done syncing initial value'
1810
+ type: 'done syncing value'
1811
+ }
1812
+ | {
1813
+ type: 'syncing value'
2510
1814
  }
2511
1815
  | {
2512
1816
  type: 'behavior event'
@@ -2645,6 +1949,7 @@ declare const editorMachine: StateMachine<
2645
1949
  getLegacySchema: () => PortableTextMemberSchemaTypes
2646
1950
  keyGenerator: () => string
2647
1951
  pendingEvents: Array<InternalPatchEvent | MutationEvent>
1952
+ pendingIncomingPatchesEvents: Array<PatchesEvent>
2648
1953
  schema: EditorSchema
2649
1954
  initialReadOnly: boolean
2650
1955
  maxBlocks: number | undefined
@@ -2664,6 +1969,7 @@ declare const editorMachine: StateMachine<
2664
1969
  },
2665
1970
  | InternalPatchEvent
2666
1971
  | MutationEvent
1972
+ | PatchesEvent
2667
1973
  | {
2668
1974
  type: 'add behavior'
2669
1975
  behavior: Behavior
@@ -2696,7 +2002,6 @@ declare const editorMachine: StateMachine<
2696
2002
  type: 'update maxBlocks'
2697
2003
  maxBlocks: number | undefined
2698
2004
  }
2699
- | PatchesEvent
2700
2005
  | {
2701
2006
  type: 'blur'
2702
2007
  editor: PortableTextSlateEditor
@@ -2712,7 +2017,10 @@ declare const editorMachine: StateMachine<
2712
2017
  type: 'done normalizing'
2713
2018
  }
2714
2019
  | {
2715
- type: 'done syncing initial value'
2020
+ type: 'done syncing value'
2021
+ }
2022
+ | {
2023
+ type: 'syncing value'
2716
2024
  }
2717
2025
  | {
2718
2026
  type: 'behavior event'
@@ -2851,6 +2159,7 @@ declare const editorMachine: StateMachine<
2851
2159
  getLegacySchema: () => PortableTextMemberSchemaTypes
2852
2160
  keyGenerator: () => string
2853
2161
  pendingEvents: Array<InternalPatchEvent | MutationEvent>
2162
+ pendingIncomingPatchesEvents: Array<PatchesEvent>
2854
2163
  schema: EditorSchema
2855
2164
  initialReadOnly: boolean
2856
2165
  maxBlocks: number | undefined
@@ -2869,6 +2178,7 @@ declare const editorMachine: StateMachine<
2869
2178
  },
2870
2179
  | InternalPatchEvent
2871
2180
  | MutationEvent
2181
+ | PatchesEvent
2872
2182
  | {
2873
2183
  type: 'add behavior'
2874
2184
  behavior: Behavior
@@ -2901,7 +2211,6 @@ declare const editorMachine: StateMachine<
2901
2211
  type: 'update maxBlocks'
2902
2212
  maxBlocks: number | undefined
2903
2213
  }
2904
- | PatchesEvent
2905
2214
  | {
2906
2215
  type: 'blur'
2907
2216
  editor: PortableTextSlateEditor
@@ -2917,7 +2226,10 @@ declare const editorMachine: StateMachine<
2917
2226
  type: 'done normalizing'
2918
2227
  }
2919
2228
  | {
2920
- type: 'done syncing initial value'
2229
+ type: 'done syncing value'
2230
+ }
2231
+ | {
2232
+ type: 'syncing value'
2921
2233
  }
2922
2234
  | {
2923
2235
  type: 'behavior event'
@@ -3056,6 +2368,7 @@ declare const editorMachine: StateMachine<
3056
2368
  getLegacySchema: () => PortableTextMemberSchemaTypes
3057
2369
  keyGenerator: () => string
3058
2370
  pendingEvents: Array<InternalPatchEvent | MutationEvent>
2371
+ pendingIncomingPatchesEvents: Array<PatchesEvent>
3059
2372
  schema: EditorSchema
3060
2373
  initialReadOnly: boolean
3061
2374
  maxBlocks: number | undefined
@@ -3073,6 +2386,7 @@ declare const editorMachine: StateMachine<
3073
2386
  },
3074
2387
  | InternalPatchEvent
3075
2388
  | MutationEvent
2389
+ | PatchesEvent
3076
2390
  | {
3077
2391
  type: 'add behavior'
3078
2392
  behavior: Behavior
@@ -3105,7 +2419,6 @@ declare const editorMachine: StateMachine<
3105
2419
  type: 'update maxBlocks'
3106
2420
  maxBlocks: number | undefined
3107
2421
  }
3108
- | PatchesEvent
3109
2422
  | {
3110
2423
  type: 'blur'
3111
2424
  editor: PortableTextSlateEditor
@@ -3121,7 +2434,10 @@ declare const editorMachine: StateMachine<
3121
2434
  type: 'done normalizing'
3122
2435
  }
3123
2436
  | {
3124
- type: 'done syncing initial value'
2437
+ type: 'done syncing value'
2438
+ }
2439
+ | {
2440
+ type: 'syncing value'
3125
2441
  }
3126
2442
  | {
3127
2443
  type: 'behavior event'
@@ -3261,6 +2577,7 @@ declare const editorMachine: StateMachine<
3261
2577
  getLegacySchema: () => PortableTextMemberSchemaTypes
3262
2578
  keyGenerator: () => string
3263
2579
  pendingEvents: Array<InternalPatchEvent | MutationEvent>
2580
+ pendingIncomingPatchesEvents: Array<PatchesEvent>
3264
2581
  schema: EditorSchema
3265
2582
  initialReadOnly: boolean
3266
2583
  maxBlocks: number | undefined
@@ -3278,6 +2595,7 @@ declare const editorMachine: StateMachine<
3278
2595
  },
3279
2596
  | InternalPatchEvent
3280
2597
  | MutationEvent
2598
+ | PatchesEvent
3281
2599
  | {
3282
2600
  type: 'add behavior'
3283
2601
  behavior: Behavior
@@ -3310,7 +2628,6 @@ declare const editorMachine: StateMachine<
3310
2628
  type: 'update maxBlocks'
3311
2629
  maxBlocks: number | undefined
3312
2630
  }
3313
- | PatchesEvent
3314
2631
  | {
3315
2632
  type: 'blur'
3316
2633
  editor: PortableTextSlateEditor
@@ -3326,7 +2643,10 @@ declare const editorMachine: StateMachine<
3326
2643
  type: 'done normalizing'
3327
2644
  }
3328
2645
  | {
3329
- type: 'done syncing initial value'
2646
+ type: 'done syncing value'
2647
+ }
2648
+ | {
2649
+ type: 'syncing value'
3330
2650
  }
3331
2651
  | {
3332
2652
  type: 'behavior event'
@@ -3417,6 +2737,7 @@ declare const editorMachine: StateMachine<
3417
2737
  getLegacySchema: () => PortableTextMemberSchemaTypes
3418
2738
  keyGenerator: () => string
3419
2739
  pendingEvents: Array<InternalPatchEvent | MutationEvent>
2740
+ pendingIncomingPatchesEvents: Array<PatchesEvent>
3420
2741
  schema: EditorSchema
3421
2742
  initialReadOnly: boolean
3422
2743
  maxBlocks: number | undefined
@@ -3434,6 +2755,7 @@ declare const editorMachine: StateMachine<
3434
2755
  },
3435
2756
  | InternalPatchEvent
3436
2757
  | MutationEvent
2758
+ | PatchesEvent
3437
2759
  | {
3438
2760
  type: 'add behavior'
3439
2761
  behavior: Behavior
@@ -3466,7 +2788,6 @@ declare const editorMachine: StateMachine<
3466
2788
  type: 'update maxBlocks'
3467
2789
  maxBlocks: number | undefined
3468
2790
  }
3469
- | PatchesEvent
3470
2791
  | {
3471
2792
  type: 'blur'
3472
2793
  editor: PortableTextSlateEditor
@@ -3482,7 +2803,10 @@ declare const editorMachine: StateMachine<
3482
2803
  type: 'done normalizing'
3483
2804
  }
3484
2805
  | {
3485
- type: 'done syncing initial value'
2806
+ type: 'done syncing value'
2807
+ }
2808
+ | {
2809
+ type: 'syncing value'
3486
2810
  }
3487
2811
  | {
3488
2812
  type: 'behavior event'
@@ -3622,6 +2946,7 @@ declare const editorMachine: StateMachine<
3622
2946
  getLegacySchema: () => PortableTextMemberSchemaTypes
3623
2947
  keyGenerator: () => string
3624
2948
  pendingEvents: Array<InternalPatchEvent | MutationEvent>
2949
+ pendingIncomingPatchesEvents: Array<PatchesEvent>
3625
2950
  schema: EditorSchema
3626
2951
  initialReadOnly: boolean
3627
2952
  maxBlocks: number | undefined
@@ -3639,6 +2964,7 @@ declare const editorMachine: StateMachine<
3639
2964
  },
3640
2965
  | InternalPatchEvent
3641
2966
  | MutationEvent
2967
+ | PatchesEvent
3642
2968
  | {
3643
2969
  type: 'add behavior'
3644
2970
  behavior: Behavior
@@ -3671,7 +2997,6 @@ declare const editorMachine: StateMachine<
3671
2997
  type: 'update maxBlocks'
3672
2998
  maxBlocks: number | undefined
3673
2999
  }
3674
- | PatchesEvent
3675
3000
  | {
3676
3001
  type: 'blur'
3677
3002
  editor: PortableTextSlateEditor
@@ -3687,7 +3012,10 @@ declare const editorMachine: StateMachine<
3687
3012
  type: 'done normalizing'
3688
3013
  }
3689
3014
  | {
3690
- type: 'done syncing initial value'
3015
+ type: 'done syncing value'
3016
+ }
3017
+ | {
3018
+ type: 'syncing value'
3691
3019
  }
3692
3020
  | {
3693
3021
  type: 'behavior event'
@@ -3826,6 +3154,7 @@ declare const editorMachine: StateMachine<
3826
3154
  getLegacySchema: () => PortableTextMemberSchemaTypes
3827
3155
  keyGenerator: () => string
3828
3156
  pendingEvents: Array<InternalPatchEvent | MutationEvent>
3157
+ pendingIncomingPatchesEvents: Array<PatchesEvent>
3829
3158
  schema: EditorSchema
3830
3159
  initialReadOnly: boolean
3831
3160
  maxBlocks: number | undefined
@@ -3842,6 +3171,7 @@ declare const editorMachine: StateMachine<
3842
3171
  },
3843
3172
  | InternalPatchEvent
3844
3173
  | MutationEvent
3174
+ | PatchesEvent
3845
3175
  | {
3846
3176
  type: 'add behavior'
3847
3177
  behavior: Behavior
@@ -3874,7 +3204,6 @@ declare const editorMachine: StateMachine<
3874
3204
  type: 'update maxBlocks'
3875
3205
  maxBlocks: number | undefined
3876
3206
  }
3877
- | PatchesEvent
3878
3207
  | {
3879
3208
  type: 'blur'
3880
3209
  editor: PortableTextSlateEditor
@@ -3890,7 +3219,10 @@ declare const editorMachine: StateMachine<
3890
3219
  type: 'done normalizing'
3891
3220
  }
3892
3221
  | {
3893
- type: 'done syncing initial value'
3222
+ type: 'done syncing value'
3223
+ }
3224
+ | {
3225
+ type: 'syncing value'
3894
3226
  }
3895
3227
  | {
3896
3228
  type: 'behavior event'
@@ -4029,6 +3361,7 @@ declare const editorMachine: StateMachine<
4029
3361
  getLegacySchema: () => PortableTextMemberSchemaTypes
4030
3362
  keyGenerator: () => string
4031
3363
  pendingEvents: Array<InternalPatchEvent | MutationEvent>
3364
+ pendingIncomingPatchesEvents: Array<PatchesEvent>
4032
3365
  schema: EditorSchema
4033
3366
  initialReadOnly: boolean
4034
3367
  maxBlocks: number | undefined
@@ -4046,6 +3379,7 @@ declare const editorMachine: StateMachine<
4046
3379
  },
4047
3380
  | InternalPatchEvent
4048
3381
  | MutationEvent
3382
+ | PatchesEvent
4049
3383
  | {
4050
3384
  type: 'add behavior'
4051
3385
  behavior: Behavior
@@ -4078,7 +3412,6 @@ declare const editorMachine: StateMachine<
4078
3412
  type: 'update maxBlocks'
4079
3413
  maxBlocks: number | undefined
4080
3414
  }
4081
- | PatchesEvent
4082
3415
  | {
4083
3416
  type: 'blur'
4084
3417
  editor: PortableTextSlateEditor
@@ -4094,7 +3427,10 @@ declare const editorMachine: StateMachine<
4094
3427
  type: 'done normalizing'
4095
3428
  }
4096
3429
  | {
4097
- type: 'done syncing initial value'
3430
+ type: 'done syncing value'
3431
+ }
3432
+ | {
3433
+ type: 'syncing value'
4098
3434
  }
4099
3435
  | {
4100
3436
  type: 'behavior event'
@@ -4231,7 +3567,10 @@ declare const editorMachine: StateMachine<
4231
3567
  readonly 'remove behavior': {
4232
3568
  readonly actions: 'remove behavior from context'
4233
3569
  }
4234
- readonly 'patches': {
3570
+ readonly 'update behaviors': {
3571
+ readonly actions: 'assign behaviors'
3572
+ }
3573
+ readonly 'update key generator': {
4235
3574
  readonly actions: ActionFunction<
4236
3575
  {
4237
3576
  behaviors: Set<Behavior>
@@ -4239,6 +3578,7 @@ declare const editorMachine: StateMachine<
4239
3578
  getLegacySchema: () => PortableTextMemberSchemaTypes
4240
3579
  keyGenerator: () => string
4241
3580
  pendingEvents: Array<InternalPatchEvent | MutationEvent>
3581
+ pendingIncomingPatchesEvents: Array<PatchesEvent>
4242
3582
  schema: EditorSchema
4243
3583
  initialReadOnly: boolean
4244
3584
  maxBlocks: number | undefined
@@ -4250,9 +3590,13 @@ declare const editorMachine: StateMachine<
4250
3590
  }
4251
3591
  slateEditor?: PortableTextSlateEditor
4252
3592
  },
4253
- PatchesEvent,
3593
+ {
3594
+ type: 'update key generator'
3595
+ keyGenerator: () => string
3596
+ },
4254
3597
  | InternalPatchEvent
4255
3598
  | MutationEvent
3599
+ | PatchesEvent
4256
3600
  | {
4257
3601
  type: 'add behavior'
4258
3602
  behavior: Behavior
@@ -4285,7 +3629,6 @@ declare const editorMachine: StateMachine<
4285
3629
  type: 'update maxBlocks'
4286
3630
  maxBlocks: number | undefined
4287
3631
  }
4288
- | PatchesEvent
4289
3632
  | {
4290
3633
  type: 'blur'
4291
3634
  editor: PortableTextSlateEditor
@@ -4301,7 +3644,10 @@ declare const editorMachine: StateMachine<
4301
3644
  type: 'done normalizing'
4302
3645
  }
4303
3646
  | {
4304
- type: 'done syncing initial value'
3647
+ type: 'done syncing value'
3648
+ }
3649
+ | {
3650
+ type: 'syncing value'
4305
3651
  }
4306
3652
  | {
4307
3653
  type: 'behavior event'
@@ -4383,59 +3729,13 @@ declare const editorMachine: StateMachine<
4383
3729
  never,
4384
3730
  never,
4385
3731
  never,
4386
- | PatchEvent
4387
- | InternalPatchEvent
4388
- | MutationEvent
4389
- | PatchesEvent
4390
- | {
4391
- type: 'blurred'
4392
- event: FocusEvent_2<HTMLDivElement, Element>
4393
- }
4394
- | {
4395
- type: 'done loading'
4396
- }
4397
- | {
4398
- type: 'editable'
4399
- }
4400
- | {
4401
- type: 'error'
4402
- name: string
4403
- description: string
4404
- data: unknown
4405
- }
4406
- | {
4407
- type: 'focused'
4408
- event: FocusEvent_2<HTMLDivElement, Element>
4409
- }
4410
- | {
4411
- type: 'invalid value'
4412
- resolution: InvalidValueResolution | null
4413
- value: Array<PortableTextBlock> | undefined
4414
- }
4415
- | {
4416
- type: 'loading'
4417
- }
4418
- | {
4419
- type: 'read only'
4420
- }
4421
- | {
4422
- type: 'ready'
4423
- }
4424
- | {
4425
- type: 'selection'
4426
- selection: EditorSelection
4427
- }
4428
- | {
4429
- type: 'value changed'
4430
- value: Array<PortableTextBlock> | undefined
4431
- }
4432
- | UnsetEvent
3732
+ never
4433
3733
  >
4434
3734
  }
4435
- readonly 'update behaviors': {
4436
- readonly actions: 'assign behaviors'
3735
+ readonly 'update schema': {
3736
+ readonly actions: 'assign schema'
4437
3737
  }
4438
- readonly 'update key generator': {
3738
+ readonly 'update value': {
4439
3739
  readonly actions: ActionFunction<
4440
3740
  {
4441
3741
  behaviors: Set<Behavior>
@@ -4443,6 +3743,7 @@ declare const editorMachine: StateMachine<
4443
3743
  getLegacySchema: () => PortableTextMemberSchemaTypes
4444
3744
  keyGenerator: () => string
4445
3745
  pendingEvents: Array<InternalPatchEvent | MutationEvent>
3746
+ pendingIncomingPatchesEvents: Array<PatchesEvent>
4446
3747
  schema: EditorSchema
4447
3748
  initialReadOnly: boolean
4448
3749
  maxBlocks: number | undefined
@@ -4455,11 +3756,12 @@ declare const editorMachine: StateMachine<
4455
3756
  slateEditor?: PortableTextSlateEditor
4456
3757
  },
4457
3758
  {
4458
- type: 'update key generator'
4459
- keyGenerator: () => string
3759
+ type: 'update value'
3760
+ value: Array<PortableTextBlock> | undefined
4460
3761
  },
4461
3762
  | InternalPatchEvent
4462
3763
  | MutationEvent
3764
+ | PatchesEvent
4463
3765
  | {
4464
3766
  type: 'add behavior'
4465
3767
  behavior: Behavior
@@ -4492,7 +3794,6 @@ declare const editorMachine: StateMachine<
4492
3794
  type: 'update maxBlocks'
4493
3795
  maxBlocks: number | undefined
4494
3796
  }
4495
- | PatchesEvent
4496
3797
  | {
4497
3798
  type: 'blur'
4498
3799
  editor: PortableTextSlateEditor
@@ -4508,7 +3809,10 @@ declare const editorMachine: StateMachine<
4508
3809
  type: 'done normalizing'
4509
3810
  }
4510
3811
  | {
4511
- type: 'done syncing initial value'
3812
+ type: 'done syncing value'
3813
+ }
3814
+ | {
3815
+ type: 'syncing value'
4512
3816
  }
4513
3817
  | {
4514
3818
  type: 'behavior event'
@@ -4593,10 +3897,7 @@ declare const editorMachine: StateMachine<
4593
3897
  never
4594
3898
  >
4595
3899
  }
4596
- readonly 'update schema': {
4597
- readonly actions: 'assign schema'
4598
- }
4599
- readonly 'update value': {
3900
+ readonly 'update maxBlocks': {
4600
3901
  readonly actions: ActionFunction<
4601
3902
  {
4602
3903
  behaviors: Set<Behavior>
@@ -4604,6 +3905,7 @@ declare const editorMachine: StateMachine<
4604
3905
  getLegacySchema: () => PortableTextMemberSchemaTypes
4605
3906
  keyGenerator: () => string
4606
3907
  pendingEvents: Array<InternalPatchEvent | MutationEvent>
3908
+ pendingIncomingPatchesEvents: Array<PatchesEvent>
4607
3909
  schema: EditorSchema
4608
3910
  initialReadOnly: boolean
4609
3911
  maxBlocks: number | undefined
@@ -4616,11 +3918,12 @@ declare const editorMachine: StateMachine<
4616
3918
  slateEditor?: PortableTextSlateEditor
4617
3919
  },
4618
3920
  {
4619
- type: 'update value'
4620
- value: Array<PortableTextBlock> | undefined
3921
+ type: 'update maxBlocks'
3922
+ maxBlocks: number | undefined
4621
3923
  },
4622
3924
  | InternalPatchEvent
4623
3925
  | MutationEvent
3926
+ | PatchesEvent
4624
3927
  | {
4625
3928
  type: 'add behavior'
4626
3929
  behavior: Behavior
@@ -4653,7 +3956,6 @@ declare const editorMachine: StateMachine<
4653
3956
  type: 'update maxBlocks'
4654
3957
  maxBlocks: number | undefined
4655
3958
  }
4656
- | PatchesEvent
4657
3959
  | {
4658
3960
  type: 'blur'
4659
3961
  editor: PortableTextSlateEditor
@@ -4669,7 +3971,10 @@ declare const editorMachine: StateMachine<
4669
3971
  type: 'done normalizing'
4670
3972
  }
4671
3973
  | {
4672
- type: 'done syncing initial value'
3974
+ type: 'done syncing value'
3975
+ }
3976
+ | {
3977
+ type: 'syncing value'
4673
3978
  }
4674
3979
  | {
4675
3980
  type: 'behavior event'
@@ -4754,210 +4059,53 @@ declare const editorMachine: StateMachine<
4754
4059
  never
4755
4060
  >
4756
4061
  }
4757
- readonly 'update maxBlocks': {
4758
- readonly actions: ActionFunction<
4759
- {
4760
- behaviors: Set<Behavior>
4761
- converters: Set<Converter>
4762
- getLegacySchema: () => PortableTextMemberSchemaTypes
4763
- keyGenerator: () => string
4764
- pendingEvents: Array<InternalPatchEvent | MutationEvent>
4765
- schema: EditorSchema
4766
- initialReadOnly: boolean
4767
- maxBlocks: number | undefined
4768
- selection: EditorSelection
4769
- incomingValue: Array<PortableTextBlock> | undefined
4770
- internalDrag?: {
4771
- ghost?: HTMLElement
4772
- origin: Pick<EventPosition, 'selection'>
4773
- }
4774
- slateEditor?: PortableTextSlateEditor
4775
- },
4776
- {
4777
- type: 'update maxBlocks'
4778
- maxBlocks: number | undefined
4779
- },
4780
- | InternalPatchEvent
4781
- | MutationEvent
4782
- | {
4783
- type: 'add behavior'
4784
- behavior: Behavior
4785
- }
4786
- | {
4787
- type: 'remove behavior'
4788
- behavior: Behavior
4789
- }
4790
- | {
4791
- type: 'update readOnly'
4792
- readOnly: boolean
4793
- }
4794
- | {
4795
- type: 'update schema'
4796
- schema: EditorSchema
4797
- }
4798
- | {
4799
- type: 'update behaviors'
4800
- behaviors: Array<Behavior>
4801
- }
4802
- | {
4803
- type: 'update key generator'
4804
- keyGenerator: () => string
4805
- }
4806
- | {
4807
- type: 'update value'
4808
- value: Array<PortableTextBlock> | undefined
4809
- }
4810
- | {
4811
- type: 'update maxBlocks'
4812
- maxBlocks: number | undefined
4813
- }
4814
- | PatchesEvent
4815
- | {
4816
- type: 'blur'
4817
- editor: PortableTextSlateEditor
4818
- }
4819
- | {
4820
- type: 'focus'
4821
- editor: PortableTextSlateEditor
4822
- }
4823
- | {
4824
- type: 'normalizing'
4825
- }
4826
- | {
4827
- type: 'done normalizing'
4828
- }
4829
- | {
4830
- type: 'done syncing initial value'
4831
- }
4832
- | {
4833
- type: 'behavior event'
4834
- behaviorEvent: BehaviorEvent
4835
- editor: PortableTextSlateEditor
4836
- nativeEvent?: {
4837
- preventDefault: () => void
4838
- }
4839
- }
4840
- | {
4841
- type: 'notify.patch'
4842
- patch: Patch
4843
- }
4844
- | {
4845
- type: 'notify.mutation'
4846
- patches: Array<Patch>
4847
- snapshot: Array<PortableTextBlock> | undefined
4848
- value: Array<PortableTextBlock> | undefined
4849
- }
4850
- | {
4851
- type: 'notify.blurred'
4852
- event: FocusEvent_2<HTMLDivElement, Element>
4853
- }
4854
- | {
4855
- type: 'notify.done loading'
4856
- }
4857
- | {
4858
- type: 'notify.editable'
4859
- }
4860
- | {
4861
- type: 'notify.error'
4862
- name: string
4863
- description: string
4864
- data: unknown
4865
- }
4866
- | {
4867
- type: 'notify.focused'
4868
- event: FocusEvent_2<HTMLDivElement, Element>
4869
- }
4870
- | {
4871
- type: 'notify.invalid value'
4872
- resolution: InvalidValueResolution | null
4873
- value: Array<PortableTextBlock> | undefined
4874
- }
4875
- | {
4876
- type: 'notify.loading'
4877
- }
4878
- | {
4879
- type: 'notify.read only'
4880
- }
4881
- | {
4882
- type: 'notify.ready'
4883
- }
4884
- | {
4885
- type: 'notify.selection'
4886
- selection: EditorSelection
4887
- }
4888
- | {
4889
- type: 'notify.value changed'
4890
- value: Array<PortableTextBlock> | undefined
4891
- }
4892
- | {
4893
- type: 'notify.unset'
4894
- previousValue: Array<PortableTextBlock>
4895
- }
4896
- | {
4897
- type: 'dragstart'
4898
- origin: Pick<EventPosition, 'selection'>
4899
- ghost?: HTMLElement
4900
- }
4901
- | {
4902
- type: 'dragend'
4903
- }
4904
- | {
4905
- type: 'drop'
4906
- },
4907
- undefined,
4908
- never,
4909
- never,
4910
- never,
4911
- never,
4912
- never
4913
- >
4914
- }
4915
- }
4916
- readonly type: 'parallel'
4917
- readonly states: {
4918
- readonly 'edit mode': {
4919
- readonly initial: 'read only'
4920
- readonly states: {
4921
- readonly 'read only': {
4922
- readonly initial: 'determine initial edit mode'
4923
- readonly on: {
4924
- readonly 'behavior event': {
4925
- readonly actions: 'handle behavior event'
4926
- readonly guard: ({
4927
- event,
4928
- }: GuardArgs<
4929
- {
4930
- behaviors: Set<Behavior>
4931
- converters: Set<Converter>
4932
- getLegacySchema: () => PortableTextMemberSchemaTypes
4933
- keyGenerator: () => string
4934
- pendingEvents: Array<InternalPatchEvent | MutationEvent>
4935
- schema: EditorSchema
4936
- initialReadOnly: boolean
4937
- maxBlocks: number | undefined
4938
- selection: EditorSelection
4939
- incomingValue: Array<PortableTextBlock> | undefined
4940
- internalDrag?: {
4941
- ghost?: HTMLElement
4942
- origin: Pick<EventPosition, 'selection'>
4943
- }
4944
- slateEditor?: PortableTextSlateEditor
4945
- },
4946
- {
4947
- type: 'behavior event'
4948
- behaviorEvent: BehaviorEvent
4949
- editor: PortableTextSlateEditor
4950
- nativeEvent?: {
4951
- preventDefault: () => void
4952
- }
4953
- }
4954
- >) => boolean
4955
- }
4062
+ }
4063
+ readonly type: 'parallel'
4064
+ readonly states: {
4065
+ readonly 'edit mode': {
4066
+ readonly initial: 'read only'
4067
+ readonly states: {
4068
+ readonly 'read only': {
4069
+ readonly initial: 'determine initial edit mode'
4070
+ readonly on: {
4071
+ readonly 'behavior event': {
4072
+ readonly actions: 'handle behavior event'
4073
+ readonly guard: ({
4074
+ event,
4075
+ }: GuardArgs<
4076
+ {
4077
+ behaviors: Set<Behavior>
4078
+ converters: Set<Converter>
4079
+ getLegacySchema: () => PortableTextMemberSchemaTypes
4080
+ keyGenerator: () => string
4081
+ pendingEvents: Array<InternalPatchEvent | MutationEvent>
4082
+ pendingIncomingPatchesEvents: Array<PatchesEvent>
4083
+ schema: EditorSchema
4084
+ initialReadOnly: boolean
4085
+ maxBlocks: number | undefined
4086
+ selection: EditorSelection
4087
+ incomingValue: Array<PortableTextBlock> | undefined
4088
+ internalDrag?: {
4089
+ ghost?: HTMLElement
4090
+ origin: Pick<EventPosition, 'selection'>
4091
+ }
4092
+ slateEditor?: PortableTextSlateEditor
4093
+ },
4094
+ {
4095
+ type: 'behavior event'
4096
+ behaviorEvent: BehaviorEvent
4097
+ editor: PortableTextSlateEditor
4098
+ nativeEvent?: {
4099
+ preventDefault: () => void
4100
+ }
4101
+ }
4102
+ >) => boolean
4103
+ }
4956
4104
  }
4957
4105
  readonly states: {
4958
4106
  readonly 'determine initial edit mode': {
4959
4107
  readonly on: {
4960
- readonly 'done syncing initial value': readonly [
4108
+ readonly 'done syncing value': readonly [
4961
4109
  {
4962
4110
  readonly target: '#editor.edit mode.read only.read only'
4963
4111
  readonly guard: ({
@@ -4971,6 +4119,7 @@ declare const editorMachine: StateMachine<
4971
4119
  pendingEvents: Array<
4972
4120
  InternalPatchEvent | MutationEvent
4973
4121
  >
4122
+ pendingIncomingPatchesEvents: Array<PatchesEvent>
4974
4123
  schema: EditorSchema
4975
4124
  initialReadOnly: boolean
4976
4125
  maxBlocks: number | undefined
@@ -4983,7 +4132,7 @@ declare const editorMachine: StateMachine<
4983
4132
  slateEditor?: PortableTextSlateEditor
4984
4133
  },
4985
4134
  {
4986
- type: 'done syncing initial value'
4135
+ type: 'done syncing value'
4987
4136
  }
4988
4137
  >) => boolean
4989
4138
  },
@@ -5005,6 +4154,7 @@ declare const editorMachine: StateMachine<
5005
4154
  getLegacySchema: () => PortableTextMemberSchemaTypes
5006
4155
  keyGenerator: () => string
5007
4156
  pendingEvents: Array<InternalPatchEvent | MutationEvent>
4157
+ pendingIncomingPatchesEvents: Array<PatchesEvent>
5008
4158
  schema: EditorSchema
5009
4159
  initialReadOnly: boolean
5010
4160
  maxBlocks: number | undefined
@@ -5040,6 +4190,7 @@ declare const editorMachine: StateMachine<
5040
4190
  getLegacySchema: () => PortableTextMemberSchemaTypes
5041
4191
  keyGenerator: () => string
5042
4192
  pendingEvents: Array<InternalPatchEvent | MutationEvent>
4193
+ pendingIncomingPatchesEvents: Array<PatchesEvent>
5043
4194
  schema: EditorSchema
5044
4195
  initialReadOnly: boolean
5045
4196
  maxBlocks: number | undefined
@@ -5075,6 +4226,7 @@ declare const editorMachine: StateMachine<
5075
4226
  getLegacySchema: () => PortableTextMemberSchemaTypes
5076
4227
  keyGenerator: () => string
5077
4228
  pendingEvents: Array<InternalPatchEvent | MutationEvent>
4229
+ pendingIncomingPatchesEvents: Array<PatchesEvent>
5078
4230
  schema: EditorSchema
5079
4231
  initialReadOnly: boolean
5080
4232
  maxBlocks: number | undefined
@@ -5092,6 +4244,7 @@ declare const editorMachine: StateMachine<
5092
4244
  },
5093
4245
  | InternalPatchEvent
5094
4246
  | MutationEvent
4247
+ | PatchesEvent
5095
4248
  | {
5096
4249
  type: 'add behavior'
5097
4250
  behavior: Behavior
@@ -5124,7 +4277,6 @@ declare const editorMachine: StateMachine<
5124
4277
  type: 'update maxBlocks'
5125
4278
  maxBlocks: number | undefined
5126
4279
  }
5127
- | PatchesEvent
5128
4280
  | {
5129
4281
  type: 'blur'
5130
4282
  editor: PortableTextSlateEditor
@@ -5140,7 +4292,10 @@ declare const editorMachine: StateMachine<
5140
4292
  type: 'done normalizing'
5141
4293
  }
5142
4294
  | {
5143
- type: 'done syncing initial value'
4295
+ type: 'done syncing value'
4296
+ }
4297
+ | {
4298
+ type: 'syncing value'
5144
4299
  }
5145
4300
  | {
5146
4301
  type: 'behavior event'
@@ -5242,6 +4397,7 @@ declare const editorMachine: StateMachine<
5242
4397
  pendingEvents: Array<
5243
4398
  InternalPatchEvent | MutationEvent
5244
4399
  >
4400
+ pendingIncomingPatchesEvents: Array<PatchesEvent>
5245
4401
  schema: EditorSchema
5246
4402
  initialReadOnly: boolean
5247
4403
  maxBlocks: number | undefined
@@ -5260,6 +4416,7 @@ declare const editorMachine: StateMachine<
5260
4416
  },
5261
4417
  | InternalPatchEvent
5262
4418
  | MutationEvent
4419
+ | PatchesEvent
5263
4420
  | {
5264
4421
  type: 'add behavior'
5265
4422
  behavior: Behavior
@@ -5292,7 +4449,6 @@ declare const editorMachine: StateMachine<
5292
4449
  type: 'update maxBlocks'
5293
4450
  maxBlocks: number | undefined
5294
4451
  }
5295
- | PatchesEvent
5296
4452
  | {
5297
4453
  type: 'blur'
5298
4454
  editor: PortableTextSlateEditor
@@ -5308,7 +4464,10 @@ declare const editorMachine: StateMachine<
5308
4464
  type: 'done normalizing'
5309
4465
  }
5310
4466
  | {
5311
- type: 'done syncing initial value'
4467
+ type: 'done syncing value'
4468
+ }
4469
+ | {
4470
+ type: 'syncing value'
5312
4471
  }
5313
4472
  | {
5314
4473
  type: 'behavior event'
@@ -5432,6 +4591,7 @@ declare const editorMachine: StateMachine<
5432
4591
  getLegacySchema: () => PortableTextMemberSchemaTypes
5433
4592
  keyGenerator: () => string
5434
4593
  pendingEvents: Array<InternalPatchEvent | MutationEvent>
4594
+ pendingIncomingPatchesEvents: Array<PatchesEvent>
5435
4595
  schema: EditorSchema
5436
4596
  initialReadOnly: boolean
5437
4597
  maxBlocks: number | undefined
@@ -5445,6 +4605,7 @@ declare const editorMachine: StateMachine<
5445
4605
  },
5446
4606
  | InternalPatchEvent
5447
4607
  | MutationEvent
4608
+ | PatchesEvent
5448
4609
  | {
5449
4610
  type: 'add behavior'
5450
4611
  behavior: Behavior
@@ -5477,7 +4638,6 @@ declare const editorMachine: StateMachine<
5477
4638
  type: 'update maxBlocks'
5478
4639
  maxBlocks: number | undefined
5479
4640
  }
5480
- | PatchesEvent
5481
4641
  | {
5482
4642
  type: 'blur'
5483
4643
  editor: PortableTextSlateEditor
@@ -5493,7 +4653,10 @@ declare const editorMachine: StateMachine<
5493
4653
  type: 'done normalizing'
5494
4654
  }
5495
4655
  | {
5496
- type: 'done syncing initial value'
4656
+ type: 'done syncing value'
4657
+ }
4658
+ | {
4659
+ type: 'syncing value'
5497
4660
  }
5498
4661
  | {
5499
4662
  type: 'behavior event'
@@ -5572,6 +4735,7 @@ declare const editorMachine: StateMachine<
5572
4735
  },
5573
4736
  | InternalPatchEvent
5574
4737
  | MutationEvent
4738
+ | PatchesEvent
5575
4739
  | {
5576
4740
  type: 'add behavior'
5577
4741
  behavior: Behavior
@@ -5604,7 +4768,6 @@ declare const editorMachine: StateMachine<
5604
4768
  type: 'update maxBlocks'
5605
4769
  maxBlocks: number | undefined
5606
4770
  }
5607
- | PatchesEvent
5608
4771
  | {
5609
4772
  type: 'blur'
5610
4773
  editor: PortableTextSlateEditor
@@ -5620,7 +4783,10 @@ declare const editorMachine: StateMachine<
5620
4783
  type: 'done normalizing'
5621
4784
  }
5622
4785
  | {
5623
- type: 'done syncing initial value'
4786
+ type: 'done syncing value'
4787
+ }
4788
+ | {
4789
+ type: 'syncing value'
5624
4790
  }
5625
4791
  | {
5626
4792
  type: 'behavior event'
@@ -5705,6 +4871,7 @@ declare const editorMachine: StateMachine<
5705
4871
  getLegacySchema: () => PortableTextMemberSchemaTypes
5706
4872
  keyGenerator: () => string
5707
4873
  pendingEvents: Array<InternalPatchEvent | MutationEvent>
4874
+ pendingIncomingPatchesEvents: Array<PatchesEvent>
5708
4875
  schema: EditorSchema
5709
4876
  initialReadOnly: boolean
5710
4877
  maxBlocks: number | undefined
@@ -5718,6 +4885,7 @@ declare const editorMachine: StateMachine<
5718
4885
  },
5719
4886
  | InternalPatchEvent
5720
4887
  | MutationEvent
4888
+ | PatchesEvent
5721
4889
  | {
5722
4890
  type: 'add behavior'
5723
4891
  behavior: Behavior
@@ -5750,7 +4918,6 @@ declare const editorMachine: StateMachine<
5750
4918
  type: 'update maxBlocks'
5751
4919
  maxBlocks: number | undefined
5752
4920
  }
5753
- | PatchesEvent
5754
4921
  | {
5755
4922
  type: 'blur'
5756
4923
  editor: PortableTextSlateEditor
@@ -5766,7 +4933,10 @@ declare const editorMachine: StateMachine<
5766
4933
  type: 'done normalizing'
5767
4934
  }
5768
4935
  | {
5769
- type: 'done syncing initial value'
4936
+ type: 'done syncing value'
4937
+ }
4938
+ | {
4939
+ type: 'syncing value'
5770
4940
  }
5771
4941
  | {
5772
4942
  type: 'behavior event'
@@ -5845,6 +5015,7 @@ declare const editorMachine: StateMachine<
5845
5015
  },
5846
5016
  | InternalPatchEvent
5847
5017
  | MutationEvent
5018
+ | PatchesEvent
5848
5019
  | {
5849
5020
  type: 'add behavior'
5850
5021
  behavior: Behavior
@@ -5877,7 +5048,6 @@ declare const editorMachine: StateMachine<
5877
5048
  type: 'update maxBlocks'
5878
5049
  maxBlocks: number | undefined
5879
5050
  }
5880
- | PatchesEvent
5881
5051
  | {
5882
5052
  type: 'blur'
5883
5053
  editor: PortableTextSlateEditor
@@ -5893,7 +5063,10 @@ declare const editorMachine: StateMachine<
5893
5063
  type: 'done normalizing'
5894
5064
  }
5895
5065
  | {
5896
- type: 'done syncing initial value'
5066
+ type: 'done syncing value'
5067
+ }
5068
+ | {
5069
+ type: 'syncing value'
5897
5070
  }
5898
5071
  | {
5899
5072
  type: 'behavior event'
@@ -5996,7 +5169,11 @@ declare const editorMachine: StateMachine<
5996
5169
  readonly initial: 'setting up'
5997
5170
  readonly states: {
5998
5171
  readonly 'setting up': {
5999
- readonly exit: readonly ['emit ready']
5172
+ readonly exit: readonly [
5173
+ 'emit ready',
5174
+ 'emit pending incoming patches',
5175
+ 'clear pending incoming patches',
5176
+ ]
6000
5177
  readonly on: {
6001
5178
  readonly 'internal.patch': {
6002
5179
  readonly actions: 'defer event'
@@ -6004,58 +5181,308 @@ declare const editorMachine: StateMachine<
6004
5181
  readonly 'mutation': {
6005
5182
  readonly actions: 'defer event'
6006
5183
  }
6007
- readonly 'done syncing initial value': {
6008
- readonly target: 'pristine'
5184
+ readonly 'done syncing value': {
5185
+ readonly target: 'set up'
5186
+ }
5187
+ readonly 'patches': {
5188
+ readonly actions: readonly ['defer incoming patches']
6009
5189
  }
6010
5190
  }
6011
5191
  }
6012
- readonly 'pristine': {
6013
- readonly initial: 'idle'
5192
+ readonly 'set up': {
5193
+ readonly type: 'parallel'
6014
5194
  readonly states: {
6015
- readonly idle: {
6016
- readonly on: {
6017
- readonly 'normalizing': {
6018
- readonly target: 'normalizing'
6019
- }
6020
- readonly 'internal.patch': {
6021
- readonly actions: 'defer event'
6022
- readonly target: '#editor.setup.dirty'
5195
+ readonly 'value sync': {
5196
+ readonly initial: 'idle'
5197
+ readonly states: {
5198
+ readonly 'idle': {
5199
+ readonly on: {
5200
+ readonly 'patches': {
5201
+ readonly actions: readonly [
5202
+ ActionFunction<
5203
+ {
5204
+ behaviors: Set<Behavior>
5205
+ converters: Set<Converter>
5206
+ getLegacySchema: () => PortableTextMemberSchemaTypes
5207
+ keyGenerator: () => string
5208
+ pendingEvents: Array<
5209
+ InternalPatchEvent | MutationEvent
5210
+ >
5211
+ pendingIncomingPatchesEvents: Array<PatchesEvent>
5212
+ schema: EditorSchema
5213
+ initialReadOnly: boolean
5214
+ maxBlocks: number | undefined
5215
+ selection: EditorSelection
5216
+ incomingValue:
5217
+ | Array<PortableTextBlock>
5218
+ | undefined
5219
+ internalDrag?: {
5220
+ ghost?: HTMLElement
5221
+ origin: Pick<EventPosition, 'selection'>
5222
+ }
5223
+ slateEditor?: PortableTextSlateEditor
5224
+ },
5225
+ PatchesEvent,
5226
+ | InternalPatchEvent
5227
+ | MutationEvent
5228
+ | PatchesEvent
5229
+ | {
5230
+ type: 'add behavior'
5231
+ behavior: Behavior
5232
+ }
5233
+ | {
5234
+ type: 'remove behavior'
5235
+ behavior: Behavior
5236
+ }
5237
+ | {
5238
+ type: 'update readOnly'
5239
+ readOnly: boolean
5240
+ }
5241
+ | {
5242
+ type: 'update schema'
5243
+ schema: EditorSchema
5244
+ }
5245
+ | {
5246
+ type: 'update behaviors'
5247
+ behaviors: Array<Behavior>
5248
+ }
5249
+ | {
5250
+ type: 'update key generator'
5251
+ keyGenerator: () => string
5252
+ }
5253
+ | {
5254
+ type: 'update value'
5255
+ value: Array<PortableTextBlock> | undefined
5256
+ }
5257
+ | {
5258
+ type: 'update maxBlocks'
5259
+ maxBlocks: number | undefined
5260
+ }
5261
+ | {
5262
+ type: 'blur'
5263
+ editor: PortableTextSlateEditor
5264
+ }
5265
+ | {
5266
+ type: 'focus'
5267
+ editor: PortableTextSlateEditor
5268
+ }
5269
+ | {
5270
+ type: 'normalizing'
5271
+ }
5272
+ | {
5273
+ type: 'done normalizing'
5274
+ }
5275
+ | {
5276
+ type: 'done syncing value'
5277
+ }
5278
+ | {
5279
+ type: 'syncing value'
5280
+ }
5281
+ | {
5282
+ type: 'behavior event'
5283
+ behaviorEvent: BehaviorEvent
5284
+ editor: PortableTextSlateEditor
5285
+ nativeEvent?: {
5286
+ preventDefault: () => void
5287
+ }
5288
+ }
5289
+ | {
5290
+ type: 'notify.patch'
5291
+ patch: Patch
5292
+ }
5293
+ | {
5294
+ type: 'notify.mutation'
5295
+ patches: Array<Patch>
5296
+ snapshot: Array<PortableTextBlock> | undefined
5297
+ value: Array<PortableTextBlock> | undefined
5298
+ }
5299
+ | {
5300
+ type: 'notify.blurred'
5301
+ event: FocusEvent_2<HTMLDivElement, Element>
5302
+ }
5303
+ | {
5304
+ type: 'notify.done loading'
5305
+ }
5306
+ | {
5307
+ type: 'notify.editable'
5308
+ }
5309
+ | {
5310
+ type: 'notify.error'
5311
+ name: string
5312
+ description: string
5313
+ data: unknown
5314
+ }
5315
+ | {
5316
+ type: 'notify.focused'
5317
+ event: FocusEvent_2<HTMLDivElement, Element>
5318
+ }
5319
+ | {
5320
+ type: 'notify.invalid value'
5321
+ resolution: InvalidValueResolution | null
5322
+ value: Array<PortableTextBlock> | undefined
5323
+ }
5324
+ | {
5325
+ type: 'notify.loading'
5326
+ }
5327
+ | {
5328
+ type: 'notify.read only'
5329
+ }
5330
+ | {
5331
+ type: 'notify.ready'
5332
+ }
5333
+ | {
5334
+ type: 'notify.selection'
5335
+ selection: EditorSelection
5336
+ }
5337
+ | {
5338
+ type: 'notify.value changed'
5339
+ value: Array<PortableTextBlock> | undefined
5340
+ }
5341
+ | {
5342
+ type: 'notify.unset'
5343
+ previousValue: Array<PortableTextBlock>
5344
+ }
5345
+ | {
5346
+ type: 'dragstart'
5347
+ origin: Pick<EventPosition, 'selection'>
5348
+ ghost?: HTMLElement
5349
+ }
5350
+ | {
5351
+ type: 'dragend'
5352
+ }
5353
+ | {
5354
+ type: 'drop'
5355
+ },
5356
+ undefined,
5357
+ never,
5358
+ never,
5359
+ never,
5360
+ never,
5361
+ | PatchEvent
5362
+ | InternalPatchEvent
5363
+ | MutationEvent
5364
+ | PatchesEvent
5365
+ | {
5366
+ type: 'blurred'
5367
+ event: FocusEvent_2<HTMLDivElement, Element>
5368
+ }
5369
+ | {
5370
+ type: 'done loading'
5371
+ }
5372
+ | {
5373
+ type: 'editable'
5374
+ }
5375
+ | {
5376
+ type: 'error'
5377
+ name: string
5378
+ description: string
5379
+ data: unknown
5380
+ }
5381
+ | {
5382
+ type: 'focused'
5383
+ event: FocusEvent_2<HTMLDivElement, Element>
5384
+ }
5385
+ | {
5386
+ type: 'invalid value'
5387
+ resolution: InvalidValueResolution | null
5388
+ value: Array<PortableTextBlock> | undefined
5389
+ }
5390
+ | {
5391
+ type: 'loading'
5392
+ }
5393
+ | {
5394
+ type: 'read only'
5395
+ }
5396
+ | {
5397
+ type: 'ready'
5398
+ }
5399
+ | {
5400
+ type: 'selection'
5401
+ selection: EditorSelection
5402
+ }
5403
+ | {
5404
+ type: 'value changed'
5405
+ value: Array<PortableTextBlock> | undefined
5406
+ }
5407
+ | UnsetEvent
5408
+ >,
5409
+ ]
5410
+ }
5411
+ readonly 'syncing value': {
5412
+ readonly target: 'syncing value'
5413
+ }
5414
+ }
6023
5415
  }
6024
- readonly 'mutation': {
6025
- readonly actions: 'defer event'
6026
- readonly target: '#editor.setup.dirty'
5416
+ readonly 'syncing value': {
5417
+ readonly exit: readonly [
5418
+ 'emit pending incoming patches',
5419
+ 'clear pending incoming patches',
5420
+ ]
5421
+ readonly on: {
5422
+ readonly 'patches': {
5423
+ readonly actions: readonly ['defer incoming patches']
5424
+ }
5425
+ readonly 'done syncing value': {
5426
+ readonly target: 'idle'
5427
+ }
5428
+ }
6027
5429
  }
6028
5430
  }
6029
5431
  }
6030
- readonly normalizing: {
6031
- readonly on: {
6032
- readonly 'done normalizing': {
6033
- readonly target: 'idle'
6034
- }
6035
- readonly 'internal.patch': {
6036
- readonly actions: 'defer event'
5432
+ readonly 'writing': {
5433
+ readonly initial: 'pristine'
5434
+ readonly states: {
5435
+ readonly pristine: {
5436
+ readonly initial: 'idle'
5437
+ readonly states: {
5438
+ readonly idle: {
5439
+ readonly on: {
5440
+ readonly 'normalizing': {
5441
+ readonly target: 'normalizing'
5442
+ }
5443
+ readonly 'internal.patch': {
5444
+ readonly actions: 'defer event'
5445
+ readonly target: '#editor.setup.set up.writing.dirty'
5446
+ }
5447
+ readonly 'mutation': {
5448
+ readonly actions: 'defer event'
5449
+ readonly target: '#editor.setup.set up.writing.dirty'
5450
+ }
5451
+ }
5452
+ }
5453
+ readonly normalizing: {
5454
+ readonly on: {
5455
+ readonly 'done normalizing': {
5456
+ readonly target: 'idle'
5457
+ }
5458
+ readonly 'internal.patch': {
5459
+ readonly actions: 'defer event'
5460
+ }
5461
+ readonly 'mutation': {
5462
+ readonly actions: 'defer event'
5463
+ }
5464
+ }
5465
+ }
5466
+ }
6037
5467
  }
6038
- readonly 'mutation': {
6039
- readonly actions: 'defer event'
5468
+ readonly dirty: {
5469
+ readonly entry: readonly [
5470
+ 'emit pending events',
5471
+ 'clear pending events',
5472
+ ]
5473
+ readonly on: {
5474
+ readonly 'internal.patch': {
5475
+ readonly actions: 'emit patch event'
5476
+ }
5477
+ readonly 'mutation': {
5478
+ readonly actions: 'emit mutation event'
5479
+ }
5480
+ }
6040
5481
  }
6041
5482
  }
6042
5483
  }
6043
5484
  }
6044
5485
  }
6045
- readonly 'dirty': {
6046
- readonly entry: readonly [
6047
- 'emit pending events',
6048
- 'clear pending events',
6049
- ]
6050
- readonly on: {
6051
- readonly 'internal.patch': {
6052
- readonly actions: 'emit patch event'
6053
- }
6054
- readonly 'mutation': {
6055
- readonly actions: 'emit mutation event'
6056
- }
6057
- }
6058
- }
6059
5486
  }
6060
5487
  }
6061
5488
  }
@@ -6194,31 +5621,6 @@ export declare type EditorSnapshot = {
6194
5621
  }
6195
5622
  }
6196
5623
 
6197
- /** @public */
6198
- declare interface EmailDefinition extends BaseSchemaDefinition {
6199
- type: 'email'
6200
- options?: EmailOptions
6201
- placeholder?: string
6202
- validation?: ValidationBuilder<EmailRule, string>
6203
- initialValue?: InitialValueProperty<any, string>
6204
- }
6205
-
6206
- /** @public */
6207
- declare interface EmailOptions extends BaseSchemaTypeOptions {}
6208
-
6209
- /** @public */
6210
- declare interface EmailRule extends RuleDef<EmailRule, string> {}
6211
-
6212
- /** @public */
6213
- declare interface EmptyProps {}
6214
-
6215
- /** @public */
6216
- declare interface EnumListProps<V = unknown> {
6217
- list?: Array<TitledListValue<V> | V>
6218
- layout?: 'radio' | 'dropdown'
6219
- direction?: 'horizontal' | 'vertical'
6220
- }
6221
-
6222
5624
  /**
6223
5625
  * The editor produced an error
6224
5626
  * @beta */
@@ -6310,400 +5712,40 @@ declare type ExternalEditorEvent =
6310
5712
  declare type ExtractNamespace<TType extends string> =
6311
5713
  TType extends `${infer Namespace}.${string}` ? Namespace : TType
6312
5714
 
6313
- /**
6314
- * The shape of a field definition. Note, it's recommended to use the
6315
- * `defineField` function instead of using this type directly.
6316
- *
6317
- * Where `defineField` infers the exact field type,
6318
- * FieldDefinition is a compromise union of all types a field can have.
6319
- *
6320
- * A field definition can be a reference to another registered top-level type
6321
- * or a inline type definition.
6322
- *
6323
- * @public
6324
- */
6325
- declare type FieldDefinition<
6326
- TType extends IntrinsicTypeName = IntrinsicTypeName,
6327
- TAlias extends IntrinsicTypeName | undefined = undefined,
6328
- > = (InlineFieldDefinition[TType] | TypeAliasDefinition<string, TAlias>) &
6329
- FieldDefinitionBase
6330
-
6331
- declare type FieldDefinition_2 = {
5715
+ declare type FieldDefinition = {
6332
5716
  name: string
6333
5717
  type: 'string' | 'number' | 'boolean' | 'array' | 'object'
6334
5718
  }
6335
5719
 
6336
- /** @public */
6337
- declare interface FieldDefinitionBase {
6338
- fieldset?: string
6339
- group?: string | string[]
5720
+ /**
5721
+ * The editor received focus
5722
+ * @beta */
5723
+ export declare type FocusChange = {
5724
+ type: 'focus'
5725
+ event: FocusEvent_2<HTMLDivElement, Element>
6340
5726
  }
6341
5727
 
6342
- /** @public */
6343
- declare interface FieldGroup {
6344
- name: string
6345
- icon?: ComponentType
6346
- title?: string
6347
- description?: string
6348
- i18n?: I18nTextRecord<'title'>
6349
- hidden?: ConditionalProperty
6350
- default?: boolean
6351
- fields?: ObjectField[]
5728
+ declare type HasTag = ReturnType<EditorActor['getSnapshot']>['hasTag']
5729
+
5730
+ declare interface History_2 {
5731
+ redos: HistoryItem[]
5732
+ undos: HistoryItem[]
6352
5733
  }
6353
5734
 
6354
- /** @public */
6355
- declare type FieldGroupDefinition = {
6356
- name: string
6357
- title?: string
6358
- hidden?: ConditionalProperty
6359
- icon?: ComponentType
6360
- default?: boolean
6361
- i18n?: I18nTextRecord<'title'>
5735
+ declare type HistoryItem = {
5736
+ operations: Operation[]
5737
+ timestamp: Date
6362
5738
  }
6363
5739
 
6364
5740
  /**
6365
- * Holds a reference to a different field
6366
- * NOTE: Only use this through {@link Rule.valueOfField}
6367
- *
6368
- * @public
5741
+ * @beta
6369
5742
  */
6370
- declare interface FieldReference {
6371
- type: symbol
6372
- path: string | string[]
6373
- }
6374
-
6375
- /** @public */
6376
- declare type FieldRules = {
6377
- [fieldKey: string]: SchemaValidationValue
6378
- }
6379
-
6380
- /** @public */
6381
- declare type Fieldset = SingleFieldSet | MultiFieldSet
6382
-
6383
- /** @public */
6384
- declare type FieldsetDefinition = {
6385
- name: string
6386
- title?: string
6387
- description?: string
6388
- group?: string
6389
- hidden?: ConditionalProperty
6390
- readOnly?: ConditionalProperty
6391
- options?: ObjectOptions
6392
- }
6393
-
6394
- /** @public */
6395
- declare interface File_2 {
6396
- [key: string]: unknown
6397
- asset?: Reference
6398
- }
6399
-
6400
- /** @public */
6401
- declare interface FileDefinition
6402
- extends Omit<
6403
- ObjectDefinition,
6404
- 'type' | 'fields' | 'options' | 'groups' | 'validation'
6405
- > {
6406
- type: 'file'
6407
- fields?: ObjectDefinition['fields']
6408
- options?: FileOptions
6409
- validation?: ValidationBuilder<FileRule, FileValue>
6410
- initialValue?: InitialValueProperty<any, FileValue>
6411
- }
6412
-
6413
- /** @public */
6414
- declare interface FileOptions extends ObjectOptions {
6415
- storeOriginalFilename?: boolean
6416
- accept?: string
6417
- sources?: AssetSource[]
6418
- }
6419
-
6420
- /** @public */
6421
- declare interface FileRule extends RuleDef<FileRule, FileValue> {
6422
- /**
6423
- * Require a file field has an asset.
6424
- *
6425
- * @example
6426
- * ```ts
6427
- * defineField({
6428
- * name: 'file',
6429
- * title: 'File',
6430
- * type: 'file',
6431
- * validation: (Rule) => Rule.required().assetRequired(),
6432
- * })
6433
- * ```
6434
- */
6435
- assetRequired(): FileRule
6436
- }
6437
-
6438
- /** @public */
6439
- declare interface FileSchemaType extends Omit<ObjectSchemaType, 'options'> {
6440
- options?: FileOptions
6441
- }
6442
-
6443
- /** @public */
6444
- declare interface FileValue {
6445
- asset?: Reference
6446
- [index: string]: unknown
6447
- }
6448
-
6449
- /**
6450
- * The editor received focus
6451
- * @beta */
6452
- export declare type FocusChange = {
6453
- type: 'focus'
6454
- event: FocusEvent_2<HTMLDivElement, Element>
6455
- }
6456
-
6457
- /** @public */
6458
- declare interface GeopointDefinition extends BaseSchemaDefinition {
6459
- type: 'geopoint'
6460
- options?: GeopointOptions
6461
- validation?: ValidationBuilder<GeopointRule, GeopointValue>
6462
- initialValue?: InitialValueProperty<any, Omit<GeopointValue, '_type'>>
6463
- }
6464
-
6465
- /** @public */
6466
- declare interface GeopointOptions extends BaseSchemaTypeOptions {}
6467
-
6468
- /** @public */
6469
- declare interface GeopointRule extends RuleDef<GeopointRule, GeopointValue> {}
6470
-
6471
- /**
6472
- * Geographical point representing a pair of latitude and longitude coordinates,
6473
- * stored as degrees, in the World Geodetic System 1984 (WGS 84) format. Also
6474
- * includes an optional `alt` property representing the altitude in meters.
6475
- *
6476
- * @public
6477
- */
6478
- declare interface GeopointValue {
6479
- /**
6480
- * Type of the object. Must be `geopoint`.
6481
- */
6482
- _type: 'geopoint'
6483
- /**
6484
- * Latitude in degrees
6485
- */
6486
- lat: number
6487
- /**
6488
- * Longitude in degrees
6489
- */
6490
- lng: number
6491
- /**
6492
- * Altitude in meters
6493
- */
6494
- alt?: number
6495
- }
6496
-
6497
- /** @public */
6498
- declare interface GlobalDocumentReferenceDefinition
6499
- extends BaseSchemaDefinition {
6500
- type: 'globalDocumentReference'
6501
- weak?: boolean
6502
- to: {
6503
- type: string
6504
- title?: string
6505
- icon?: ComponentType
6506
- preview?: PreviewConfig
6507
- }[]
6508
- resourceType: string
6509
- resourceId: string
6510
- options?: ReferenceOptions
6511
- studioUrl?: (document: {id: string; type?: string}) => string | null
6512
- }
6513
-
6514
- declare type HasTag = ReturnType<EditorActor['getSnapshot']>['hasTag']
6515
-
6516
- declare interface History_2 {
6517
- redos: HistoryItem[]
6518
- undos: HistoryItem[]
6519
- }
6520
-
6521
- declare type HistoryItem = {
6522
- operations: Operation[]
6523
- timestamp: Date
6524
- }
6525
-
6526
- /**
6527
- * @beta
6528
- */
6529
- export declare type HotkeyOptions = {
6530
- marks?: Record<string, string>
6531
- custom?: Record<
6532
- string,
6533
- (event: BaseSyntheticEvent, editor: PortableTextEditor) => void
6534
- >
6535
- }
6536
-
6537
- /** @public */
6538
- declare interface HotspotOptions {
6539
- previews?: HotspotPreview[]
6540
- }
6541
-
6542
- /** @public */
6543
- declare interface HotspotPreview {
6544
- title: string
6545
- aspectRatio: number
6546
- }
6547
-
6548
- /** @public */
6549
- declare type I18nTextRecord<K extends string> = {
6550
- [P in K]?: {
6551
- key: string
6552
- ns: string
6553
- }
6554
- }
6555
-
6556
- /** @public */
6557
- declare interface ImageAsset extends Asset {
6558
- _type: 'sanity.imageAsset'
6559
- metadata: ImageMetadata
6560
- }
6561
-
6562
- /** @public */
6563
- declare interface ImageCrop {
6564
- _type?: 'sanity.imageCrop'
6565
- left: number
6566
- bottom: number
6567
- right: number
6568
- top: number
6569
- }
6570
-
6571
- /** @public */
6572
- declare interface ImageDefinition
6573
- extends Omit<
6574
- ObjectDefinition,
6575
- 'type' | 'fields' | 'options' | 'groups' | 'validation'
6576
- > {
6577
- type: 'image'
6578
- fields?: FieldDefinition[]
6579
- options?: ImageOptions
6580
- validation?: ValidationBuilder<ImageRule, ImageValue>
6581
- initialValue?: InitialValueProperty<any, ImageValue>
6582
- }
6583
-
6584
- /** @public */
6585
- declare interface ImageDimensions {
6586
- _type: 'sanity.imageDimensions'
6587
- height: number
6588
- width: number
6589
- aspectRatio: number
6590
- }
6591
-
6592
- /** @public */
6593
- declare interface ImageHotspot {
6594
- _type?: 'sanity.imageHotspot'
6595
- width: number
6596
- height: number
6597
- x: number
6598
- y: number
6599
- }
6600
-
6601
- /** @public */
6602
- declare interface ImageMetadata {
6603
- [key: string]: unknown
6604
- _type: 'sanity.imageMetadata'
6605
- dimensions: ImageDimensions
6606
- palette?: ImagePalette
6607
- lqip?: string
6608
- blurHash?: string
6609
- hasAlpha: boolean
6610
- isOpaque: boolean
6611
- }
6612
-
6613
- /** @public */
6614
- declare type ImageMetadataType =
6615
- | 'blurhash'
6616
- | 'lqip'
6617
- | 'palette'
6618
- | 'exif'
6619
- | 'image'
6620
- | 'location'
6621
-
6622
- /** @public */
6623
- declare interface ImageOptions extends FileOptions {
6624
- metadata?: ImageMetadataType[]
6625
- hotspot?: boolean | HotspotOptions
6626
- }
6627
-
6628
- /** @public */
6629
- declare interface ImagePalette {
6630
- _type: 'sanity.imagePalette'
6631
- darkMuted?: ImageSwatch
6632
- darkVibrant?: ImageSwatch
6633
- dominant?: ImageSwatch
6634
- lightMuted?: ImageSwatch
6635
- lightVibrant?: ImageSwatch
6636
- muted?: ImageSwatch
6637
- vibrant?: ImageSwatch
6638
- }
6639
-
6640
- /** @public */
6641
- declare interface ImageRule extends RuleDef<ImageRule, ImageValue> {
6642
- /**
6643
- * Require an image field has an asset.
6644
- *
6645
- * @example
6646
- * ```ts
6647
- * defineField({
6648
- * name: 'image',
6649
- * title: 'Image',
6650
- * type: 'image',
6651
- * validation: (Rule) => Rule.required().assetRequired(),
6652
- * })
6653
- * ```
6654
- */
6655
- assetRequired(): ImageRule
6656
- }
6657
-
6658
- /** @public */
6659
- declare interface ImageSwatch {
6660
- _type: 'sanity.imagePaletteSwatch'
6661
- background: string
6662
- foreground: string
6663
- population: number
6664
- title?: string
6665
- }
6666
-
6667
- /** @public */
6668
- declare interface ImageValue extends FileValue {
6669
- crop?: ImageCrop
6670
- hotspot?: ImageHotspot
6671
- [index: string]: unknown
6672
- }
6673
-
6674
- /** @public */
6675
- declare type IndexTuple = [number | '', number | '']
6676
-
6677
- /** @public */
6678
- declare type InitialValueProperty<Params, Value> =
6679
- | Value
6680
- | InitialValueResolver<Params, Value>
6681
- | undefined
6682
-
6683
- /** @public */
6684
- declare type InitialValueResolver<Params, Value> = (
6685
- params: Params | undefined,
6686
- context: InitialValueResolverContext,
6687
- ) => Promise<Value> | Value
6688
-
6689
- /** @public */
6690
- declare interface InitialValueResolverContext {
6691
- projectId: string
6692
- dataset: string
6693
- schema: Schema
6694
- currentUser: CurrentUser | null
6695
- getClient: (options: {apiVersion: string}) => SanityClient
6696
- }
6697
-
6698
- /** @public */
6699
- declare type InlineFieldDefinition = {
6700
- [K in keyof IntrinsicDefinitions]: Omit<
6701
- IntrinsicDefinitions[K],
6702
- 'initialValue' | 'validation'
6703
- > & {
6704
- validation?: SchemaValidationValue
6705
- initialValue?: InitialValueProperty<any, any>
6706
- }
5743
+ export declare type HotkeyOptions = {
5744
+ marks?: Record<string, string>
5745
+ custom?: Record<
5746
+ string,
5747
+ (event: BaseSyntheticEvent, editor: PortableTextEditor) => void
5748
+ >
6707
5749
  }
6708
5750
 
6709
5751
  /**
@@ -6724,33 +5766,6 @@ declare type InputBehaviorEvent = {
6724
5766
  }
6725
5767
  }
6726
5768
 
6727
- /** @alpha This API may change */
6728
- declare interface InsertMenuOptions {
6729
- /**
6730
- * @defaultValue `'auto'`
6731
- * `filter: 'auto'` automatically turns on filtering if there are more than 5
6732
- * schema types added to the menu.
6733
- */
6734
- filter?: 'auto' | boolean
6735
- groups?: Array<{
6736
- name: string
6737
- title?: string
6738
- of?: Array<string>
6739
- }>
6740
- /** defaultValue `true` */
6741
- showIcons?: boolean
6742
- /** @defaultValue `[{name: 'list'}]` */
6743
- views?: Array<
6744
- | {
6745
- name: 'list'
6746
- }
6747
- | {
6748
- name: 'grid'
6749
- previewImageUrl?: (schemaTypeName: string) => string | undefined
6750
- }
6751
- >
6752
- }
6753
-
6754
5769
  declare type InsertPlacement = 'auto' | 'after' | 'before'
6755
5770
 
6756
5771
  declare type InternalEditor = Editor & {
@@ -6766,64 +5781,6 @@ declare type InternalPatchEvent = NamespaceEvent<PatchEvent, 'internal'> & {
6766
5781
  value: Array<PortableTextBlock>
6767
5782
  }
6768
5783
 
6769
- /** @public */
6770
- declare type IntrinsicArrayOfDefinition = {
6771
- [K in keyof IntrinsicDefinitions]: Omit<
6772
- ArrayOfEntry<IntrinsicDefinitions[K]>,
6773
- 'validation' | 'initialValue'
6774
- > & {
6775
- validation?: SchemaValidationValue
6776
- initialValue?: InitialValueProperty<any, any>
6777
- }
6778
- }
6779
-
6780
- /**
6781
- * `IntrinsicDefinitions` is a lookup map for "predefined" schema definitions.
6782
- * Schema types in `IntrinsicDefinitions` will have good type-completion and type-safety in {@link defineType},
6783
- * {@link defineField} and {@link defineArrayMember} once the `type` property is provided.
6784
- *
6785
- * By default, `IntrinsicDefinitions` contains all standard Sanity schema types (`array`, `string`, `number` ect),
6786
- * but it is an interface and as such, open for extension.
6787
- *
6788
- * This type can be extended using declaration merging; this way new entries can be added.
6789
- * See {@link defineType} for examples on how this can be accomplished.
6790
- *
6791
- * @see defineType
6792
- *
6793
- * @public
6794
- */
6795
- declare interface IntrinsicDefinitions {
6796
- array: ArrayDefinition
6797
- block: BlockDefinition
6798
- boolean: BooleanDefinition
6799
- date: DateDefinition
6800
- datetime: DatetimeDefinition
6801
- document: DocumentDefinition
6802
- file: FileDefinition
6803
- geopoint: GeopointDefinition
6804
- image: ImageDefinition
6805
- number: NumberDefinition
6806
- object: ObjectDefinition
6807
- reference: ReferenceDefinition
6808
- crossDatasetReference: CrossDatasetReferenceDefinition
6809
- globalDocumentReference: GlobalDocumentReferenceDefinition
6810
- slug: SlugDefinition
6811
- string: StringDefinition
6812
- text: TextDefinition
6813
- url: UrlDefinition
6814
- email: EmailDefinition
6815
- }
6816
-
6817
- /**
6818
- * A union of all intrinsic types allowed natively in the schema.
6819
- *
6820
- * @see IntrinsicDefinitions
6821
- *
6822
- * @public
6823
- */
6824
- declare type IntrinsicTypeName =
6825
- IntrinsicDefinitions[keyof IntrinsicDefinitions]['type']
6826
-
6827
5784
  /**
6828
5785
  * The editor has an invalid value
6829
5786
  * @beta */
@@ -6872,11 +5829,6 @@ declare type KeyboardBehaviorEvent =
6872
5829
  >
6873
5830
  }
6874
5831
 
6875
- /** @public */
6876
- declare type KeyedSegment = {
6877
- _key: string
6878
- }
6879
-
6880
5832
  /**
6881
5833
  * @public
6882
5834
  */
@@ -6891,22 +5843,6 @@ export declare type LoadingChange = {
6891
5843
  isLoading: boolean
6892
5844
  }
6893
5845
 
6894
- /**
6895
- * Holds localized validation messages for a given field.
6896
- *
6897
- * @example Custom message for English (US) and Norwegian (Bokmål):
6898
- * ```
6899
- * {
6900
- * 'en-US': 'Needs to start with a capital letter',
6901
- * 'no-NB': 'Må starte med stor bokstav',
6902
- * }
6903
- * ```
6904
- * @public
6905
- */
6906
- declare interface LocalizedValidationMessages {
6907
- [locale: string]: string
6908
- }
6909
-
6910
5846
  declare type MIMEType = `${string}/${string}`
6911
5847
 
6912
5848
  declare type MouseBehaviorEvent = {
@@ -6914,21 +5850,6 @@ declare type MouseBehaviorEvent = {
6914
5850
  position: EventPosition
6915
5851
  }
6916
5852
 
6917
- /** @public */
6918
- declare interface MultiFieldSet {
6919
- name: string
6920
- title?: string
6921
- description?: string
6922
- single?: false
6923
- group?: string | string[]
6924
- options?: CollapseOptions & {
6925
- columns?: number
6926
- }
6927
- fields: ObjectField[]
6928
- hidden?: ConditionalProperty
6929
- readOnly?: ConditionalProperty
6930
- }
6931
-
6932
5853
  /**
6933
5854
  * The editor has mutated it's content.
6934
5855
  * @beta */
@@ -7005,114 +5926,10 @@ declare const nativeBehaviorEventTypes: readonly [
7005
5926
  'mouse.click',
7006
5927
  ]
7007
5928
 
7008
- /** @public */
7009
- declare interface NumberDefinition extends BaseSchemaDefinition {
7010
- type: 'number'
7011
- options?: NumberOptions
7012
- placeholder?: string
7013
- validation?: ValidationBuilder<NumberRule, number>
7014
- initialValue?: InitialValueProperty<any, number>
7015
- }
7016
-
7017
- /** @public */
7018
- declare interface NumberOptions
7019
- extends EnumListProps<number>,
7020
- BaseSchemaTypeOptions {}
7021
-
7022
- /** @public */
7023
- declare interface NumberRule extends RuleDef<NumberRule, number> {
7024
- min: (minNumber: number | FieldReference) => NumberRule
7025
- max: (maxNumber: number | FieldReference) => NumberRule
7026
- lessThan: (limit: number | FieldReference) => NumberRule
7027
- greaterThan: (limit: number | FieldReference) => NumberRule
7028
- integer: () => NumberRule
7029
- precision: (limit: number | FieldReference) => NumberRule
7030
- positive: () => NumberRule
7031
- negative: () => NumberRule
7032
- }
7033
-
7034
- /** @public */
7035
- declare interface NumberSchemaType extends BaseSchemaType {
7036
- jsonType: 'number'
7037
- options?: NumberOptions
7038
- initialValue?: InitialValueProperty<any, number>
7039
- }
7040
-
7041
5929
  declare type ObjectBlockWithOptionalKey = Omit<PortableTextObject, '_key'> & {
7042
5930
  _key?: PortableTextObject['_key']
7043
5931
  }
7044
5932
 
7045
- /** @public */
7046
- declare interface ObjectDefinition extends BaseSchemaDefinition {
7047
- type: 'object'
7048
- /**
7049
- * Object must have at least one field. This is validated at Studio startup.
7050
- */
7051
- fields: FieldDefinition[]
7052
- groups?: FieldGroupDefinition[]
7053
- fieldsets?: FieldsetDefinition[]
7054
- preview?: PreviewConfig
7055
- options?: ObjectOptions
7056
- validation?: ValidationBuilder<ObjectRule, Record<string, unknown>>
7057
- initialValue?: InitialValueProperty<any, Record<string, unknown>>
7058
- }
7059
-
7060
- /** @public */
7061
- declare interface ObjectField<T extends SchemaType = SchemaType> {
7062
- name: string
7063
- fieldset?: string
7064
- group?: string | string[]
7065
- type: ObjectFieldType<T>
7066
- }
7067
-
7068
- /** @public */
7069
- declare type ObjectFieldType<T extends SchemaType = SchemaType> = T & {
7070
- hidden?: ConditionalProperty
7071
- readOnly?: ConditionalProperty
7072
- }
7073
-
7074
- /** @public */
7075
- declare interface ObjectOptions extends BaseSchemaTypeOptions {
7076
- collapsible?: boolean
7077
- collapsed?: boolean
7078
- columns?: number
7079
- modal?: {
7080
- type?: 'dialog' | 'popover'
7081
- width?: number | number[] | 'auto'
7082
- }
7083
- }
7084
-
7085
- /** @public */
7086
- declare interface ObjectRule
7087
- extends RuleDef<ObjectRule, Record<string, unknown>> {}
7088
-
7089
- /** @public */
7090
- declare interface ObjectSchemaType extends BaseSchemaType {
7091
- jsonType: 'object'
7092
- fields: ObjectField[]
7093
- groups?: FieldGroup[]
7094
- fieldsets?: Fieldset[]
7095
- initialValue?: InitialValueProperty<any, Record<string, unknown>>
7096
- weak?: boolean
7097
- /** @deprecated Unused. Use the new field-level search config. */
7098
- __experimental_search?: {
7099
- path: (string | number)[]
7100
- weight: number
7101
- mapWith?: string
7102
- }[]
7103
- /** @alpha */
7104
- __experimental_omnisearch_visibility?: boolean
7105
- /** @alpha */
7106
- __experimental_actions?: string[]
7107
- /** @alpha */
7108
- __experimental_formPreviewTitle?: boolean
7109
- /**
7110
- * @beta
7111
- */
7112
- orderings?: SortOrdering[]
7113
- options?: any
7114
- }
7115
-
7116
5933
  /** @beta */
7117
5934
  export declare type OnBeforeInputFn = (event: InputEvent) => void
7118
5935
 
@@ -7182,12 +5999,6 @@ export declare type PatchObservable = Observable<{
7182
5999
  snapshot: PortableTextBlock[] | undefined
7183
6000
  }>
7184
6001
 
7185
- /** @public */
7186
- declare type Path = PathSegment[]
7187
-
7188
- /** @public */
7189
- declare type PathSegment = string | number | KeyedSegment | IndexTuple
7190
-
7191
6002
  /**
7192
6003
  * @internal
7193
6004
  */
@@ -7197,13 +6008,9 @@ declare type PickFromUnion<
7197
6008
  TPickedTags extends TUnion[TTagKey],
7198
6009
  > = TUnion extends Record<TTagKey, TPickedTags> ? TUnion : never
7199
6010
 
7200
- /** @alpha */
7201
- export declare type PortableTextBlock =
7202
- | PortableTextTextBlock
7203
- | PortableTextObject
6011
+ export {PortableTextBlock}
7204
6012
 
7205
- /** @alpha */
7206
- export declare type PortableTextChild = PortableTextObject | PortableTextSpan
6013
+ export {PortableTextChild}
7207
6014
 
7208
6015
  /**
7209
6016
  * @public
@@ -7358,9 +6165,9 @@ export declare class PortableTextEditor extends Component<
7358
6165
  path: Path,
7359
6166
  ) => [
7360
6167
  (
7361
- | PortableTextTextBlock_2<PortableTextObject | PortableTextSpan_2>
6168
+ | PortableTextTextBlock<PortableTextObject | PortableTextSpan>
7362
6169
  | PortableTextObject
7363
- | PortableTextSpan_2
6170
+ | PortableTextSpan
7364
6171
  | undefined
7365
6172
  ),
7366
6173
  Path | undefined,
@@ -7756,12 +6563,6 @@ export declare type PortableTextEditorProps<
7756
6563
  }
7757
6564
  >
7758
6565
 
7759
- /** @alpha */
7760
- declare interface PortableTextListBlock extends PortableTextTextBlock {
7761
- listItem: string
7762
- level: number
7763
- }
7764
-
7765
6566
  /** @beta */
7766
6567
  export declare type PortableTextMemberSchemaTypes = {
7767
6568
  annotations: (ObjectSchemaType & {
@@ -7777,13 +6578,6 @@ export declare type PortableTextMemberSchemaTypes = {
7777
6578
  lists: BlockListDefinition[]
7778
6579
  }
7779
6580
 
7780
- /** @alpha */
7781
- declare interface PortableTextObject {
7782
- _type: string
7783
- _key: string
7784
- [other: string]: unknown
7785
- }
7786
-
7787
6581
  declare interface PortableTextSlateEditor extends ReactEditor {
7788
6582
  _key: 'editor'
7789
6583
  _type: 'editor'
@@ -7817,56 +6611,7 @@ declare interface PortableTextSlateEditor extends ReactEditor {
7817
6611
  redo: () => void
7818
6612
  }
7819
6613
 
7820
- /** @alpha */
7821
- export declare interface PortableTextSpan {
7822
- _key: string
7823
- _type: 'span'
7824
- text: string
7825
- marks?: string[]
7826
- }
7827
-
7828
- /** @alpha */
7829
- declare interface PortableTextTextBlock<
7830
- TChild = PortableTextSpan | PortableTextObject,
7831
- > {
7832
- _type: string
7833
- _key: string
7834
- children: TChild[]
7835
- markDefs?: PortableTextObject[]
7836
- listItem?: string
7837
- style?: string
7838
- level?: number
7839
- }
7840
-
7841
- /** @public */
7842
- declare interface PrepareViewOptions {
7843
- /** @beta */
7844
- ordering?: SortOrdering
7845
- }
7846
-
7847
- /** @public */
7848
- declare interface PreviewConfig<
7849
- Select extends Record<string, string> = Record<string, string>,
7850
- PrepareValue extends Record<keyof Select, any> = Record<keyof Select, any>,
7851
- > {
7852
- select?: Select
7853
- prepare?: (
7854
- value: PrepareValue,
7855
- viewOptions?: PrepareViewOptions,
7856
- ) => PreviewValue
7857
- }
7858
-
7859
- /** @public */
7860
- declare interface PreviewValue {
7861
- _id?: string
7862
- _createdAt?: string
7863
- _updatedAt?: string
7864
- title?: string
7865
- subtitle?: string
7866
- description?: string
7867
- media?: ReactNode | ElementType
7868
- imageUrl?: string
7869
- }
6614
+ export {PortableTextSpan}
7870
6615
 
7871
6616
  /**
7872
6617
  * A range decoration is a UI affordance that wraps a given selection range in the editor
@@ -7927,111 +6672,6 @@ export declare type RedoChange = {
7927
6672
  timestamp: Date
7928
6673
  }
7929
6674
 
7930
- /** @public */
7931
- declare interface Reference {
7932
- _type: string
7933
- _ref: string
7934
- _key?: string
7935
- _weak?: boolean
7936
- _strengthenOnPublish?: {
7937
- type: string
7938
- weak?: boolean
7939
- template?: {
7940
- id: string
7941
- params: Record<string, string | number | boolean>
7942
- }
7943
- }
7944
- }
7945
-
7946
- /** @public */
7947
- declare interface ReferenceBaseOptions extends BaseSchemaTypeOptions {
7948
- disableNew?: boolean
7949
- }
7950
-
7951
- /** @public */
7952
- declare interface ReferenceDefinition extends BaseSchemaDefinition {
7953
- type: 'reference'
7954
- to: ReferenceTo
7955
- weak?: boolean
7956
- options?: ReferenceOptions
7957
- validation?: ValidationBuilder<ReferenceRule, ReferenceValue>
7958
- initialValue?: InitialValueProperty<any, Omit<ReferenceValue, '_type'>>
7959
- }
7960
-
7961
- /** @public */
7962
- declare type ReferenceFilterOptions =
7963
- | ReferenceFilterResolverOptions
7964
- | ReferenceFilterQueryOptions
7965
-
7966
- /** @public */
7967
- declare interface ReferenceFilterQueryOptions {
7968
- filter: string
7969
- filterParams?: Record<string, unknown>
7970
- }
7971
-
7972
- /** @public */
7973
- declare type ReferenceFilterResolver = (
7974
- context: ReferenceFilterResolverContext,
7975
- ) => ReferenceFilterSearchOptions | Promise<ReferenceFilterSearchOptions>
7976
-
7977
- /** @public */
7978
- declare interface ReferenceFilterResolverContext {
7979
- document: SanityDocument
7980
- parent?: Record<string, unknown> | Record<string, unknown>[]
7981
- parentPath: Path
7982
- getClient: (options: {apiVersion: string}) => SanityClient
7983
- }
7984
-
7985
- /** @public */
7986
- declare interface ReferenceFilterResolverOptions {
7987
- filter?: ReferenceFilterResolver
7988
- filterParams?: never
7989
- }
7990
-
7991
- /** @public */
7992
- declare type ReferenceFilterSearchOptions = {
7993
- filter?: string
7994
- params?: Record<string, unknown>
7995
- tag?: string
7996
- maxFieldDepth?: number
7997
- strategy?: SearchStrategy
7998
- perspective?: ClientPerspective
7999
- }
8000
-
8001
- /**
8002
- * Types are closed for extension. To add properties via declaration merging to this type,
8003
- * redeclare and add the properties to the interfaces that make up ReferenceOptions type.
8004
- *
8005
- * @see ReferenceFilterOptions
8006
- * @see ReferenceFilterResolverOptions
8007
- * @see ReferenceBaseOptions
8008
- *
8009
- * @public
8010
- */
8011
- declare type ReferenceOptions = ReferenceBaseOptions & ReferenceFilterOptions
8012
-
8013
- /** @public */
8014
- declare interface ReferenceRule
8015
- extends RuleDef<ReferenceRule, ReferenceValue> {}
8016
-
8017
- /** @public */
8018
- declare interface ReferenceSchemaType
8019
- extends Omit<ObjectSchemaType, 'options'> {
8020
- jsonType: 'object'
8021
- to: ObjectSchemaType[]
8022
- weak?: boolean
8023
- options?: ReferenceOptions
8024
- }
8025
-
8026
- /** @public */
8027
- declare type ReferenceTo =
8028
- | SchemaTypeDefinition
8029
- | TypeReference
8030
- | Array<SchemaTypeDefinition | TypeReference>
8031
-
8032
- /** @public */
8033
- declare type ReferenceValue = Reference
8034
-
8035
6675
  /** @beta */
8036
6676
  export declare type RenderAnnotationFunction = (
8037
6677
  props: BlockAnnotationRenderProps,
@@ -8095,307 +6735,6 @@ declare type ResolveBehaviorEvent<
8095
6735
  ? PickFromUnion<BehaviorEvent, 'type', TBehaviorEventType>
8096
6736
  : never
8097
6737
 
8098
- /** @public */
8099
- declare interface Role {
8100
- name: string
8101
- title: string
8102
- description?: string
8103
- }
8104
-
8105
- /** @public */
8106
- declare interface Rule {
8107
- /**
8108
- * @internal
8109
- * @deprecated internal use only
8110
- */
8111
- _type: RuleTypeConstraint | undefined
8112
- /**
8113
- * @internal
8114
- * @deprecated internal use only
8115
- */
8116
- _level: 'error' | 'warning' | 'info' | undefined
8117
- /**
8118
- * @internal
8119
- * @deprecated internal use only
8120
- */
8121
- _required: 'required' | 'optional' | undefined
8122
- /**
8123
- * @internal
8124
- * @deprecated internal use only
8125
- */
8126
- _typeDef: SchemaType | undefined
8127
- /**
8128
- * @internal
8129
- * @deprecated internal use only
8130
- */
8131
- _message: string | LocalizedValidationMessages | undefined
8132
- /**
8133
- * @internal
8134
- * @deprecated internal use only
8135
- */
8136
- _rules: RuleSpec[]
8137
- /**
8138
- * @internal
8139
- * @deprecated internal use only
8140
- */
8141
- _fieldRules: FieldRules | undefined
8142
- /**
8143
- * Takes in a path and returns an object with a symbol.
8144
- *
8145
- * When the validation lib sees this symbol, it will use the provided path to
8146
- * get a value from the current field's parent and use that value as the input
8147
- * to the Rule.
8148
- *
8149
- * The path that's given is forwarded to `lodash/get`
8150
- *
8151
- * ```js
8152
- * fields: [
8153
- * // ...
8154
- * {
8155
- * // ...
8156
- * name: 'highestTemperature',
8157
- * type: 'number',
8158
- * validation: (Rule) => Rule.positive().min(Rule.valueOfField('lowestTemperature')),
8159
- * // ...
8160
- * },
8161
- * ]
8162
- * ```
8163
- */
8164
- valueOfField: (path: string | string[]) => FieldReference
8165
- error(message?: string | LocalizedValidationMessages): Rule
8166
- warning(message?: string | LocalizedValidationMessages): Rule
8167
- info(message?: string | LocalizedValidationMessages): Rule
8168
- reset(): this
8169
- isRequired(): boolean
8170
- clone(): Rule
8171
- cloneWithRules(rules: RuleSpec[]): Rule
8172
- merge(rule: Rule): Rule
8173
- type(targetType: RuleTypeConstraint | Lowercase<RuleTypeConstraint>): Rule
8174
- all(children: Rule[]): Rule
8175
- either(children: Rule[]): Rule
8176
- optional(): Rule
8177
- required(): Rule
8178
- custom<T = unknown>(
8179
- fn: CustomValidator<T>,
8180
- options?: {
8181
- bypassConcurrencyLimit?: boolean
8182
- },
8183
- ): Rule
8184
- min(len: number | string | FieldReference): Rule
8185
- max(len: number | string | FieldReference): Rule
8186
- length(len: number | FieldReference): Rule
8187
- valid(value: unknown | unknown[]): Rule
8188
- integer(): Rule
8189
- precision(limit: number | FieldReference): Rule
8190
- positive(): Rule
8191
- negative(): Rule
8192
- greaterThan(num: number | FieldReference): Rule
8193
- lessThan(num: number | FieldReference): Rule
8194
- uppercase(): Rule
8195
- lowercase(): Rule
8196
- regex(
8197
- pattern: RegExp,
8198
- name: string,
8199
- options: {
8200
- name?: string
8201
- invert?: boolean
8202
- },
8203
- ): Rule
8204
- regex(
8205
- pattern: RegExp,
8206
- options: {
8207
- name?: string
8208
- invert?: boolean
8209
- },
8210
- ): Rule
8211
- regex(pattern: RegExp, name: string): Rule
8212
- regex(pattern: RegExp): Rule
8213
- email(): Rule
8214
- uri(options?: UriValidationOptions): Rule
8215
- unique(): Rule
8216
- reference(): Rule
8217
- fields(rules: FieldRules): Rule
8218
- assetRequired(): Rule
8219
- validate(
8220
- value: unknown,
8221
- options: ValidationContext & {
8222
- /**
8223
- * @deprecated Internal use only
8224
- * @internal
8225
- */
8226
- __internal?: {
8227
- customValidationConcurrencyLimiter?: {
8228
- ready: () => Promise<void>
8229
- release: () => void
8230
- }
8231
- }
8232
- },
8233
- ): Promise<ValidationMarker[]>
8234
- }
8235
-
8236
- /** @public */
8237
- declare type RuleBuilder<
8238
- T extends RuleDef<T, FieldValue>,
8239
- FieldValue = unknown,
8240
- > = T | T[]
8241
-
8242
- /** @public */
8243
- declare interface RuleDef<T, FieldValue = unknown> {
8244
- required: () => T
8245
- custom: <LenientFieldValue extends FieldValue>(
8246
- fn: CustomValidator<LenientFieldValue | undefined>,
8247
- ) => T
8248
- info: (message?: string | LocalizedValidationMessages) => T
8249
- error: (message?: string | LocalizedValidationMessages) => T
8250
- warning: (message?: string | LocalizedValidationMessages) => T
8251
- valueOfField: (path: string | string[]) => FieldReference
8252
- }
8253
-
8254
- /** @public */
8255
- declare type RuleSpec =
8256
- | {
8257
- flag: 'integer'
8258
- }
8259
- | {
8260
- flag: 'email'
8261
- }
8262
- | {
8263
- flag: 'unique'
8264
- }
8265
- | {
8266
- flag: 'reference'
8267
- }
8268
- | {
8269
- flag: 'type'
8270
- constraint: RuleTypeConstraint
8271
- }
8272
- | {
8273
- flag: 'all'
8274
- constraint: Rule[]
8275
- }
8276
- | {
8277
- flag: 'either'
8278
- constraint: Rule[]
8279
- }
8280
- | {
8281
- flag: 'presence'
8282
- constraint: 'optional' | 'required'
8283
- }
8284
- | {
8285
- flag: 'custom'
8286
- constraint: CustomValidator
8287
- }
8288
- | {
8289
- flag: 'min'
8290
- constraint: number | string
8291
- }
8292
- | {
8293
- flag: 'max'
8294
- constraint: number | string
8295
- }
8296
- | {
8297
- flag: 'length'
8298
- constraint: number
8299
- }
8300
- | {
8301
- flag: 'valid'
8302
- constraint: unknown[]
8303
- }
8304
- | {
8305
- flag: 'precision'
8306
- constraint: number
8307
- }
8308
- | {
8309
- flag: 'lessThan'
8310
- constraint: number
8311
- }
8312
- | {
8313
- flag: 'greaterThan'
8314
- constraint: number
8315
- }
8316
- | {
8317
- flag: 'stringCasing'
8318
- constraint: 'uppercase' | 'lowercase'
8319
- }
8320
- | {
8321
- flag: 'assetRequired'
8322
- constraint: {
8323
- assetType: 'asset' | 'image' | 'file'
8324
- }
8325
- }
8326
- | {
8327
- flag: 'regex'
8328
- constraint: {
8329
- pattern: RegExp
8330
- name?: string
8331
- invert: boolean
8332
- }
8333
- }
8334
- | {
8335
- flag: 'uri'
8336
- constraint: {
8337
- options: {
8338
- scheme: RegExp[]
8339
- allowRelative: boolean
8340
- relativeOnly: boolean
8341
- allowCredentials: boolean
8342
- }
8343
- }
8344
- }
8345
-
8346
- /** @public */
8347
- declare type RuleTypeConstraint =
8348
- | 'Array'
8349
- | 'Boolean'
8350
- | 'Date'
8351
- | 'Number'
8352
- | 'Object'
8353
- | 'String'
8354
-
8355
- /**
8356
- * Options for configuring how Sanity Create interfaces with the type or field.
8357
- *
8358
- * @public
8359
- */
8360
- declare interface SanityCreateOptions {
8361
- /** Set to true to exclude a type or field from appearing in Sanity Create */
8362
- exclude?: boolean
8363
- /**
8364
- * A short description of what the type or field is used for.
8365
- * Purpose can be used to improve how and when content mapping uses the field.
8366
- * */
8367
- purpose?: string
8368
- }
8369
-
8370
- /** @public */
8371
- declare interface SanityDocument {
8372
- _id: string
8373
- _type: string
8374
- _createdAt: string
8375
- _updatedAt: string
8376
- _rev: string
8377
- [key: string]: unknown
8378
- }
8379
-
8380
- /** @public */
8381
- declare interface Schema {
8382
- /** @internal */
8383
- _original?: {
8384
- name: string
8385
- types: SchemaTypeDefinition[]
8386
- }
8387
- /** @internal */
8388
- _registry: {
8389
- [typeName: string]: any
8390
- }
8391
- /** @internal */
8392
- _validation?: SchemaValidationProblemGroup[]
8393
- name: string
8394
- get: (name: string) => SchemaType | undefined
8395
- has: (name: string) => boolean
8396
- getTypeNames: () => string[]
8397
- }
8398
-
8399
6738
  /**
8400
6739
  * @public
8401
6740
  */
@@ -8405,159 +6744,29 @@ export declare type SchemaDefinition<
8405
6744
  decorators?: ReadonlyArray<TBaseDefinition>
8406
6745
  blockObjects?: ReadonlyArray<
8407
6746
  TBaseDefinition & {
8408
- fields?: ReadonlyArray<FieldDefinition_2>
6747
+ fields?: ReadonlyArray<FieldDefinition>
8409
6748
  }
8410
6749
  >
8411
6750
  inlineObjects?: ReadonlyArray<
8412
6751
  TBaseDefinition & {
8413
- fields?: ReadonlyArray<FieldDefinition_2>
6752
+ fields?: ReadonlyArray<FieldDefinition>
8414
6753
  }
8415
6754
  >
8416
6755
  annotations?: ReadonlyArray<
8417
6756
  TBaseDefinition & {
8418
- fields?: ReadonlyArray<FieldDefinition_2>
6757
+ fields?: ReadonlyArray<FieldDefinition>
8419
6758
  }
8420
6759
  >
8421
6760
  lists?: ReadonlyArray<TBaseDefinition>
8422
6761
  styles?: ReadonlyArray<TBaseDefinition>
8423
6762
  }
8424
6763
 
8425
- /**
8426
- * Note: you probably want `SchemaTypeDefinition` instead
8427
- * @see SchemaTypeDefinition
8428
- *
8429
- * @public
8430
- */
8431
- declare type SchemaType =
8432
- | ArraySchemaType
8433
- | BooleanSchemaType
8434
- | FileSchemaType
8435
- | NumberSchemaType
8436
- | ObjectSchemaType
8437
- | StringSchemaType
8438
- | ReferenceSchemaType
8439
-
8440
- /**
8441
- * Represents a Sanity schema type definition with an optional type parameter.
8442
- *
8443
- * It's recommend to use the `defineType` helper instead of this type by
8444
- * itself.
8445
- *
8446
- * @see defineType
8447
- *
8448
- * @public
8449
- */
8450
- declare type SchemaTypeDefinition<
8451
- TType extends IntrinsicTypeName = IntrinsicTypeName,
8452
- > = IntrinsicDefinitions[IntrinsicTypeName] | TypeAliasDefinition<string, TType>
8453
-
8454
- /** @public */
8455
- declare interface SchemaValidationError {
8456
- helpId?: string
8457
- message: string
8458
- severity: 'error'
8459
- }
8460
-
8461
- /** @internal */
8462
- declare type SchemaValidationProblem =
8463
- | SchemaValidationError
8464
- | SchemaValidationWarning
8465
-
8466
- /** @internal */
8467
- declare interface SchemaValidationProblemGroup {
8468
- path: SchemaValidationProblemPath
8469
- problems: SchemaValidationProblem[]
8470
- }
8471
-
8472
- /** @internal */
8473
- declare type SchemaValidationProblemPath = Array<
8474
- | {
8475
- kind: 'type'
8476
- type: string
8477
- name?: string
8478
- }
8479
- | {
8480
- kind: 'property'
8481
- name: string
8482
- }
8483
- >
8484
-
8485
- /**
8486
- * Represents the possible values of a schema type's `validation` field.
8487
- *
8488
- * If the schema has not been run through `inferFromSchema` from
8489
- * `sanity/validation` then value could be a function.
8490
- *
8491
- * `inferFromSchema` mutates the schema converts this value to an array of
8492
- * `Rule` instances.
8493
- *
8494
- * @privateRemarks
8495
- *
8496
- * Usage of the schema inside the studio will almost always be from the compiled
8497
- * `createSchema` function. In this case, you can cast the value or throw to
8498
- * narrow the type. E.g.:
8499
- *
8500
- * ```ts
8501
- * if (typeof type.validation === 'function') {
8502
- * throw new Error(
8503
- * `Schema type "${type.name}"'s \`validation\` was not run though \`inferFromSchema\``
8504
- * )
8505
- * }
8506
- * ```
8507
- *
8508
- * @public
8509
- */
8510
- declare type SchemaValidationValue =
8511
- | false
8512
- | undefined
8513
- | Rule
8514
- | SchemaValidationValue[]
8515
- | ((rule: Rule) => SchemaValidationValue)
8516
-
8517
- /** @internal */
8518
- declare interface SchemaValidationWarning {
8519
- helpId?: string
8520
- message: string
8521
- severity: 'warning'
8522
- }
8523
-
8524
6764
  /** @beta */
8525
6765
  export declare type ScrollSelectionIntoViewFunction = (
8526
6766
  editor: PortableTextEditor,
8527
6767
  domRange: globalThis.Range,
8528
6768
  ) => void
8529
6769
 
8530
- /** @public */
8531
- declare interface SearchConfiguration {
8532
- search?: {
8533
- /**
8534
- * Defines a search weight for this field to prioritize its importance
8535
- * during search operations in the Studio. This setting allows the specified
8536
- * field to be ranked higher in search results compared to other fields.
8537
- *
8538
- * By default, all fields are assigned a weight of 1. However, if a field is
8539
- * chosen as the `title` in the preview configuration's `select` option, it
8540
- * will automatically receive a default weight of 10. Similarly, if selected
8541
- * as the `subtitle`, the default weight is 5. Fields marked as
8542
- * `hidden: true` (no function) are assigned a weight of 0 by default.
8543
- *
8544
- * Note: Search weight configuration is currently supported only for fields
8545
- * of type string or portable text arrays.
8546
- */
8547
- weight?: number
8548
- }
8549
- }
8550
-
8551
- /**
8552
- * @public
8553
- */
8554
- declare const searchStrategies: readonly ['groqLegacy', 'groq2024']
8555
-
8556
- /**
8557
- * @public
8558
- */
8559
- declare type SearchStrategy = (typeof searchStrategies)[number]
8560
-
8561
6770
  /**
8562
6771
  * The editor has a new selection
8563
6772
  * @beta */
@@ -8578,164 +6787,13 @@ declare type Serializer<TMIMEType extends MIMEType> = ({
8578
6787
  'serialization.success' | 'serialization.failure'
8579
6788
  >
8580
6789
 
8581
- /** @public */
8582
- declare interface SingleFieldSet {
8583
- single: true
8584
- field: ObjectField
8585
- hidden?: ConditionalProperty
8586
- readOnly?: ConditionalProperty
8587
- group?: string | string[]
8588
- }
8589
-
8590
6790
  declare type SlateEditor = {
8591
6791
  instance: PortableTextSlateEditor
8592
6792
  initialValue: Array<Descendant>
8593
6793
  }
8594
6794
 
8595
- /** @public */
8596
- declare interface SlugDefinition extends BaseSchemaDefinition {
8597
- type: 'slug'
8598
- options?: SlugOptions
8599
- validation?: ValidationBuilder<SlugRule, SlugValue>
8600
- initialValue?: InitialValueProperty<any, Omit<SlugValue, '_type'>>
8601
- }
8602
-
8603
- /** @public */
8604
- declare type SlugifierFn = (
8605
- source: string,
8606
- schemaType: SlugSchemaType,
8607
- context: SlugSourceContext,
8608
- ) => string | Promise<string>
8609
-
8610
- /** @public */
8611
- declare type SlugIsUniqueValidator = (
8612
- slug: string,
8613
- context: SlugValidationContext,
8614
- ) => boolean | Promise<boolean>
8615
-
8616
- /** @public */
8617
- declare interface SlugOptions
8618
- extends SearchConfiguration,
8619
- BaseSchemaTypeOptions {
8620
- source?: string | Path | SlugSourceFn
8621
- maxLength?: number
8622
- slugify?: SlugifierFn
8623
- isUnique?: SlugIsUniqueValidator
8624
- disableArrayWarning?: boolean
8625
- }
8626
-
8627
- /** @public */
8628
- declare type SlugParent = Record<string, unknown> | Record<string, unknown>[]
8629
-
8630
- /** @public */
8631
- declare interface SlugRule extends RuleDef<SlugRule, SlugValue> {}
8632
-
8633
- /** @public */
8634
- declare interface SlugSchemaType extends ObjectSchemaType {
8635
- jsonType: 'object'
8636
- options?: SlugOptions
8637
- }
8638
-
8639
- /** @public */
8640
- declare interface SlugSourceContext {
8641
- parentPath: Path
8642
- parent: SlugParent
8643
- projectId: string
8644
- dataset: string
8645
- schema: Schema
8646
- currentUser: CurrentUser | null
8647
- getClient: (options: {apiVersion: string}) => SanityClient
8648
- }
8649
-
8650
- /** @public */
8651
- declare type SlugSourceFn = (
8652
- document: SanityDocument,
8653
- context: SlugSourceContext,
8654
- ) => string | Promise<string>
8655
-
8656
- /** @public */
8657
- declare interface SlugValidationContext extends ValidationContext {
8658
- parent: SlugParent
8659
- type: SlugSchemaType
8660
- defaultIsUnique: SlugIsUniqueValidator
8661
- }
8662
-
8663
- /** @public */
8664
- declare interface SlugValue {
8665
- _type: 'slug'
8666
- current?: string
8667
- }
8668
-
8669
- /** @beta */
8670
- declare type SortOrdering = {
8671
- title: string
8672
- i18n?: I18nTextRecord<'title'>
8673
- name: string
8674
- by: SortOrderingItem[]
8675
- }
8676
-
8677
- /** @beta */
8678
- declare interface SortOrderingItem {
8679
- field: string
8680
- direction: 'asc' | 'desc'
8681
- }
8682
-
8683
6795
  declare type StrictExtract<T, U extends T> = U
8684
6796
 
8685
- /** @public */
8686
- declare interface StringDefinition extends BaseSchemaDefinition {
8687
- type: 'string'
8688
- options?: StringOptions
8689
- placeholder?: string
8690
- validation?: ValidationBuilder<StringRule, string>
8691
- initialValue?: InitialValueProperty<any, string>
8692
- }
8693
-
8694
- /** @public */
8695
- declare interface StringOptions
8696
- extends EnumListProps<string>,
8697
- SearchConfiguration,
8698
- BaseSchemaTypeOptions {}
8699
-
8700
- /** @public */
8701
- declare interface StringRule extends RuleDef<StringRule, string> {
8702
- min: (minNumber: number | FieldReference) => StringRule
8703
- max: (maxNumber: number | FieldReference) => StringRule
8704
- length: (exactLength: number | FieldReference) => StringRule
8705
- uppercase: () => StringRule
8706
- lowercase: () => StringRule
8707
- regex(
8708
- pattern: RegExp,
8709
- name: string,
8710
- options: {
8711
- name?: string
8712
- invert?: boolean
8713
- },
8714
- ): StringRule
8715
- regex(
8716
- pattern: RegExp,
8717
- options: {
8718
- name?: string
8719
- invert?: boolean
8720
- },
8721
- ): StringRule
8722
- regex(pattern: RegExp, name: string): StringRule
8723
- regex(pattern: RegExp): StringRule
8724
- email(): StringRule
8725
- }
8726
-
8727
- /**
8728
- * This is used for string, text, date and datetime.
8729
- * This interface represent the compiled version at runtime, when accessed through Schema.
8730
- *
8731
- * @public
8732
- */
8733
- declare interface StringSchemaType extends BaseSchemaType {
8734
- jsonType: 'string'
8735
- options?: StringOptions & TextOptions & DateOptions & DatetimeOptions
8736
- initialValue?: InitialValueProperty<any, string>
8737
- }
8738
-
8739
6797
  /**
8740
6798
  * @beta
8741
6799
  */
@@ -8885,80 +6943,6 @@ declare type TextBlockWithOptionalKey = Omit<PortableTextTextBlock, '_key'> & {
8885
6943
  _key?: PortableTextTextBlock['_key']
8886
6944
  }
8887
6945
 
8888
- /** @public */
8889
- declare interface TextDefinition extends BaseSchemaDefinition {
8890
- type: 'text'
8891
- rows?: number
8892
- options?: TextOptions
8893
- placeholder?: string
8894
- validation?: ValidationBuilder<TextRule, string>
8895
- initialValue?: InitialValueProperty<any, string>
8896
- }
8897
-
8898
- /** @public */
8899
- declare interface TextOptions extends StringOptions {}
8900
-
8901
- /** @public */
8902
- declare interface TextRule extends StringRule {}
8903
-
8904
- /** @public */
8905
- declare interface TitledListValue<V = unknown> {
8906
- _key?: string
8907
- title: string
8908
- value?: V
8909
- }
8910
-
8911
- /**
8912
- * Represents a type definition that is an alias/extension of an existing type
8913
- * in your schema. Creating a type alias will re-register that existing type
8914
- * under a different name. You can also override the default type options with
8915
- * a type alias definition.
8916
- *
8917
- * @public
8918
- */
8919
- declare interface TypeAliasDefinition<
8920
- TType extends string,
8921
- TAlias extends IntrinsicTypeName | undefined,
8922
- > extends BaseSchemaDefinition {
8923
- type: TType
8924
- options?: TAlias extends IntrinsicTypeName
8925
- ? IntrinsicDefinitions[TAlias]['options']
8926
- : unknown
8927
- validation?: SchemaValidationValue
8928
- initialValue?: InitialValueProperty<any, any>
8929
- preview?: PreviewConfig
8930
- components?: {
8931
- annotation?: ComponentType<any>
8932
- block?: ComponentType<any>
8933
- inlineBlock?: ComponentType<any>
8934
- diff?: ComponentType<any>
8935
- field?: ComponentType<any>
8936
- input?: ComponentType<any>
8937
- item?: ComponentType<any>
8938
- preview?: ComponentType<any>
8939
- }
8940
- }
8941
-
8942
- /** @public */
8943
- declare interface TypedObject {
8944
- [key: string]: unknown
8945
- _type: string
8946
- }
8947
-
8948
- /**
8949
- * Represents a reference to another type registered top-level in your schema.
8950
- *
8951
- * @public
8952
- */
8953
- declare interface TypeReference {
8954
- type: string
8955
- name?: string
8956
- icon?: ComponentType | ReactNode
8957
- options?: {
8958
- [key: string]: unknown
8959
- }
8960
- }
8961
-
8962
6946
  /**
8963
6947
  * The editor performed a undo history step
8964
6948
  * @beta */
@@ -8979,31 +6963,6 @@ declare type UnsetEvent = {
8979
6963
  previousValue: Array<PortableTextBlock>
8980
6964
  }
8981
6965
 
8982
- /** @public */
8983
- declare interface UriValidationOptions {
8984
- scheme?: (string | RegExp) | Array<string | RegExp>
8985
- allowRelative?: boolean
8986
- relativeOnly?: boolean
8987
- allowCredentials?: boolean
8988
- }
8989
-
8990
- /** @public */
8991
- declare interface UrlDefinition extends BaseSchemaDefinition {
8992
- type: 'url'
8993
- options?: UrlOptions
8994
- placeholder?: string
8995
- validation?: ValidationBuilder<UrlRule, string>
8996
- initialValue?: InitialValueProperty<any, string>
8997
- }
8998
-
8999
- /** @public */
9000
- declare interface UrlOptions extends BaseSchemaTypeOptions {}
9001
-
9002
- /** @public */
9003
- declare interface UrlRule extends RuleDef<UrlRule, string> {
9004
- uri(options: UriValidationOptions): UrlRule
9005
- }
9006
-
9007
6966
  /**
9008
6967
  * @public
9009
6968
  * Get the current editor context from the `EditorProvider`.
@@ -9065,103 +7024,6 @@ export declare const usePortableTextEditor: () => PortableTextEditor
9065
7024
  */
9066
7025
  export declare const usePortableTextEditorSelection: () => EditorSelection
9067
7026
 
9068
- /** @public */
9069
- declare type ValidationBuilder<
9070
- T extends RuleDef<T, FieldValue>,
9071
- FieldValue = unknown,
9072
- > = (rule: T) => RuleBuilder<T, FieldValue>
9073
-
9074
- /**
9075
- * A context object passed around during validation. This includes the
9076
- * `Rule.custom` context.
9077
- *
9078
- * e.g.
9079
- *
9080
- * ```js
9081
- * Rule.custom((_, validationContext) => {
9082
- * // ...
9083
- * })`
9084
- * ```
9085
- *
9086
- * @public
9087
- */
9088
- declare interface ValidationContext {
9089
- getClient: (options: {apiVersion: string}) => SanityClient
9090
- schema: Schema
9091
- parent?: unknown
9092
- type?: SchemaType
9093
- document?: SanityDocument
9094
- path?: Path
9095
- getDocumentExists?: (options: {id: string}) => Promise<boolean>
9096
- environment: 'cli' | 'studio'
9097
- }
9098
-
9099
- /**
9100
- * The shape that can be returned from a custom validator to be converted into
9101
- * a validation marker by the validation logic. Inside of a custom validator,
9102
- * you can return an array of these in order to specify multiple paths within
9103
- * an object or array.
9104
- *
9105
- * @public
9106
- */
9107
- declare interface ValidationError {
9108
- /**
9109
- * The message describing why the value is not valid. This message will be
9110
- * included in the validation markers after validation has finished running.
9111
- */
9112
- message: string
9113
- /**
9114
- * If writing a custom validator, you can return validation messages to
9115
- * specific path inside of the current value (object or array) by populating
9116
- * this `path` prop.
9117
- *
9118
- * NOTE: This path is relative to the current value and _not_ relative to
9119
- * the document.
9120
- */
9121
- path?: Path
9122
- /**
9123
- * Same as `path` but allows more than one value. If provided, the same
9124
- * message will create two markers from each path with the same message
9125
- * provided.
9126
- *
9127
- * @deprecated prefer `path`
9128
- */
9129
- paths?: Path[]
9130
- /**
9131
- * @deprecated Unused. Was used to store the results from `.either()` /`.all()`
9132
- */
9133
- children?: ValidationMarker[]
9134
- /**
9135
- * @deprecated Unused. Was used to signal if this error came from an `.either()`/`.all()`.
9136
- */
9137
- operation?: 'AND' | 'OR'
9138
- /**
9139
- * @deprecated Unused. Was relevant when validation error was used as a class.
9140
- */
9141
- cloneWithMessage?(message: string): ValidationError
9142
- }
9143
-
9144
- /** @public */
9145
- declare interface ValidationMarker {
9146
- level: 'error' | 'warning' | 'info'
9147
- /**
9148
- * The validation message for this marker. E.g. "Must be greater than 0"
9149
- */
9150
- message: string
9151
- /**
9152
- * @deprecated use `message` instead
9153
- */
9154
- item?: ValidationError
9155
- /**
9156
- * The sanity path _relative to the root of the current document_ to this
9157
- * marker.
9158
- *
9159
- * NOTE: Sanity paths may contain keyed segments (i.e. `{_key: string}`) that
9160
- * are not compatible with deep getters like lodash/get
9161
- */
9162
- path: Path
9163
- }
9164
-
9165
7027
  /**
9166
7028
  * The editor has received a new (props) value
9167
7029
  * @beta */