@portabletext/editor 1.48.7 → 1.48.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (128) hide show
  1. package/lib/_chunks-cjs/behavior.core.cjs +20 -8
  2. package/lib/_chunks-cjs/behavior.core.cjs.map +1 -1
  3. package/lib/_chunks-cjs/behavior.markdown.cjs +5 -5
  4. package/lib/_chunks-cjs/behavior.markdown.cjs.map +1 -1
  5. package/lib/_chunks-cjs/editor-provider.cjs +121 -90
  6. package/lib/_chunks-cjs/editor-provider.cjs.map +1 -1
  7. package/lib/_chunks-cjs/selector.get-focus-inline-object.cjs +2 -2
  8. package/lib/_chunks-cjs/selector.get-focus-inline-object.cjs.map +1 -1
  9. package/lib/_chunks-cjs/selector.get-text-before.cjs +7 -4
  10. package/lib/_chunks-cjs/selector.get-text-before.cjs.map +1 -1
  11. package/lib/_chunks-cjs/selector.is-overlapping-selection.cjs +63 -47
  12. package/lib/_chunks-cjs/selector.is-overlapping-selection.cjs.map +1 -1
  13. package/lib/_chunks-cjs/selector.is-selecting-entire-blocks.cjs +29 -23
  14. package/lib/_chunks-cjs/selector.is-selecting-entire-blocks.cjs.map +1 -1
  15. package/lib/_chunks-cjs/util.merge-text-blocks.cjs +3 -3
  16. package/lib/_chunks-cjs/util.merge-text-blocks.cjs.map +1 -1
  17. package/lib/_chunks-cjs/util.selection-point-to-block-offset.cjs +15 -15
  18. package/lib/_chunks-cjs/util.selection-point-to-block-offset.cjs.map +1 -1
  19. package/lib/_chunks-cjs/util.slice-blocks.cjs +258 -38
  20. package/lib/_chunks-cjs/util.slice-blocks.cjs.map +1 -1
  21. package/lib/_chunks-es/behavior.core.js +21 -10
  22. package/lib/_chunks-es/behavior.core.js.map +1 -1
  23. package/lib/_chunks-es/behavior.markdown.js +5 -6
  24. package/lib/_chunks-es/behavior.markdown.js.map +1 -1
  25. package/lib/_chunks-es/editor-provider.js +75 -46
  26. package/lib/_chunks-es/editor-provider.js.map +1 -1
  27. package/lib/_chunks-es/selector.get-focus-inline-object.js +1 -2
  28. package/lib/_chunks-es/selector.get-focus-inline-object.js.map +1 -1
  29. package/lib/_chunks-es/selector.get-text-before.js +7 -4
  30. package/lib/_chunks-es/selector.get-text-before.js.map +1 -1
  31. package/lib/_chunks-es/selector.is-overlapping-selection.js +61 -46
  32. package/lib/_chunks-es/selector.is-overlapping-selection.js.map +1 -1
  33. package/lib/_chunks-es/selector.is-selecting-entire-blocks.js +30 -26
  34. package/lib/_chunks-es/selector.is-selecting-entire-blocks.js.map +1 -1
  35. package/lib/_chunks-es/util.merge-text-blocks.js +1 -1
  36. package/lib/_chunks-es/util.selection-point-to-block-offset.js +15 -16
  37. package/lib/_chunks-es/util.selection-point-to-block-offset.js.map +1 -1
  38. package/lib/_chunks-es/util.slice-blocks.js +258 -38
  39. package/lib/_chunks-es/util.slice-blocks.js.map +1 -1
  40. package/lib/behaviors/index.d.cts +2552 -251
  41. package/lib/behaviors/index.d.ts +2552 -251
  42. package/lib/index.cjs +45 -21
  43. package/lib/index.cjs.map +1 -1
  44. package/lib/index.d.cts +2350 -51
  45. package/lib/index.d.ts +2350 -51
  46. package/lib/index.js +44 -21
  47. package/lib/index.js.map +1 -1
  48. package/lib/plugins/index.cjs +16 -7
  49. package/lib/plugins/index.cjs.map +1 -1
  50. package/lib/plugins/index.d.cts +2324 -24
  51. package/lib/plugins/index.d.ts +2324 -24
  52. package/lib/plugins/index.js +16 -7
  53. package/lib/plugins/index.js.map +1 -1
  54. package/lib/selectors/index.cjs +5 -5
  55. package/lib/selectors/index.cjs.map +1 -1
  56. package/lib/selectors/index.d.cts +2321 -28
  57. package/lib/selectors/index.d.ts +2321 -28
  58. package/lib/selectors/index.js +5 -6
  59. package/lib/selectors/index.js.map +1 -1
  60. package/lib/utils/index.cjs +30 -24
  61. package/lib/utils/index.cjs.map +1 -1
  62. package/lib/utils/index.d.cts +2350 -44
  63. package/lib/utils/index.d.ts +2350 -44
  64. package/lib/utils/index.js +30 -24
  65. package/lib/utils/index.js.map +1 -1
  66. package/package.json +1 -2
  67. package/src/behavior-actions/behavior.action.block.unset.ts +1 -1
  68. package/src/behavior-actions/behavior.action.decorator.add.ts +20 -5
  69. package/src/behaviors/behavior.abstract.decorator.ts +1 -1
  70. package/src/behaviors/behavior.abstract.delete.ts +1 -1
  71. package/src/behaviors/behavior.abstract.insert.ts +2 -2
  72. package/src/behaviors/behavior.abstract.select.ts +16 -4
  73. package/src/behaviors/behavior.abstract.split.ts +9 -6
  74. package/src/behaviors/behavior.core.block-objects.ts +5 -5
  75. package/src/behaviors/behavior.core.insert-break.ts +16 -4
  76. package/src/behaviors/behavior.core.lists.ts +4 -6
  77. package/src/behaviors/behavior.decorator-pair.ts +13 -4
  78. package/src/behaviors/behavior.default.ts +1 -1
  79. package/src/behaviors/behavior.markdown.ts +5 -5
  80. package/src/converters/converter.portable-text.ts +1 -1
  81. package/src/converters/converter.text-html.ts +1 -1
  82. package/src/converters/converter.text-plain.ts +4 -4
  83. package/src/editor/plugins/__tests__/withEditableAPIGetFragment.test.tsx +10 -2
  84. package/src/editor/plugins/createWithSchemaTypes.ts +12 -19
  85. package/src/internal-utils/__tests__/dmpToOperations.test.ts +13 -12
  86. package/src/internal-utils/drag-selection.ts +16 -4
  87. package/src/internal-utils/event-position.ts +20 -8
  88. package/src/internal-utils/parse-blocks.ts +17 -5
  89. package/src/internal-utils/validateValue.ts +6 -6
  90. package/src/plugins/plugin.decorator-shortcut.ts +2 -2
  91. package/src/selectors/selector.get-active-annotations.ts +5 -2
  92. package/src/selectors/selector.get-active-list-item.ts +4 -3
  93. package/src/selectors/selector.get-active-style.ts +4 -3
  94. package/src/selectors/selector.get-anchor-text-block.ts +3 -6
  95. package/src/selectors/selector.get-block-offsets.ts +2 -2
  96. package/src/selectors/selector.get-caret-word-selection.ts +11 -5
  97. package/src/selectors/selector.get-selected-slice.ts +1 -1
  98. package/src/selectors/selector.get-selected-spans.ts +11 -15
  99. package/src/selectors/selector.get-selected-text-blocks.ts +3 -3
  100. package/src/selectors/selector.get-selection-text.ts +3 -3
  101. package/src/selectors/selector.get-text-before.ts +5 -2
  102. package/src/selectors/selector.get-trimmed-selection.ts +20 -14
  103. package/src/selectors/selector.is-active-annotation.ts +4 -2
  104. package/src/selectors/selector.is-active-decorator.test.ts +3 -3
  105. package/src/selectors/selector.is-at-the-end-of-block.ts +4 -1
  106. package/src/selectors/selector.is-at-the-start-of-block.ts +4 -1
  107. package/src/selectors/selector.is-point-after-selection.ts +7 -6
  108. package/src/selectors/selector.is-point-before-selection.ts +7 -6
  109. package/src/selectors/selector.is-selecting-entire-blocks.ts +8 -2
  110. package/src/selectors/selectors.ts +25 -28
  111. package/src/utils/util.block-offset-to-block-selection-point.ts +4 -4
  112. package/src/utils/util.block-offset-to-selection-point.ts +5 -5
  113. package/src/utils/util.block-offset.test.ts +219 -156
  114. package/src/utils/util.block-offset.ts +14 -17
  115. package/src/utils/util.block-offsets-to-selection.ts +5 -5
  116. package/src/utils/util.child-selection-point-to-block-offset.ts +7 -10
  117. package/src/utils/util.get-block-end-point.ts +15 -15
  118. package/src/utils/util.get-block-start-point.ts +13 -12
  119. package/src/utils/util.is-empty-text-block.ts +9 -8
  120. package/src/utils/util.selection-point-to-block-offset.ts +4 -4
  121. package/src/utils/util.slice-blocks.test.ts +178 -121
  122. package/src/utils/util.slice-blocks.ts +25 -24
  123. package/src/utils/util.split-text-block.ts +18 -12
  124. package/lib/_chunks-cjs/parse-blocks.cjs +0 -205
  125. package/lib/_chunks-cjs/parse-blocks.cjs.map +0 -1
  126. package/lib/_chunks-es/parse-blocks.js +0 -206
  127. package/lib/_chunks-es/parse-blocks.js.map +0 -1
  128. package/src/behavior-actions/behavior.guards.ts +0 -24
@@ -1,18 +1,7 @@
1
1
  import type {Patch} from '@portabletext/patches'
2
- import type {
3
- ArraySchemaType,
4
- BlockDecoratorDefinition,
5
- BlockListDefinition,
6
- BlockStyleDefinition,
7
- ObjectSchemaType,
8
- Path,
9
- PortableTextChild,
10
- PortableTextListBlock,
11
- PortableTextObject,
12
- PortableTextSpan,
13
- PortableTextTextBlock,
14
- } from '@sanity/types'
2
+ import {ClientPerspective, SanityClient} from '@sanity/client'
15
3
  import {KeyedSegment, PortableTextBlock} from '@sanity/types'
4
+ import {ComponentType, ElementType, ReactNode} from 'react'
16
5
  import type {
17
6
  FocusEvent as FocusEvent_2,
18
7
  KeyboardEvent as KeyboardEvent_2,
@@ -105,7 +94,7 @@ declare type AbstractBehaviorEvent =
105
94
  'deserialization.success'
106
95
  >
107
96
  mimeType: MIMEType_2
108
- data: Array<PortableTextBlock>
97
+ data: Array<PortableTextBlock_2>
109
98
  originEvent:
110
99
  | PickFromUnion_2<
111
100
  NativeBehaviorEvent,
@@ -174,11 +163,11 @@ declare type AbstractBehaviorEvent =
174
163
  }
175
164
  | {
176
165
  type: StrictExtract_2<SyntheticBehaviorEventType, 'move.block down'>
177
- at: [KeyedSegment]
166
+ at: [KeyedSegment_2]
178
167
  }
179
168
  | {
180
169
  type: StrictExtract_2<SyntheticBehaviorEventType, 'move.block up'>
181
- at: [KeyedSegment]
170
+ at: [KeyedSegment_2]
182
171
  }
183
172
  | {
184
173
  type: StrictExtract_2<SyntheticBehaviorEventType, 'select.previous block'>
@@ -233,6 +222,277 @@ declare const abstractBehaviorEventTypes: readonly [
233
222
  'style.toggle',
234
223
  ]
235
224
 
225
+ /**
226
+ * Types of array actions that can be performed
227
+ * @beta
228
+ */
229
+ declare type ArrayActionName =
230
+ /**
231
+ * Add any item to the array at any position
232
+ */
233
+ | 'add'
234
+ /**
235
+ * Add item after an existing item
236
+ */
237
+ | 'addBefore'
238
+ /**
239
+ * Add item after an existing item
240
+ */
241
+ | 'addAfter'
242
+ /**
243
+ * Remove any item
244
+ */
245
+ | 'remove'
246
+ /**
247
+ * Duplicate item
248
+ */
249
+ | 'duplicate'
250
+ /**
251
+ * Copy item
252
+ */
253
+ | 'copy'
254
+
255
+ /** @public */
256
+ declare interface ArrayDefinition extends BaseSchemaDefinition {
257
+ type: 'array'
258
+ of: ArrayOfType[]
259
+ initialValue?: InitialValueProperty<any, unknown[]>
260
+ validation?: ValidationBuilder<ArrayRule<unknown[]>, unknown[]>
261
+ options?: ArrayOptions
262
+ }
263
+
264
+ /** @public */
265
+ declare type ArrayOfEntry<T> = Omit<T, 'name' | 'hidden'> & {
266
+ name?: string
267
+ }
268
+
269
+ /** @public */
270
+ declare type ArrayOfType<
271
+ TType extends IntrinsicTypeName = IntrinsicTypeName,
272
+ TAlias extends IntrinsicTypeName | undefined = undefined,
273
+ > =
274
+ | IntrinsicArrayOfDefinition[TType]
275
+ | ArrayOfEntry<TypeAliasDefinition<string, TAlias>>
276
+
277
+ /** @public */
278
+ declare interface ArrayOptions<V = unknown>
279
+ extends SearchConfiguration,
280
+ BaseSchemaTypeOptions {
281
+ list?: TitledListValue<V>[] | V[]
282
+ layout?: 'list' | 'tags' | 'grid'
283
+ /** @deprecated This option does not have any effect anymore */
284
+ direction?: 'horizontal' | 'vertical'
285
+ sortable?: boolean
286
+ modal?: {
287
+ type?: 'dialog' | 'popover'
288
+ width?: number | 'auto'
289
+ }
290
+ /** @alpha This API may change */
291
+ insertMenu?: InsertMenuOptions
292
+ /**
293
+ * A boolean flag to enable or disable tree editing for the array.
294
+ * If there are any nested arrays, they will inherit this value.
295
+ * @deprecated tree editing beta feature has been disabled
296
+ */
297
+ treeEditing?: boolean
298
+ /**
299
+ * A list of array actions to disable
300
+ * Possible options are defined by {@link ArrayActionName}
301
+ * @beta
302
+ */
303
+ disableActions?: ArrayActionName[]
304
+ }
305
+
306
+ /** @public */
307
+ declare interface ArrayRule<Value> extends RuleDef<ArrayRule<Value>, Value> {
308
+ min: (length: number | FieldReference) => ArrayRule<Value>
309
+ max: (length: number | FieldReference) => ArrayRule<Value>
310
+ length: (length: number | FieldReference) => ArrayRule<Value>
311
+ unique: () => ArrayRule<Value>
312
+ }
313
+
314
+ /** @public */
315
+ declare interface ArraySchemaType<V = unknown> extends BaseSchemaType {
316
+ jsonType: 'array'
317
+ of: (Exclude<SchemaType, ArraySchemaType> | ReferenceSchemaType)[]
318
+ options?: ArrayOptions<V> & {
319
+ layout?: V extends string ? 'tag' : 'grid'
320
+ }
321
+ }
322
+
323
+ /** @public */
324
+ declare interface Asset extends SanityDocument {
325
+ url: string
326
+ path: string
327
+ assetId: string
328
+ extension: string
329
+ mimeType: string
330
+ sha1hash: string
331
+ size: number
332
+ originalFilename?: string
333
+ label?: string
334
+ title?: string
335
+ description?: string
336
+ creditLine?: string
337
+ source?: AssetSourceSpec
338
+ }
339
+
340
+ /** @public */
341
+ declare type AssetFromSource = {
342
+ kind: 'assetDocumentId' | 'file' | 'base64' | 'url'
343
+ value: string | File_2
344
+ assetDocumentProps?: ImageAsset
345
+ mediaLibraryProps?: {
346
+ mediaLibraryId: string
347
+ assetId: string
348
+ assetInstanceId: string
349
+ }
350
+ }
351
+
352
+ /** @public */
353
+ declare interface AssetSource {
354
+ name: string
355
+ /** @deprecated provide `i18nKey` instead */
356
+ title?: string
357
+ i18nKey?: string
358
+ component: ComponentType<AssetSourceComponentProps>
359
+ icon?: ComponentType<EmptyProps>
360
+ /** @beta */
361
+ uploader?: AssetSourceUploader
362
+ }
363
+
364
+ /** @public */
365
+ declare interface AssetSourceComponentProps {
366
+ action?: 'select' | 'upload'
367
+ assetSource: AssetSource
368
+ assetType?: 'file' | 'image'
369
+ accept: string
370
+ selectionType: 'single'
371
+ dialogHeaderTitle?: React.ReactNode
372
+ selectedAssets: Asset[]
373
+ onClose: () => void
374
+ onSelect: (assetFromSource: AssetFromSource[]) => void
375
+ }
376
+
377
+ /** @public */
378
+ declare interface AssetSourceSpec {
379
+ id: string
380
+ name: string
381
+ url?: string
382
+ }
383
+
384
+ /** @beta */
385
+ declare interface AssetSourceUploader {
386
+ upload(
387
+ files: globalThis.File[],
388
+ options?: {
389
+ /**
390
+ * The schema type of the field the asset is being uploaded to.
391
+ * May be of interest to the uploader to read file and image options.
392
+ */
393
+ schemaType?: SchemaType
394
+ /**
395
+ * The uploader may send patches directly to the field
396
+ * Typed 'unknown' as we don't have patch definitions in sanity/types yet.
397
+ */
398
+ onChange?: (patch: unknown) => void
399
+ },
400
+ ): AssetSourceUploadFile[]
401
+ /**
402
+ * Abort the upload of a file
403
+ */
404
+ abort(file?: AssetSourceUploadFile): void
405
+ /**
406
+ * Get the files that are currently being uploaded
407
+ */
408
+ getFiles(): AssetSourceUploadFile[]
409
+ /**
410
+ * Subscribe to upload events from the uploader
411
+ */
412
+ subscribe(subscriber: (event: AssetSourceUploadEvent) => void): () => void
413
+ /**
414
+ * Update the status of a file. Will be emitted to subscribers.
415
+ */
416
+ updateFile(
417
+ fileId: string,
418
+ data: {
419
+ progress?: number
420
+ status?: string
421
+ error?: Error
422
+ },
423
+ ): void
424
+ /**
425
+ * Reset the uploader (clear files). Should be called by the uploader when all files are done.
426
+ */
427
+ reset(): void
428
+ }
429
+
430
+ /** @beta */
431
+ declare type AssetSourceUploadEvent =
432
+ | AssetSourceUploadEventProgress
433
+ | AssetSourceUploadEventStatus
434
+ | AssetSourceUploadEventAllComplete
435
+ | AssetSourceUploadEventError
436
+ | AssetSourceUploadEventAbort
437
+
438
+ /**
439
+ * Emitted when all files are done, either successfully, aborted or with errors
440
+ * @beta */
441
+ declare type AssetSourceUploadEventAbort = {
442
+ type: 'abort'
443
+ /**
444
+ * Files aborted
445
+ */
446
+ files: AssetSourceUploadFile[]
447
+ }
448
+
449
+ /**
450
+ * Emitted when all files are done, either successfully, aborted or with errors
451
+ * @beta */
452
+ declare type AssetSourceUploadEventAllComplete = {
453
+ type: 'all-complete'
454
+ files: AssetSourceUploadFile[]
455
+ }
456
+
457
+ /**
458
+ * Emitted when all files are done, either successfully, aborted or with errors
459
+ * @beta */
460
+ declare type AssetSourceUploadEventError = {
461
+ type: 'error'
462
+ /**
463
+ * Files errored
464
+ */
465
+ files: AssetSourceUploadFile[]
466
+ }
467
+
468
+ /**
469
+ * Emitted when a file upload is progressing
470
+ * @beta */
471
+ declare type AssetSourceUploadEventProgress = {
472
+ type: 'progress'
473
+ file: AssetSourceUploadFile
474
+ progress: number
475
+ }
476
+
477
+ /**
478
+ * Emitted when a file upload is changing status
479
+ * @beta */
480
+ declare type AssetSourceUploadEventStatus = {
481
+ type: 'status'
482
+ file: AssetSourceUploadFile
483
+ status: AssetSourceUploadFile['status']
484
+ }
485
+
486
+ /** @beta */
487
+ declare interface AssetSourceUploadFile {
488
+ id: string
489
+ file: globalThis.File
490
+ progress: number
491
+ status: 'pending' | 'uploading' | 'complete' | 'error' | 'aborted'
492
+ error?: Error
493
+ result?: unknown
494
+ }
495
+
236
496
  /**
237
497
  * @public
238
498
  */
@@ -241,6 +501,60 @@ declare type BaseDefinition = {
241
501
  title?: string
242
502
  }
243
503
 
504
+ /** @public */
505
+ declare interface BaseSchemaDefinition {
506
+ name: string
507
+ title?: string
508
+ description?: string | React.JSX.Element
509
+ hidden?: ConditionalProperty
510
+ readOnly?: ConditionalProperty
511
+ icon?: ComponentType | ReactNode
512
+ validation?: unknown
513
+ initialValue?: unknown
514
+ deprecated?: DeprecatedProperty
515
+ }
516
+
517
+ /** @public */
518
+ declare interface BaseSchemaType extends Partial<DeprecationConfiguration> {
519
+ name: string
520
+ title?: string
521
+ description?: string
522
+ type?: SchemaType
523
+ liveEdit?: boolean
524
+ readOnly?: ConditionalProperty
525
+ hidden?: ConditionalProperty
526
+ icon?: ComponentType
527
+ initialValue?: InitialValueProperty<any, any>
528
+ validation?: SchemaValidationValue
529
+ preview?: PreviewConfig
530
+ /** @beta */
531
+ components?: {
532
+ block?: ComponentType<any>
533
+ inlineBlock?: ComponentType<any>
534
+ annotation?: ComponentType<any>
535
+ diff?: ComponentType<any>
536
+ field?: ComponentType<any>
537
+ input?: ComponentType<any>
538
+ item?: ComponentType<any>
539
+ preview?: ComponentType<any>
540
+ }
541
+ /**
542
+ * @deprecated This will be removed.
543
+ */
544
+ placeholder?: string
545
+ }
546
+
547
+ /**
548
+ * `BaseOptions` applies to all type options.
549
+ *
550
+ * It can be extended by interface declaration merging in plugins to provide generic options to all types and fields.
551
+ *
552
+ * @public
553
+ * */
554
+ declare interface BaseSchemaTypeOptions {
555
+ sanityCreate?: SanityCreateOptions
556
+ }
557
+
244
558
  /**
245
559
  * @beta
246
560
  */
@@ -326,18 +640,252 @@ export declare type BehaviorGuard<TBehaviorEvent, TGuardResponse> = (payload: {
326
640
  event: TBehaviorEvent
327
641
  }) => TGuardResponse | false
328
642
 
643
+ /**
644
+ * Schema definition for text block decorators.
645
+ *
646
+ * @public
647
+ * @example The default set of decorators
648
+ * ```ts
649
+ * {
650
+ * name: 'blockContent',
651
+ * title: 'Content',
652
+ * type: 'array',
653
+ * of: [
654
+ * {
655
+ * type: 'block',
656
+ * marks: {
657
+ * decorators: [
658
+ * {title: 'Strong', value: 'strong'},
659
+ * {title: 'Emphasis', value: 'em'},
660
+ * {title: 'Underline', value: 'underline'},
661
+ * {title: 'Strike', value: 'strike'},
662
+ * {title: 'Code', value: 'code'},
663
+ * ]
664
+ * }
665
+ * }
666
+ * ]
667
+ * }
668
+ * ```
669
+ */
670
+ declare interface BlockDecoratorDefinition {
671
+ title: string
672
+ i18nTitleKey?: string
673
+ value: string
674
+ icon?: ReactNode | ComponentType
675
+ }
676
+
677
+ /**
678
+ * Schema definition for text blocks.
679
+ *
680
+ * @public
681
+ * @example the default block definition
682
+ * ```ts
683
+ * {
684
+ * name: 'blockContent',
685
+ * title: 'Content',
686
+ * type: 'array',
687
+ * of: [
688
+ * {
689
+ * type: 'block',
690
+ * marks: {
691
+ * decorators: [
692
+ * {title: 'Strong', value: 'strong'},
693
+ * {title: 'Emphasis', value: 'em'},
694
+ * {title: 'Underline', value: 'underline'},
695
+ * {title: 'Strike', value: 'strike'},
696
+ * {title: 'Code', value: 'code'},
697
+ * ],
698
+ * annotations: [
699
+ * {
700
+ * type: 'object',
701
+ * name: 'link',
702
+ * fields: [
703
+ * {
704
+ * type: 'string',
705
+ * name: 'href',
706
+ * },
707
+ * ],
708
+ * },
709
+ * ]
710
+ * },
711
+ * styles: [
712
+ * {title: 'Normal', value: 'normal'},
713
+ * {title: 'H1', value: 'h1'},
714
+ * {title: 'H2', value: 'h2'},
715
+ * {title: 'H3', value: 'h3'},
716
+ * {title: 'H4', value: 'h4'},
717
+ * {title: 'H5', value: 'h5'},
718
+ * {title: 'H6', value: 'h6'},
719
+ * {title: 'Quote', value: 'blockquote'}
720
+ * ],
721
+ * lists: [
722
+ * {title: 'Bullet', value: 'bullet'},
723
+ * {title: 'Number', value: 'number'},
724
+ * ],
725
+ * },
726
+ * ]
727
+ * }
728
+ * ```
729
+ */
730
+ declare interface BlockDefinition extends BaseSchemaDefinition {
731
+ type: 'block'
732
+ styles?: BlockStyleDefinition[]
733
+ lists?: BlockListDefinition[]
734
+ marks?: BlockMarksDefinition
735
+ of?: ArrayOfType<'object' | 'reference'>[]
736
+ initialValue?: InitialValueProperty<any, any[]>
737
+ options?: BlockOptions
738
+ validation?: ValidationBuilder<BlockRule, any[]>
739
+ }
740
+
741
+ /**
742
+ * Schema definition for a text block list style.
743
+ *
744
+ * @public
745
+ * @example The defaults lists
746
+ * ```ts
747
+ * {
748
+ * name: 'blockContent',
749
+ * title: 'Content',
750
+ * type: 'array',
751
+ * of: [
752
+ * {
753
+ * type: 'block',
754
+ * lists: [
755
+ * {title: 'Bullet', value: 'bullet'},
756
+ * {title: 'Number', value: 'number'},
757
+ * ]
758
+ * }
759
+ * ]
760
+ * }
761
+ * ```
762
+ */
763
+ declare interface BlockListDefinition {
764
+ title: string
765
+ i18nTitleKey?: string
766
+ value: string
767
+ icon?: ReactNode | ComponentType
768
+ }
769
+
770
+ /**
771
+ * Schema definition for text block marks (decorators and annotations).
772
+ *
773
+ * @public */
774
+ declare interface BlockMarksDefinition {
775
+ decorators?: BlockDecoratorDefinition[]
776
+ annotations?: ArrayOfType<'object' | 'reference'>[]
777
+ }
778
+
329
779
  /**
330
780
  * @beta
331
781
  */
332
782
  declare type BlockOffset_2 = {
333
- path: [KeyedSegment]
783
+ path: [KeyedSegment_2]
334
784
  offset: number
335
785
  }
336
786
 
787
+ /**
788
+ * Schema options for a Block schema definition
789
+ * @public */
790
+ declare interface BlockOptions extends BaseSchemaTypeOptions {
791
+ /**
792
+ * Turn on or off the builtin browser spellchecking. Default is on.
793
+ */
794
+ spellCheck?: boolean
795
+ unstable_whitespaceOnPasteMode?: 'preserve' | 'normalize' | 'remove'
796
+ }
797
+
798
+ /** @public */
799
+ declare interface BlockRule extends RuleDef<BlockRule, any[]> {}
800
+
801
+ /**
802
+ * Schema definition for a text block style.
803
+ * A text block may have a block style like 'header', 'normal', 'lead'
804
+ * attached to it, which is stored on the `.style` property for that block.
805
+ *
806
+ * @public
807
+ * @remarks The first defined style will become the default style.´´
808
+ * @example The default set of styles
809
+ * ```ts
810
+ * {
811
+ * name: 'blockContent',
812
+ * title: 'Content',
813
+ * type: 'array',
814
+ * of: [
815
+ * {
816
+ * type: 'block',
817
+ * styles: [
818
+ * {title: 'Normal', value: 'normal'},
819
+ * {title: 'H1', value: 'h1'},
820
+ * {title: 'H2', value: 'h2'},
821
+ * {title: 'H3', value: 'h3'},
822
+ * {title: 'H4', value: 'h4'},
823
+ * {title: 'H5', value: 'h5'},
824
+ * {title: 'H6', value: 'h6'},
825
+ * {title: 'Quote', value: 'blockquote'}
826
+ * ]
827
+ * }
828
+ * ]
829
+ * }
830
+ * ```
831
+ * @example Example of defining a block type with custom styles and render components.
832
+ * ```ts
833
+ * defineArrayMember({
834
+ * type: 'block',
835
+ * styles: [
836
+ * {
837
+ * title: 'Paragraph',
838
+ * value: 'paragraph',
839
+ * component: ParagraphStyle,
840
+ * },
841
+ * {
842
+ * title: 'Lead',
843
+ * value: 'lead',
844
+ * component: LeadStyle,
845
+ * },
846
+ * {
847
+ * title: 'Heading',
848
+ * value: 'heading',
849
+ * component: HeadingStyle,
850
+ * },
851
+ * ],
852
+ * })
853
+ * ```
854
+ */
855
+ declare interface BlockStyleDefinition {
856
+ title: string
857
+ value: string
858
+ i18nTitleKey?: string
859
+ icon?: ReactNode | ComponentType
860
+ }
861
+
337
862
  declare type BlockWithOptionalKey_2 =
338
863
  | TextBlockWithOptionalKey
339
864
  | ObjectBlockWithOptionalKey
340
865
 
866
+ /** @public */
867
+ declare interface BooleanDefinition extends BaseSchemaDefinition {
868
+ type: 'boolean'
869
+ options?: BooleanOptions
870
+ initialValue?: InitialValueProperty<any, boolean>
871
+ validation?: ValidationBuilder<BooleanRule, boolean>
872
+ }
873
+
874
+ /** @public */
875
+ declare interface BooleanOptions extends BaseSchemaTypeOptions {
876
+ layout?: 'switch' | 'checkbox'
877
+ }
878
+
879
+ /** @public */
880
+ declare interface BooleanRule extends RuleDef<BooleanRule, boolean> {}
881
+
882
+ /** @public */
883
+ declare interface BooleanSchemaType extends BaseSchemaType {
884
+ jsonType: 'boolean'
885
+ options?: BooleanOptions
886
+ initialValue?: InitialValueProperty<any, boolean>
887
+ }
888
+
341
889
  declare type ClipboardBehaviorEvent =
342
890
  | {
343
891
  type: StrictExtract_2<NativeBehaviorEventType, 'clipboard.copy'>
@@ -369,6 +917,35 @@ export declare type CodeEditorBehaviorsConfig = {
369
917
  moveBlockDownShortcut: string
370
918
  }
371
919
 
920
+ /** @public */
921
+ declare interface CollapseOptions {
922
+ collapsed?: boolean
923
+ collapsible?: boolean
924
+ /**
925
+ * @deprecated Use `collapsible` instead
926
+ */
927
+ collapsable?: boolean
928
+ }
929
+
930
+ /** @public */
931
+ declare type ConditionalProperty =
932
+ | boolean
933
+ | ConditionalPropertyCallback
934
+ | undefined
935
+
936
+ /** @public */
937
+ declare type ConditionalPropertyCallback = (
938
+ context: ConditionalPropertyCallbackContext,
939
+ ) => boolean
940
+
941
+ /** @public */
942
+ declare interface ConditionalPropertyCallbackContext {
943
+ document: SanityDocument | undefined
944
+ parent: any
945
+ value: any
946
+ currentUser: Omit<CurrentUser, 'role'> | null
947
+ }
948
+
372
949
  declare type Converter<TMIMEType extends MIMEType_2 = MIMEType_2> = {
373
950
  mimeType: TMIMEType
374
951
  serialize: Serializer<TMIMEType>
@@ -403,7 +980,7 @@ declare type ConverterEvent<TMIMEType extends MIMEType_2 = MIMEType_2> =
403
980
  }
404
981
  | {
405
982
  type: 'deserialization.success'
406
- data: Array<PortableTextBlock>
983
+ data: Array<PortableTextBlock_2>
407
984
  mimeType: TMIMEType
408
985
  }
409
986
 
@@ -472,8 +1049,8 @@ export declare const coreBehaviors: Behavior_2<
472
1049
  | 'serialize.*'
473
1050
  | 'deserialize.*'
474
1051
  | 'split.*'
475
- | 'style.*'
476
1052
  | 'block.*'
1053
+ | 'style.*'
477
1054
  | 'delete.*'
478
1055
  | 'move.*'
479
1056
  | 'select.*'
@@ -3016,8 +3593,8 @@ export declare function createCodeEditorBehaviors(
3016
3593
  | 'serialize.*'
3017
3594
  | 'deserialize.*'
3018
3595
  | 'split.*'
3019
- | 'style.*'
3020
3596
  | 'block.*'
3597
+ | 'style.*'
3021
3598
  | 'delete.*'
3022
3599
  | 'move.*'
3023
3600
  | 'select.*'
@@ -5560,8 +6137,8 @@ export declare function createEmojiPickerBehaviors<TEmojiMatch>(
5560
6137
  | 'serialize.*'
5561
6138
  | 'deserialize.*'
5562
6139
  | 'split.*'
5563
- | 'style.*'
5564
6140
  | 'block.*'
6141
+ | 'style.*'
5565
6142
  | 'delete.*'
5566
6143
  | 'move.*'
5567
6144
  | 'select.*'
@@ -8104,8 +8681,8 @@ export declare function createLinkBehaviors(
8104
8681
  | 'serialize.*'
8105
8682
  | 'deserialize.*'
8106
8683
  | 'split.*'
8107
- | 'style.*'
8108
8684
  | 'block.*'
8685
+ | 'style.*'
8109
8686
  | 'delete.*'
8110
8687
  | 'move.*'
8111
8688
  | 'select.*'
@@ -10690,8 +11267,8 @@ export declare function createMarkdownBehaviors(
10690
11267
  | 'serialize.*'
10691
11268
  | 'deserialize.*'
10692
11269
  | 'split.*'
10693
- | 'style.*'
10694
11270
  | 'block.*'
11271
+ | 'style.*'
10695
11272
  | 'delete.*'
10696
11273
  | 'move.*'
10697
11274
  | 'select.*'
@@ -13167,6 +13744,46 @@ export declare function createMarkdownBehaviors(
13167
13744
  | CustomBehaviorEvent_2<Record<string, unknown>, string, `custom.${string}`>
13168
13745
  >[]
13169
13746
 
13747
+ /** @public */
13748
+ declare interface CrossDatasetReferenceDefinition extends BaseSchemaDefinition {
13749
+ type: 'crossDatasetReference'
13750
+ weak?: boolean
13751
+ to: {
13752
+ type: string
13753
+ title?: string
13754
+ icon?: ComponentType
13755
+ preview?: PreviewConfig
13756
+ /**
13757
+ * @deprecated Unused. Configuring search is no longer supported.
13758
+ */
13759
+ __experimental_search?: {
13760
+ path: string | string[]
13761
+ weight?: number
13762
+ mapWith?: string
13763
+ }[]
13764
+ }[]
13765
+ dataset: string
13766
+ studioUrl?: (document: {id: string; type?: string}) => string | null
13767
+ tokenId?: string
13768
+ options?: ReferenceOptions
13769
+ /**
13770
+ * @deprecated Cross-project references are no longer supported, only cross-dataset
13771
+ */
13772
+ projectId?: string
13773
+ }
13774
+
13775
+ /** @public */
13776
+ declare interface CurrentUser {
13777
+ id: string
13778
+ name: string
13779
+ email: string
13780
+ profileImage?: string
13781
+ provider?: string
13782
+ /** @deprecated use `roles` instead */
13783
+ role: string
13784
+ roles: Role[]
13785
+ }
13786
+
13170
13787
  /**
13171
13788
  * @beta
13172
13789
  */
@@ -13191,6 +13808,77 @@ declare type CustomBehaviorEventType<
13191
13808
  TType extends string = '',
13192
13809
  > = TType extends '' ? `${TNamespace}` : `${TNamespace}.${TType}`
13193
13810
 
13811
+ /** @public */
13812
+ declare interface CustomValidator<T = unknown> {
13813
+ (
13814
+ value: T,
13815
+ context: ValidationContext,
13816
+ ): CustomValidatorResult | Promise<CustomValidatorResult>
13817
+ bypassConcurrencyLimit?: boolean
13818
+ }
13819
+
13820
+ /** @public */
13821
+ declare type CustomValidatorResult =
13822
+ | true
13823
+ | string
13824
+ | ValidationError
13825
+ | ValidationError[]
13826
+ | LocalizedValidationMessages
13827
+
13828
+ /** @public */
13829
+ declare interface DateDefinition extends BaseSchemaDefinition {
13830
+ type: 'date'
13831
+ options?: DateOptions
13832
+ placeholder?: string
13833
+ validation?: ValidationBuilder<DateRule, string>
13834
+ initialValue?: InitialValueProperty<any, string>
13835
+ }
13836
+
13837
+ /** @public */
13838
+ declare interface DateOptions extends BaseSchemaTypeOptions {
13839
+ dateFormat?: string
13840
+ }
13841
+
13842
+ /** @public */
13843
+ declare interface DateRule extends RuleDef<DateRule, string> {
13844
+ /**
13845
+ * @param minDate - Minimum date (inclusive). minDate should be in ISO 8601 format.
13846
+ */
13847
+ min: (minDate: string | FieldReference) => DateRule
13848
+ /**
13849
+ * @param maxDate - Maximum date (inclusive). maxDate should be in ISO 8601 format.
13850
+ */
13851
+ max: (maxDate: string | FieldReference) => DateRule
13852
+ }
13853
+
13854
+ /** @public */
13855
+ declare interface DatetimeDefinition extends BaseSchemaDefinition {
13856
+ type: 'datetime'
13857
+ options?: DatetimeOptions
13858
+ placeholder?: string
13859
+ validation?: ValidationBuilder<DatetimeRule, string>
13860
+ initialValue?: InitialValueProperty<any, string>
13861
+ }
13862
+
13863
+ /** @public */
13864
+ declare interface DatetimeOptions extends BaseSchemaTypeOptions {
13865
+ dateFormat?: string
13866
+ timeFormat?: string
13867
+ timeStep?: number
13868
+ }
13869
+
13870
+ /** @public */
13871
+ declare interface DatetimeRule extends RuleDef<DatetimeRule, string> {
13872
+ /**
13873
+ * @param minDate - Minimum date (inclusive). minDate should be in ISO 8601 format.
13874
+ */
13875
+ min: (minDate: string | FieldReference) => DatetimeRule
13876
+ /**
13877
+ * @param maxDate - Maximum date (inclusive). maxDate should be in ISO 8601 format.
13878
+ */
13879
+ max: (maxDate: string | FieldReference) => DatetimeRule
13880
+ }
13881
+
13194
13882
  /**
13195
13883
  * @beta
13196
13884
  *
@@ -13220,8 +13908,20 @@ export declare function defineBehavior<
13220
13908
  >,
13221
13909
  ): Behavior
13222
13910
 
13223
- declare type Deserializer<TMIMEType extends MIMEType_2> = ({
13224
- snapshot,
13911
+ /** @public */
13912
+ declare interface DeprecatedProperty {
13913
+ reason: string
13914
+ }
13915
+
13916
+ /**
13917
+ * @public
13918
+ */
13919
+ declare interface DeprecationConfiguration {
13920
+ deprecated: DeprecatedProperty
13921
+ }
13922
+
13923
+ declare type Deserializer<TMIMEType extends MIMEType_2> = ({
13924
+ snapshot,
13225
13925
  event,
13226
13926
  }: {
13227
13927
  snapshot: EditorSnapshot
@@ -13232,6 +13932,40 @@ declare type Deserializer<TMIMEType extends MIMEType_2> = ({
13232
13932
  'deserialization.success' | 'deserialization.failure'
13233
13933
  >
13234
13934
 
13935
+ /** @public */
13936
+ declare interface DocumentDefinition extends Omit<ObjectDefinition, 'type'> {
13937
+ type: 'document'
13938
+ liveEdit?: boolean
13939
+ /** @beta */
13940
+ orderings?: SortOrdering[]
13941
+ options?: DocumentOptions
13942
+ validation?: ValidationBuilder<DocumentRule, SanityDocument>
13943
+ initialValue?: InitialValueProperty<any, Record<string, unknown>>
13944
+ /** @deprecated Unused. Use the new field-level search config. */
13945
+ __experimental_search?: {
13946
+ path: string
13947
+ weight: number
13948
+ mapWith?: string
13949
+ }[]
13950
+ /** @alpha */
13951
+ __experimental_omnisearch_visibility?: boolean
13952
+ /**
13953
+ * Determines whether the large preview title is displayed in the document pane form
13954
+ * @alpha
13955
+ * */
13956
+ __experimental_formPreviewTitle?: boolean
13957
+ }
13958
+
13959
+ /**
13960
+ * This exists only to allow for extensions using declaration-merging.
13961
+ *
13962
+ * @public
13963
+ */
13964
+ declare interface DocumentOptions extends BaseSchemaTypeOptions {}
13965
+
13966
+ /** @public */
13967
+ declare interface DocumentRule extends RuleDef<DocumentRule, SanityDocument> {}
13968
+
13235
13969
  declare type DragBehaviorEvent =
13236
13970
  | {
13237
13971
  type: StrictExtract_2<NativeBehaviorEventType, 'drag.dragstart'>
@@ -13307,16 +14041,16 @@ declare interface EditableAPI {
13307
14041
  ) => void
13308
14042
  findByPath: (
13309
14043
  path: Path,
13310
- ) => [PortableTextBlock | PortableTextChild | undefined, Path | undefined]
14044
+ ) => [PortableTextBlock_2 | PortableTextChild | undefined, Path | undefined]
13311
14045
  findDOMNode: (
13312
- element: PortableTextBlock | PortableTextChild,
14046
+ element: PortableTextBlock_2 | PortableTextChild,
13313
14047
  ) => DOMNode | undefined
13314
14048
  focus: () => void
13315
- focusBlock: () => PortableTextBlock | undefined
14049
+ focusBlock: () => PortableTextBlock_2 | undefined
13316
14050
  focusChild: () => PortableTextChild | undefined
13317
14051
  getSelection: () => EditorSelection_2
13318
- getFragment: () => PortableTextBlock[] | undefined
13319
- getValue: () => PortableTextBlock[] | undefined
14052
+ getFragment: () => PortableTextBlock_2[] | undefined
14053
+ getValue: () => PortableTextBlock_2[] | undefined
13320
14054
  hasBlockStyle: (style: string) => boolean
13321
14055
  hasListStyle: (listStyle: string) => boolean
13322
14056
  insertBlock: <
@@ -13347,7 +14081,7 @@ declare interface EditableAPI {
13347
14081
  selectionA: EditorSelection_2,
13348
14082
  selectionB: EditorSelection_2,
13349
14083
  ) => boolean
13350
- isVoid: (element: PortableTextBlock | PortableTextChild) => boolean
14084
+ isVoid: (element: PortableTextBlock_2 | PortableTextChild) => boolean
13351
14085
  marks: () => string[]
13352
14086
  redo: () => void
13353
14087
  removeAnnotation: <
@@ -13384,7 +14118,7 @@ declare type EditorContext = {
13384
14118
  readOnly: boolean
13385
14119
  schema: EditorSchema
13386
14120
  selection: EditorSelection_2
13387
- value: Array<PortableTextBlock>
14121
+ value: Array<PortableTextBlock_2>
13388
14122
  }
13389
14123
 
13390
14124
  /**
@@ -13401,7 +14135,7 @@ declare const editorMachine: StateMachine<
13401
14135
  initialReadOnly: boolean
13402
14136
  maxBlocks: number | undefined
13403
14137
  selection: EditorSelection_2
13404
- incomingValue: Array<PortableTextBlock> | undefined
14138
+ incomingValue: Array<PortableTextBlock_2> | undefined
13405
14139
  internalDrag?: {
13406
14140
  ghost?: HTMLElement
13407
14141
  origin: Pick<EventPosition_2, 'selection'>
@@ -13436,7 +14170,7 @@ declare const editorMachine: StateMachine<
13436
14170
  }
13437
14171
  | {
13438
14172
  type: 'update value'
13439
- value: Array<PortableTextBlock> | undefined
14173
+ value: Array<PortableTextBlock_2> | undefined
13440
14174
  }
13441
14175
  | {
13442
14176
  type: 'update maxBlocks'
@@ -13475,8 +14209,8 @@ declare const editorMachine: StateMachine<
13475
14209
  | {
13476
14210
  type: 'notify.mutation'
13477
14211
  patches: Array<Patch>
13478
- snapshot: Array<PortableTextBlock> | undefined
13479
- value: Array<PortableTextBlock> | undefined
14212
+ snapshot: Array<PortableTextBlock_2> | undefined
14213
+ value: Array<PortableTextBlock_2> | undefined
13480
14214
  }
13481
14215
  | {
13482
14216
  type: 'notify.blurred'
@@ -13501,7 +14235,7 @@ declare const editorMachine: StateMachine<
13501
14235
  | {
13502
14236
  type: 'notify.invalid value'
13503
14237
  resolution: InvalidValueResolution | null
13504
- value: Array<PortableTextBlock> | undefined
14238
+ value: Array<PortableTextBlock_2> | undefined
13505
14239
  }
13506
14240
  | {
13507
14241
  type: 'notify.loading'
@@ -13518,11 +14252,11 @@ declare const editorMachine: StateMachine<
13518
14252
  }
13519
14253
  | {
13520
14254
  type: 'notify.value changed'
13521
- value: Array<PortableTextBlock> | undefined
14255
+ value: Array<PortableTextBlock_2> | undefined
13522
14256
  }
13523
14257
  | {
13524
14258
  type: 'notify.unset'
13525
- previousValue: Array<PortableTextBlock>
14259
+ previousValue: Array<PortableTextBlock_2>
13526
14260
  }
13527
14261
  | {
13528
14262
  type: 'dragstart'
@@ -13633,7 +14367,7 @@ declare const editorMachine: StateMachine<
13633
14367
  maxBlocks?: number
13634
14368
  readOnly?: boolean
13635
14369
  schema: EditorSchema
13636
- initialValue?: Array<PortableTextBlock>
14370
+ initialValue?: Array<PortableTextBlock_2>
13637
14371
  },
13638
14372
  NonReducibleUnknown,
13639
14373
  | PatchEvent
@@ -13663,7 +14397,7 @@ declare const editorMachine: StateMachine<
13663
14397
  | {
13664
14398
  type: 'invalid value'
13665
14399
  resolution: InvalidValueResolution | null
13666
- value: Array<PortableTextBlock> | undefined
14400
+ value: Array<PortableTextBlock_2> | undefined
13667
14401
  }
13668
14402
  | {
13669
14403
  type: 'loading'
@@ -13680,7 +14414,7 @@ declare const editorMachine: StateMachine<
13680
14414
  }
13681
14415
  | {
13682
14416
  type: 'value changed'
13683
- value: Array<PortableTextBlock> | undefined
14417
+ value: Array<PortableTextBlock_2> | undefined
13684
14418
  }
13685
14419
  | UnsetEvent,
13686
14420
  MetaObject,
@@ -13719,7 +14453,7 @@ declare const editorMachine: StateMachine<
13719
14453
  maxBlocks?: number
13720
14454
  readOnly?: boolean
13721
14455
  schema: EditorSchema
13722
- initialValue?: Array<PortableTextBlock>
14456
+ initialValue?: Array<PortableTextBlock_2>
13723
14457
  }
13724
14458
  self: ActorRef<
13725
14459
  MachineSnapshot<
@@ -13733,7 +14467,7 @@ declare const editorMachine: StateMachine<
13733
14467
  initialReadOnly: boolean
13734
14468
  maxBlocks: number | undefined
13735
14469
  selection: EditorSelection_2
13736
- incomingValue: Array<PortableTextBlock> | undefined
14470
+ incomingValue: Array<PortableTextBlock_2> | undefined
13737
14471
  internalDrag?: {
13738
14472
  ghost?: HTMLElement
13739
14473
  origin: Pick<EventPosition_2, 'selection'>
@@ -13768,7 +14502,7 @@ declare const editorMachine: StateMachine<
13768
14502
  }
13769
14503
  | {
13770
14504
  type: 'update value'
13771
- value: Array<PortableTextBlock> | undefined
14505
+ value: Array<PortableTextBlock_2> | undefined
13772
14506
  }
13773
14507
  | {
13774
14508
  type: 'update maxBlocks'
@@ -13807,8 +14541,8 @@ declare const editorMachine: StateMachine<
13807
14541
  | {
13808
14542
  type: 'notify.mutation'
13809
14543
  patches: Array<Patch>
13810
- snapshot: Array<PortableTextBlock> | undefined
13811
- value: Array<PortableTextBlock> | undefined
14544
+ snapshot: Array<PortableTextBlock_2> | undefined
14545
+ value: Array<PortableTextBlock_2> | undefined
13812
14546
  }
13813
14547
  | {
13814
14548
  type: 'notify.blurred'
@@ -13833,7 +14567,7 @@ declare const editorMachine: StateMachine<
13833
14567
  | {
13834
14568
  type: 'notify.invalid value'
13835
14569
  resolution: InvalidValueResolution | null
13836
- value: Array<PortableTextBlock> | undefined
14570
+ value: Array<PortableTextBlock_2> | undefined
13837
14571
  }
13838
14572
  | {
13839
14573
  type: 'notify.loading'
@@ -13850,11 +14584,11 @@ declare const editorMachine: StateMachine<
13850
14584
  }
13851
14585
  | {
13852
14586
  type: 'notify.value changed'
13853
- value: Array<PortableTextBlock> | undefined
14587
+ value: Array<PortableTextBlock_2> | undefined
13854
14588
  }
13855
14589
  | {
13856
14590
  type: 'notify.unset'
13857
- previousValue: Array<PortableTextBlock>
14591
+ previousValue: Array<PortableTextBlock_2>
13858
14592
  }
13859
14593
  | {
13860
14594
  type: 'dragstart'
@@ -13902,7 +14636,7 @@ declare const editorMachine: StateMachine<
13902
14636
  }
13903
14637
  | {
13904
14638
  type: 'update value'
13905
- value: Array<PortableTextBlock> | undefined
14639
+ value: Array<PortableTextBlock_2> | undefined
13906
14640
  }
13907
14641
  | {
13908
14642
  type: 'update maxBlocks'
@@ -13941,8 +14675,8 @@ declare const editorMachine: StateMachine<
13941
14675
  | {
13942
14676
  type: 'notify.mutation'
13943
14677
  patches: Array<Patch>
13944
- snapshot: Array<PortableTextBlock> | undefined
13945
- value: Array<PortableTextBlock> | undefined
14678
+ snapshot: Array<PortableTextBlock_2> | undefined
14679
+ value: Array<PortableTextBlock_2> | undefined
13946
14680
  }
13947
14681
  | {
13948
14682
  type: 'notify.blurred'
@@ -13967,7 +14701,7 @@ declare const editorMachine: StateMachine<
13967
14701
  | {
13968
14702
  type: 'notify.invalid value'
13969
14703
  resolution: InvalidValueResolution | null
13970
- value: Array<PortableTextBlock> | undefined
14704
+ value: Array<PortableTextBlock_2> | undefined
13971
14705
  }
13972
14706
  | {
13973
14707
  type: 'notify.loading'
@@ -13984,11 +14718,11 @@ declare const editorMachine: StateMachine<
13984
14718
  }
13985
14719
  | {
13986
14720
  type: 'notify.value changed'
13987
- value: Array<PortableTextBlock> | undefined
14721
+ value: Array<PortableTextBlock_2> | undefined
13988
14722
  }
13989
14723
  | {
13990
14724
  type: 'notify.unset'
13991
- previousValue: Array<PortableTextBlock>
14725
+ previousValue: Array<PortableTextBlock_2>
13992
14726
  }
13993
14727
  | {
13994
14728
  type: 'dragstart'
@@ -14013,7 +14747,7 @@ declare const editorMachine: StateMachine<
14013
14747
  selection: null
14014
14748
  initialReadOnly: boolean
14015
14749
  maxBlocks: number | undefined
14016
- incomingValue: PortableTextBlock[] | undefined
14750
+ incomingValue: PortableTextBlock_2[] | undefined
14017
14751
  }
14018
14752
  readonly on: {
14019
14753
  readonly 'notify.blurred': {
@@ -14028,7 +14762,7 @@ declare const editorMachine: StateMachine<
14028
14762
  initialReadOnly: boolean
14029
14763
  maxBlocks: number | undefined
14030
14764
  selection: EditorSelection_2
14031
- incomingValue: Array<PortableTextBlock> | undefined
14765
+ incomingValue: Array<PortableTextBlock_2> | undefined
14032
14766
  internalDrag?: {
14033
14767
  ghost?: HTMLElement
14034
14768
  origin: Pick<EventPosition_2, 'selection'>
@@ -14067,7 +14801,7 @@ declare const editorMachine: StateMachine<
14067
14801
  }
14068
14802
  | {
14069
14803
  type: 'update value'
14070
- value: Array<PortableTextBlock> | undefined
14804
+ value: Array<PortableTextBlock_2> | undefined
14071
14805
  }
14072
14806
  | {
14073
14807
  type: 'update maxBlocks'
@@ -14106,8 +14840,8 @@ declare const editorMachine: StateMachine<
14106
14840
  | {
14107
14841
  type: 'notify.mutation'
14108
14842
  patches: Array<Patch>
14109
- snapshot: Array<PortableTextBlock> | undefined
14110
- value: Array<PortableTextBlock> | undefined
14843
+ snapshot: Array<PortableTextBlock_2> | undefined
14844
+ value: Array<PortableTextBlock_2> | undefined
14111
14845
  }
14112
14846
  | {
14113
14847
  type: 'notify.blurred'
@@ -14132,7 +14866,7 @@ declare const editorMachine: StateMachine<
14132
14866
  | {
14133
14867
  type: 'notify.invalid value'
14134
14868
  resolution: InvalidValueResolution | null
14135
- value: Array<PortableTextBlock> | undefined
14869
+ value: Array<PortableTextBlock_2> | undefined
14136
14870
  }
14137
14871
  | {
14138
14872
  type: 'notify.loading'
@@ -14149,11 +14883,11 @@ declare const editorMachine: StateMachine<
14149
14883
  }
14150
14884
  | {
14151
14885
  type: 'notify.value changed'
14152
- value: Array<PortableTextBlock> | undefined
14886
+ value: Array<PortableTextBlock_2> | undefined
14153
14887
  }
14154
14888
  | {
14155
14889
  type: 'notify.unset'
14156
- previousValue: Array<PortableTextBlock>
14890
+ previousValue: Array<PortableTextBlock_2>
14157
14891
  }
14158
14892
  | {
14159
14893
  type: 'dragstart'
@@ -14198,7 +14932,7 @@ declare const editorMachine: StateMachine<
14198
14932
  | {
14199
14933
  type: 'invalid value'
14200
14934
  resolution: InvalidValueResolution | null
14201
- value: Array<PortableTextBlock> | undefined
14935
+ value: Array<PortableTextBlock_2> | undefined
14202
14936
  }
14203
14937
  | {
14204
14938
  type: 'loading'
@@ -14215,7 +14949,7 @@ declare const editorMachine: StateMachine<
14215
14949
  }
14216
14950
  | {
14217
14951
  type: 'value changed'
14218
- value: Array<PortableTextBlock> | undefined
14952
+ value: Array<PortableTextBlock_2> | undefined
14219
14953
  }
14220
14954
  | UnsetEvent
14221
14955
  >
@@ -14232,7 +14966,7 @@ declare const editorMachine: StateMachine<
14232
14966
  initialReadOnly: boolean
14233
14967
  maxBlocks: number | undefined
14234
14968
  selection: EditorSelection_2
14235
- incomingValue: Array<PortableTextBlock> | undefined
14969
+ incomingValue: Array<PortableTextBlock_2> | undefined
14236
14970
  internalDrag?: {
14237
14971
  ghost?: HTMLElement
14238
14972
  origin: Pick<EventPosition_2, 'selection'>
@@ -14270,7 +15004,7 @@ declare const editorMachine: StateMachine<
14270
15004
  }
14271
15005
  | {
14272
15006
  type: 'update value'
14273
- value: Array<PortableTextBlock> | undefined
15007
+ value: Array<PortableTextBlock_2> | undefined
14274
15008
  }
14275
15009
  | {
14276
15010
  type: 'update maxBlocks'
@@ -14309,8 +15043,8 @@ declare const editorMachine: StateMachine<
14309
15043
  | {
14310
15044
  type: 'notify.mutation'
14311
15045
  patches: Array<Patch>
14312
- snapshot: Array<PortableTextBlock> | undefined
14313
- value: Array<PortableTextBlock> | undefined
15046
+ snapshot: Array<PortableTextBlock_2> | undefined
15047
+ value: Array<PortableTextBlock_2> | undefined
14314
15048
  }
14315
15049
  | {
14316
15050
  type: 'notify.blurred'
@@ -14335,7 +15069,7 @@ declare const editorMachine: StateMachine<
14335
15069
  | {
14336
15070
  type: 'notify.invalid value'
14337
15071
  resolution: InvalidValueResolution | null
14338
- value: Array<PortableTextBlock> | undefined
15072
+ value: Array<PortableTextBlock_2> | undefined
14339
15073
  }
14340
15074
  | {
14341
15075
  type: 'notify.loading'
@@ -14352,11 +15086,11 @@ declare const editorMachine: StateMachine<
14352
15086
  }
14353
15087
  | {
14354
15088
  type: 'notify.value changed'
14355
- value: Array<PortableTextBlock> | undefined
15089
+ value: Array<PortableTextBlock_2> | undefined
14356
15090
  }
14357
15091
  | {
14358
15092
  type: 'notify.unset'
14359
- previousValue: Array<PortableTextBlock>
15093
+ previousValue: Array<PortableTextBlock_2>
14360
15094
  }
14361
15095
  | {
14362
15096
  type: 'dragstart'
@@ -14401,7 +15135,7 @@ declare const editorMachine: StateMachine<
14401
15135
  | {
14402
15136
  type: 'invalid value'
14403
15137
  resolution: InvalidValueResolution | null
14404
- value: Array<PortableTextBlock> | undefined
15138
+ value: Array<PortableTextBlock_2> | undefined
14405
15139
  }
14406
15140
  | {
14407
15141
  type: 'loading'
@@ -14418,7 +15152,7 @@ declare const editorMachine: StateMachine<
14418
15152
  }
14419
15153
  | {
14420
15154
  type: 'value changed'
14421
- value: Array<PortableTextBlock> | undefined
15155
+ value: Array<PortableTextBlock_2> | undefined
14422
15156
  }
14423
15157
  | UnsetEvent
14424
15158
  >
@@ -14435,7 +15169,7 @@ declare const editorMachine: StateMachine<
14435
15169
  initialReadOnly: boolean
14436
15170
  maxBlocks: number | undefined
14437
15171
  selection: EditorSelection_2
14438
- incomingValue: Array<PortableTextBlock> | undefined
15172
+ incomingValue: Array<PortableTextBlock_2> | undefined
14439
15173
  internalDrag?: {
14440
15174
  ghost?: HTMLElement
14441
15175
  origin: Pick<EventPosition_2, 'selection'>
@@ -14476,7 +15210,7 @@ declare const editorMachine: StateMachine<
14476
15210
  }
14477
15211
  | {
14478
15212
  type: 'update value'
14479
- value: Array<PortableTextBlock> | undefined
15213
+ value: Array<PortableTextBlock_2> | undefined
14480
15214
  }
14481
15215
  | {
14482
15216
  type: 'update maxBlocks'
@@ -14515,8 +15249,8 @@ declare const editorMachine: StateMachine<
14515
15249
  | {
14516
15250
  type: 'notify.mutation'
14517
15251
  patches: Array<Patch>
14518
- snapshot: Array<PortableTextBlock> | undefined
14519
- value: Array<PortableTextBlock> | undefined
15252
+ snapshot: Array<PortableTextBlock_2> | undefined
15253
+ value: Array<PortableTextBlock_2> | undefined
14520
15254
  }
14521
15255
  | {
14522
15256
  type: 'notify.blurred'
@@ -14541,7 +15275,7 @@ declare const editorMachine: StateMachine<
14541
15275
  | {
14542
15276
  type: 'notify.invalid value'
14543
15277
  resolution: InvalidValueResolution | null
14544
- value: Array<PortableTextBlock> | undefined
15278
+ value: Array<PortableTextBlock_2> | undefined
14545
15279
  }
14546
15280
  | {
14547
15281
  type: 'notify.loading'
@@ -14558,11 +15292,11 @@ declare const editorMachine: StateMachine<
14558
15292
  }
14559
15293
  | {
14560
15294
  type: 'notify.value changed'
14561
- value: Array<PortableTextBlock> | undefined
15295
+ value: Array<PortableTextBlock_2> | undefined
14562
15296
  }
14563
15297
  | {
14564
15298
  type: 'notify.unset'
14565
- previousValue: Array<PortableTextBlock>
15299
+ previousValue: Array<PortableTextBlock_2>
14566
15300
  }
14567
15301
  | {
14568
15302
  type: 'dragstart'
@@ -14607,7 +15341,7 @@ declare const editorMachine: StateMachine<
14607
15341
  | {
14608
15342
  type: 'invalid value'
14609
15343
  resolution: InvalidValueResolution | null
14610
- value: Array<PortableTextBlock> | undefined
15344
+ value: Array<PortableTextBlock_2> | undefined
14611
15345
  }
14612
15346
  | {
14613
15347
  type: 'loading'
@@ -14624,7 +15358,7 @@ declare const editorMachine: StateMachine<
14624
15358
  }
14625
15359
  | {
14626
15360
  type: 'value changed'
14627
- value: Array<PortableTextBlock> | undefined
15361
+ value: Array<PortableTextBlock_2> | undefined
14628
15362
  }
14629
15363
  | UnsetEvent
14630
15364
  >
@@ -14641,7 +15375,7 @@ declare const editorMachine: StateMachine<
14641
15375
  initialReadOnly: boolean
14642
15376
  maxBlocks: number | undefined
14643
15377
  selection: EditorSelection_2
14644
- incomingValue: Array<PortableTextBlock> | undefined
15378
+ incomingValue: Array<PortableTextBlock_2> | undefined
14645
15379
  internalDrag?: {
14646
15380
  ghost?: HTMLElement
14647
15381
  origin: Pick<EventPosition_2, 'selection'>
@@ -14651,7 +15385,7 @@ declare const editorMachine: StateMachine<
14651
15385
  {
14652
15386
  type: 'notify.invalid value'
14653
15387
  resolution: InvalidValueResolution | null
14654
- value: Array<PortableTextBlock> | undefined
15388
+ value: Array<PortableTextBlock_2> | undefined
14655
15389
  },
14656
15390
  | InternalPatchEvent
14657
15391
  | MutationEvent
@@ -14681,7 +15415,7 @@ declare const editorMachine: StateMachine<
14681
15415
  }
14682
15416
  | {
14683
15417
  type: 'update value'
14684
- value: Array<PortableTextBlock> | undefined
15418
+ value: Array<PortableTextBlock_2> | undefined
14685
15419
  }
14686
15420
  | {
14687
15421
  type: 'update maxBlocks'
@@ -14720,8 +15454,8 @@ declare const editorMachine: StateMachine<
14720
15454
  | {
14721
15455
  type: 'notify.mutation'
14722
15456
  patches: Array<Patch>
14723
- snapshot: Array<PortableTextBlock> | undefined
14724
- value: Array<PortableTextBlock> | undefined
15457
+ snapshot: Array<PortableTextBlock_2> | undefined
15458
+ value: Array<PortableTextBlock_2> | undefined
14725
15459
  }
14726
15460
  | {
14727
15461
  type: 'notify.blurred'
@@ -14746,7 +15480,7 @@ declare const editorMachine: StateMachine<
14746
15480
  | {
14747
15481
  type: 'notify.invalid value'
14748
15482
  resolution: InvalidValueResolution | null
14749
- value: Array<PortableTextBlock> | undefined
15483
+ value: Array<PortableTextBlock_2> | undefined
14750
15484
  }
14751
15485
  | {
14752
15486
  type: 'notify.loading'
@@ -14763,11 +15497,11 @@ declare const editorMachine: StateMachine<
14763
15497
  }
14764
15498
  | {
14765
15499
  type: 'notify.value changed'
14766
- value: Array<PortableTextBlock> | undefined
15500
+ value: Array<PortableTextBlock_2> | undefined
14767
15501
  }
14768
15502
  | {
14769
15503
  type: 'notify.unset'
14770
- previousValue: Array<PortableTextBlock>
15504
+ previousValue: Array<PortableTextBlock_2>
14771
15505
  }
14772
15506
  | {
14773
15507
  type: 'dragstart'
@@ -14812,7 +15546,7 @@ declare const editorMachine: StateMachine<
14812
15546
  | {
14813
15547
  type: 'invalid value'
14814
15548
  resolution: InvalidValueResolution | null
14815
- value: Array<PortableTextBlock> | undefined
15549
+ value: Array<PortableTextBlock_2> | undefined
14816
15550
  }
14817
15551
  | {
14818
15552
  type: 'loading'
@@ -14829,7 +15563,7 @@ declare const editorMachine: StateMachine<
14829
15563
  }
14830
15564
  | {
14831
15565
  type: 'value changed'
14832
- value: Array<PortableTextBlock> | undefined
15566
+ value: Array<PortableTextBlock_2> | undefined
14833
15567
  }
14834
15568
  | UnsetEvent
14835
15569
  >
@@ -14846,7 +15580,7 @@ declare const editorMachine: StateMachine<
14846
15580
  initialReadOnly: boolean
14847
15581
  maxBlocks: number | undefined
14848
15582
  selection: EditorSelection_2
14849
- incomingValue: Array<PortableTextBlock> | undefined
15583
+ incomingValue: Array<PortableTextBlock_2> | undefined
14850
15584
  internalDrag?: {
14851
15585
  ghost?: HTMLElement
14852
15586
  origin: Pick<EventPosition_2, 'selection'>
@@ -14885,7 +15619,7 @@ declare const editorMachine: StateMachine<
14885
15619
  }
14886
15620
  | {
14887
15621
  type: 'update value'
14888
- value: Array<PortableTextBlock> | undefined
15622
+ value: Array<PortableTextBlock_2> | undefined
14889
15623
  }
14890
15624
  | {
14891
15625
  type: 'update maxBlocks'
@@ -14924,8 +15658,8 @@ declare const editorMachine: StateMachine<
14924
15658
  | {
14925
15659
  type: 'notify.mutation'
14926
15660
  patches: Array<Patch>
14927
- snapshot: Array<PortableTextBlock> | undefined
14928
- value: Array<PortableTextBlock> | undefined
15661
+ snapshot: Array<PortableTextBlock_2> | undefined
15662
+ value: Array<PortableTextBlock_2> | undefined
14929
15663
  }
14930
15664
  | {
14931
15665
  type: 'notify.blurred'
@@ -14950,7 +15684,7 @@ declare const editorMachine: StateMachine<
14950
15684
  | {
14951
15685
  type: 'notify.invalid value'
14952
15686
  resolution: InvalidValueResolution | null
14953
- value: Array<PortableTextBlock> | undefined
15687
+ value: Array<PortableTextBlock_2> | undefined
14954
15688
  }
14955
15689
  | {
14956
15690
  type: 'notify.loading'
@@ -14967,11 +15701,11 @@ declare const editorMachine: StateMachine<
14967
15701
  }
14968
15702
  | {
14969
15703
  type: 'notify.value changed'
14970
- value: Array<PortableTextBlock> | undefined
15704
+ value: Array<PortableTextBlock_2> | undefined
14971
15705
  }
14972
15706
  | {
14973
15707
  type: 'notify.unset'
14974
- previousValue: Array<PortableTextBlock>
15708
+ previousValue: Array<PortableTextBlock_2>
14975
15709
  }
14976
15710
  | {
14977
15711
  type: 'dragstart'
@@ -15016,7 +15750,7 @@ declare const editorMachine: StateMachine<
15016
15750
  | {
15017
15751
  type: 'invalid value'
15018
15752
  resolution: InvalidValueResolution | null
15019
- value: Array<PortableTextBlock> | undefined
15753
+ value: Array<PortableTextBlock_2> | undefined
15020
15754
  }
15021
15755
  | {
15022
15756
  type: 'loading'
@@ -15033,7 +15767,7 @@ declare const editorMachine: StateMachine<
15033
15767
  }
15034
15768
  | {
15035
15769
  type: 'value changed'
15036
- value: Array<PortableTextBlock> | undefined
15770
+ value: Array<PortableTextBlock_2> | undefined
15037
15771
  }
15038
15772
  | UnsetEvent
15039
15773
  >
@@ -15051,7 +15785,7 @@ declare const editorMachine: StateMachine<
15051
15785
  initialReadOnly: boolean
15052
15786
  maxBlocks: number | undefined
15053
15787
  selection: EditorSelection_2
15054
- incomingValue: Array<PortableTextBlock> | undefined
15788
+ incomingValue: Array<PortableTextBlock_2> | undefined
15055
15789
  internalDrag?: {
15056
15790
  ghost?: HTMLElement
15057
15791
  origin: Pick<EventPosition_2, 'selection'>
@@ -15090,7 +15824,7 @@ declare const editorMachine: StateMachine<
15090
15824
  }
15091
15825
  | {
15092
15826
  type: 'update value'
15093
- value: Array<PortableTextBlock> | undefined
15827
+ value: Array<PortableTextBlock_2> | undefined
15094
15828
  }
15095
15829
  | {
15096
15830
  type: 'update maxBlocks'
@@ -15129,8 +15863,8 @@ declare const editorMachine: StateMachine<
15129
15863
  | {
15130
15864
  type: 'notify.mutation'
15131
15865
  patches: Array<Patch>
15132
- snapshot: Array<PortableTextBlock> | undefined
15133
- value: Array<PortableTextBlock> | undefined
15866
+ snapshot: Array<PortableTextBlock_2> | undefined
15867
+ value: Array<PortableTextBlock_2> | undefined
15134
15868
  }
15135
15869
  | {
15136
15870
  type: 'notify.blurred'
@@ -15155,7 +15889,7 @@ declare const editorMachine: StateMachine<
15155
15889
  | {
15156
15890
  type: 'notify.invalid value'
15157
15891
  resolution: InvalidValueResolution | null
15158
- value: Array<PortableTextBlock> | undefined
15892
+ value: Array<PortableTextBlock_2> | undefined
15159
15893
  }
15160
15894
  | {
15161
15895
  type: 'notify.loading'
@@ -15172,11 +15906,11 @@ declare const editorMachine: StateMachine<
15172
15906
  }
15173
15907
  | {
15174
15908
  type: 'notify.value changed'
15175
- value: Array<PortableTextBlock> | undefined
15909
+ value: Array<PortableTextBlock_2> | undefined
15176
15910
  }
15177
15911
  | {
15178
15912
  type: 'notify.unset'
15179
- previousValue: Array<PortableTextBlock>
15913
+ previousValue: Array<PortableTextBlock_2>
15180
15914
  }
15181
15915
  | {
15182
15916
  type: 'dragstart'
@@ -15207,7 +15941,7 @@ declare const editorMachine: StateMachine<
15207
15941
  initialReadOnly: boolean
15208
15942
  maxBlocks: number | undefined
15209
15943
  selection: EditorSelection_2
15210
- incomingValue: Array<PortableTextBlock> | undefined
15944
+ incomingValue: Array<PortableTextBlock_2> | undefined
15211
15945
  internalDrag?: {
15212
15946
  ghost?: HTMLElement
15213
15947
  origin: Pick<EventPosition_2, 'selection'>
@@ -15246,7 +15980,7 @@ declare const editorMachine: StateMachine<
15246
15980
  }
15247
15981
  | {
15248
15982
  type: 'update value'
15249
- value: Array<PortableTextBlock> | undefined
15983
+ value: Array<PortableTextBlock_2> | undefined
15250
15984
  }
15251
15985
  | {
15252
15986
  type: 'update maxBlocks'
@@ -15285,8 +16019,8 @@ declare const editorMachine: StateMachine<
15285
16019
  | {
15286
16020
  type: 'notify.mutation'
15287
16021
  patches: Array<Patch>
15288
- snapshot: Array<PortableTextBlock> | undefined
15289
- value: Array<PortableTextBlock> | undefined
16022
+ snapshot: Array<PortableTextBlock_2> | undefined
16023
+ value: Array<PortableTextBlock_2> | undefined
15290
16024
  }
15291
16025
  | {
15292
16026
  type: 'notify.blurred'
@@ -15311,7 +16045,7 @@ declare const editorMachine: StateMachine<
15311
16045
  | {
15312
16046
  type: 'notify.invalid value'
15313
16047
  resolution: InvalidValueResolution | null
15314
- value: Array<PortableTextBlock> | undefined
16048
+ value: Array<PortableTextBlock_2> | undefined
15315
16049
  }
15316
16050
  | {
15317
16051
  type: 'notify.loading'
@@ -15328,11 +16062,11 @@ declare const editorMachine: StateMachine<
15328
16062
  }
15329
16063
  | {
15330
16064
  type: 'notify.value changed'
15331
- value: Array<PortableTextBlock> | undefined
16065
+ value: Array<PortableTextBlock_2> | undefined
15332
16066
  }
15333
16067
  | {
15334
16068
  type: 'notify.unset'
15335
- previousValue: Array<PortableTextBlock>
16069
+ previousValue: Array<PortableTextBlock_2>
15336
16070
  }
15337
16071
  | {
15338
16072
  type: 'dragstart'
@@ -15377,7 +16111,7 @@ declare const editorMachine: StateMachine<
15377
16111
  | {
15378
16112
  type: 'invalid value'
15379
16113
  resolution: InvalidValueResolution | null
15380
- value: Array<PortableTextBlock> | undefined
16114
+ value: Array<PortableTextBlock_2> | undefined
15381
16115
  }
15382
16116
  | {
15383
16117
  type: 'loading'
@@ -15394,7 +16128,7 @@ declare const editorMachine: StateMachine<
15394
16128
  }
15395
16129
  | {
15396
16130
  type: 'value changed'
15397
- value: Array<PortableTextBlock> | undefined
16131
+ value: Array<PortableTextBlock_2> | undefined
15398
16132
  }
15399
16133
  | UnsetEvent
15400
16134
  >,
@@ -15412,7 +16146,7 @@ declare const editorMachine: StateMachine<
15412
16146
  initialReadOnly: boolean
15413
16147
  maxBlocks: number | undefined
15414
16148
  selection: EditorSelection_2
15415
- incomingValue: Array<PortableTextBlock> | undefined
16149
+ incomingValue: Array<PortableTextBlock_2> | undefined
15416
16150
  internalDrag?: {
15417
16151
  ghost?: HTMLElement
15418
16152
  origin: Pick<EventPosition_2, 'selection'>
@@ -15421,7 +16155,7 @@ declare const editorMachine: StateMachine<
15421
16155
  },
15422
16156
  {
15423
16157
  type: 'notify.unset'
15424
- previousValue: Array<PortableTextBlock>
16158
+ previousValue: Array<PortableTextBlock_2>
15425
16159
  },
15426
16160
  | InternalPatchEvent
15427
16161
  | MutationEvent
@@ -15451,7 +16185,7 @@ declare const editorMachine: StateMachine<
15451
16185
  }
15452
16186
  | {
15453
16187
  type: 'update value'
15454
- value: Array<PortableTextBlock> | undefined
16188
+ value: Array<PortableTextBlock_2> | undefined
15455
16189
  }
15456
16190
  | {
15457
16191
  type: 'update maxBlocks'
@@ -15490,8 +16224,8 @@ declare const editorMachine: StateMachine<
15490
16224
  | {
15491
16225
  type: 'notify.mutation'
15492
16226
  patches: Array<Patch>
15493
- snapshot: Array<PortableTextBlock> | undefined
15494
- value: Array<PortableTextBlock> | undefined
16227
+ snapshot: Array<PortableTextBlock_2> | undefined
16228
+ value: Array<PortableTextBlock_2> | undefined
15495
16229
  }
15496
16230
  | {
15497
16231
  type: 'notify.blurred'
@@ -15516,7 +16250,7 @@ declare const editorMachine: StateMachine<
15516
16250
  | {
15517
16251
  type: 'notify.invalid value'
15518
16252
  resolution: InvalidValueResolution | null
15519
- value: Array<PortableTextBlock> | undefined
16253
+ value: Array<PortableTextBlock_2> | undefined
15520
16254
  }
15521
16255
  | {
15522
16256
  type: 'notify.loading'
@@ -15533,11 +16267,11 @@ declare const editorMachine: StateMachine<
15533
16267
  }
15534
16268
  | {
15535
16269
  type: 'notify.value changed'
15536
- value: Array<PortableTextBlock> | undefined
16270
+ value: Array<PortableTextBlock_2> | undefined
15537
16271
  }
15538
16272
  | {
15539
16273
  type: 'notify.unset'
15540
- previousValue: Array<PortableTextBlock>
16274
+ previousValue: Array<PortableTextBlock_2>
15541
16275
  }
15542
16276
  | {
15543
16277
  type: 'dragstart'
@@ -15582,7 +16316,7 @@ declare const editorMachine: StateMachine<
15582
16316
  | {
15583
16317
  type: 'invalid value'
15584
16318
  resolution: InvalidValueResolution | null
15585
- value: Array<PortableTextBlock> | undefined
16319
+ value: Array<PortableTextBlock_2> | undefined
15586
16320
  }
15587
16321
  | {
15588
16322
  type: 'loading'
@@ -15599,7 +16333,7 @@ declare const editorMachine: StateMachine<
15599
16333
  }
15600
16334
  | {
15601
16335
  type: 'value changed'
15602
- value: Array<PortableTextBlock> | undefined
16336
+ value: Array<PortableTextBlock_2> | undefined
15603
16337
  }
15604
16338
  | UnsetEvent
15605
16339
  >
@@ -15616,7 +16350,7 @@ declare const editorMachine: StateMachine<
15616
16350
  initialReadOnly: boolean
15617
16351
  maxBlocks: number | undefined
15618
16352
  selection: EditorSelection_2
15619
- incomingValue: Array<PortableTextBlock> | undefined
16353
+ incomingValue: Array<PortableTextBlock_2> | undefined
15620
16354
  internalDrag?: {
15621
16355
  ghost?: HTMLElement
15622
16356
  origin: Pick<EventPosition_2, 'selection'>
@@ -15654,7 +16388,7 @@ declare const editorMachine: StateMachine<
15654
16388
  }
15655
16389
  | {
15656
16390
  type: 'update value'
15657
- value: Array<PortableTextBlock> | undefined
16391
+ value: Array<PortableTextBlock_2> | undefined
15658
16392
  }
15659
16393
  | {
15660
16394
  type: 'update maxBlocks'
@@ -15693,8 +16427,8 @@ declare const editorMachine: StateMachine<
15693
16427
  | {
15694
16428
  type: 'notify.mutation'
15695
16429
  patches: Array<Patch>
15696
- snapshot: Array<PortableTextBlock> | undefined
15697
- value: Array<PortableTextBlock> | undefined
16430
+ snapshot: Array<PortableTextBlock_2> | undefined
16431
+ value: Array<PortableTextBlock_2> | undefined
15698
16432
  }
15699
16433
  | {
15700
16434
  type: 'notify.blurred'
@@ -15719,7 +16453,7 @@ declare const editorMachine: StateMachine<
15719
16453
  | {
15720
16454
  type: 'notify.invalid value'
15721
16455
  resolution: InvalidValueResolution | null
15722
- value: Array<PortableTextBlock> | undefined
16456
+ value: Array<PortableTextBlock_2> | undefined
15723
16457
  }
15724
16458
  | {
15725
16459
  type: 'notify.loading'
@@ -15736,11 +16470,11 @@ declare const editorMachine: StateMachine<
15736
16470
  }
15737
16471
  | {
15738
16472
  type: 'notify.value changed'
15739
- value: Array<PortableTextBlock> | undefined
16473
+ value: Array<PortableTextBlock_2> | undefined
15740
16474
  }
15741
16475
  | {
15742
16476
  type: 'notify.unset'
15743
- previousValue: Array<PortableTextBlock>
16477
+ previousValue: Array<PortableTextBlock_2>
15744
16478
  }
15745
16479
  | {
15746
16480
  type: 'dragstart'
@@ -15785,7 +16519,7 @@ declare const editorMachine: StateMachine<
15785
16519
  | {
15786
16520
  type: 'invalid value'
15787
16521
  resolution: InvalidValueResolution | null
15788
- value: Array<PortableTextBlock> | undefined
16522
+ value: Array<PortableTextBlock_2> | undefined
15789
16523
  }
15790
16524
  | {
15791
16525
  type: 'loading'
@@ -15802,7 +16536,7 @@ declare const editorMachine: StateMachine<
15802
16536
  }
15803
16537
  | {
15804
16538
  type: 'value changed'
15805
- value: Array<PortableTextBlock> | undefined
16539
+ value: Array<PortableTextBlock_2> | undefined
15806
16540
  }
15807
16541
  | UnsetEvent
15808
16542
  >
@@ -15819,7 +16553,7 @@ declare const editorMachine: StateMachine<
15819
16553
  initialReadOnly: boolean
15820
16554
  maxBlocks: number | undefined
15821
16555
  selection: EditorSelection_2
15822
- incomingValue: Array<PortableTextBlock> | undefined
16556
+ incomingValue: Array<PortableTextBlock_2> | undefined
15823
16557
  internalDrag?: {
15824
16558
  ghost?: HTMLElement
15825
16559
  origin: Pick<EventPosition_2, 'selection'>
@@ -15828,7 +16562,7 @@ declare const editorMachine: StateMachine<
15828
16562
  },
15829
16563
  {
15830
16564
  type: 'notify.value changed'
15831
- value: Array<PortableTextBlock> | undefined
16565
+ value: Array<PortableTextBlock_2> | undefined
15832
16566
  },
15833
16567
  | InternalPatchEvent
15834
16568
  | MutationEvent
@@ -15858,7 +16592,7 @@ declare const editorMachine: StateMachine<
15858
16592
  }
15859
16593
  | {
15860
16594
  type: 'update value'
15861
- value: Array<PortableTextBlock> | undefined
16595
+ value: Array<PortableTextBlock_2> | undefined
15862
16596
  }
15863
16597
  | {
15864
16598
  type: 'update maxBlocks'
@@ -15897,8 +16631,8 @@ declare const editorMachine: StateMachine<
15897
16631
  | {
15898
16632
  type: 'notify.mutation'
15899
16633
  patches: Array<Patch>
15900
- snapshot: Array<PortableTextBlock> | undefined
15901
- value: Array<PortableTextBlock> | undefined
16634
+ snapshot: Array<PortableTextBlock_2> | undefined
16635
+ value: Array<PortableTextBlock_2> | undefined
15902
16636
  }
15903
16637
  | {
15904
16638
  type: 'notify.blurred'
@@ -15923,7 +16657,7 @@ declare const editorMachine: StateMachine<
15923
16657
  | {
15924
16658
  type: 'notify.invalid value'
15925
16659
  resolution: InvalidValueResolution | null
15926
- value: Array<PortableTextBlock> | undefined
16660
+ value: Array<PortableTextBlock_2> | undefined
15927
16661
  }
15928
16662
  | {
15929
16663
  type: 'notify.loading'
@@ -15940,11 +16674,11 @@ declare const editorMachine: StateMachine<
15940
16674
  }
15941
16675
  | {
15942
16676
  type: 'notify.value changed'
15943
- value: Array<PortableTextBlock> | undefined
16677
+ value: Array<PortableTextBlock_2> | undefined
15944
16678
  }
15945
16679
  | {
15946
16680
  type: 'notify.unset'
15947
- previousValue: Array<PortableTextBlock>
16681
+ previousValue: Array<PortableTextBlock_2>
15948
16682
  }
15949
16683
  | {
15950
16684
  type: 'dragstart'
@@ -15989,7 +16723,7 @@ declare const editorMachine: StateMachine<
15989
16723
  | {
15990
16724
  type: 'invalid value'
15991
16725
  resolution: InvalidValueResolution | null
15992
- value: Array<PortableTextBlock> | undefined
16726
+ value: Array<PortableTextBlock_2> | undefined
15993
16727
  }
15994
16728
  | {
15995
16729
  type: 'loading'
@@ -16006,7 +16740,7 @@ declare const editorMachine: StateMachine<
16006
16740
  }
16007
16741
  | {
16008
16742
  type: 'value changed'
16009
- value: Array<PortableTextBlock> | undefined
16743
+ value: Array<PortableTextBlock_2> | undefined
16010
16744
  }
16011
16745
  | UnsetEvent
16012
16746
  >
@@ -16029,7 +16763,7 @@ declare const editorMachine: StateMachine<
16029
16763
  initialReadOnly: boolean
16030
16764
  maxBlocks: number | undefined
16031
16765
  selection: EditorSelection_2
16032
- incomingValue: Array<PortableTextBlock> | undefined
16766
+ incomingValue: Array<PortableTextBlock_2> | undefined
16033
16767
  internalDrag?: {
16034
16768
  ghost?: HTMLElement
16035
16769
  origin: Pick<EventPosition_2, 'selection'>
@@ -16065,7 +16799,7 @@ declare const editorMachine: StateMachine<
16065
16799
  }
16066
16800
  | {
16067
16801
  type: 'update value'
16068
- value: Array<PortableTextBlock> | undefined
16802
+ value: Array<PortableTextBlock_2> | undefined
16069
16803
  }
16070
16804
  | {
16071
16805
  type: 'update maxBlocks'
@@ -16104,8 +16838,8 @@ declare const editorMachine: StateMachine<
16104
16838
  | {
16105
16839
  type: 'notify.mutation'
16106
16840
  patches: Array<Patch>
16107
- snapshot: Array<PortableTextBlock> | undefined
16108
- value: Array<PortableTextBlock> | undefined
16841
+ snapshot: Array<PortableTextBlock_2> | undefined
16842
+ value: Array<PortableTextBlock_2> | undefined
16109
16843
  }
16110
16844
  | {
16111
16845
  type: 'notify.blurred'
@@ -16130,7 +16864,7 @@ declare const editorMachine: StateMachine<
16130
16864
  | {
16131
16865
  type: 'notify.invalid value'
16132
16866
  resolution: InvalidValueResolution | null
16133
- value: Array<PortableTextBlock> | undefined
16867
+ value: Array<PortableTextBlock_2> | undefined
16134
16868
  }
16135
16869
  | {
16136
16870
  type: 'notify.loading'
@@ -16147,11 +16881,11 @@ declare const editorMachine: StateMachine<
16147
16881
  }
16148
16882
  | {
16149
16883
  type: 'notify.value changed'
16150
- value: Array<PortableTextBlock> | undefined
16884
+ value: Array<PortableTextBlock_2> | undefined
16151
16885
  }
16152
16886
  | {
16153
16887
  type: 'notify.unset'
16154
- previousValue: Array<PortableTextBlock>
16888
+ previousValue: Array<PortableTextBlock_2>
16155
16889
  }
16156
16890
  | {
16157
16891
  type: 'dragstart'
@@ -16196,7 +16930,7 @@ declare const editorMachine: StateMachine<
16196
16930
  | {
16197
16931
  type: 'invalid value'
16198
16932
  resolution: InvalidValueResolution | null
16199
- value: Array<PortableTextBlock> | undefined
16933
+ value: Array<PortableTextBlock_2> | undefined
16200
16934
  }
16201
16935
  | {
16202
16936
  type: 'loading'
@@ -16213,7 +16947,7 @@ declare const editorMachine: StateMachine<
16213
16947
  }
16214
16948
  | {
16215
16949
  type: 'value changed'
16216
- value: Array<PortableTextBlock> | undefined
16950
+ value: Array<PortableTextBlock_2> | undefined
16217
16951
  }
16218
16952
  | UnsetEvent
16219
16953
  >
@@ -16233,7 +16967,7 @@ declare const editorMachine: StateMachine<
16233
16967
  initialReadOnly: boolean
16234
16968
  maxBlocks: number | undefined
16235
16969
  selection: EditorSelection_2
16236
- incomingValue: Array<PortableTextBlock> | undefined
16970
+ incomingValue: Array<PortableTextBlock_2> | undefined
16237
16971
  internalDrag?: {
16238
16972
  ghost?: HTMLElement
16239
16973
  origin: Pick<EventPosition_2, 'selection'>
@@ -16272,7 +17006,7 @@ declare const editorMachine: StateMachine<
16272
17006
  }
16273
17007
  | {
16274
17008
  type: 'update value'
16275
- value: Array<PortableTextBlock> | undefined
17009
+ value: Array<PortableTextBlock_2> | undefined
16276
17010
  }
16277
17011
  | {
16278
17012
  type: 'update maxBlocks'
@@ -16311,8 +17045,8 @@ declare const editorMachine: StateMachine<
16311
17045
  | {
16312
17046
  type: 'notify.mutation'
16313
17047
  patches: Array<Patch>
16314
- snapshot: Array<PortableTextBlock> | undefined
16315
- value: Array<PortableTextBlock> | undefined
17048
+ snapshot: Array<PortableTextBlock_2> | undefined
17049
+ value: Array<PortableTextBlock_2> | undefined
16316
17050
  }
16317
17051
  | {
16318
17052
  type: 'notify.blurred'
@@ -16337,7 +17071,7 @@ declare const editorMachine: StateMachine<
16337
17071
  | {
16338
17072
  type: 'notify.invalid value'
16339
17073
  resolution: InvalidValueResolution | null
16340
- value: Array<PortableTextBlock> | undefined
17074
+ value: Array<PortableTextBlock_2> | undefined
16341
17075
  }
16342
17076
  | {
16343
17077
  type: 'notify.loading'
@@ -16354,11 +17088,11 @@ declare const editorMachine: StateMachine<
16354
17088
  }
16355
17089
  | {
16356
17090
  type: 'notify.value changed'
16357
- value: Array<PortableTextBlock> | undefined
17091
+ value: Array<PortableTextBlock_2> | undefined
16358
17092
  }
16359
17093
  | {
16360
17094
  type: 'notify.unset'
16361
- previousValue: Array<PortableTextBlock>
17095
+ previousValue: Array<PortableTextBlock_2>
16362
17096
  }
16363
17097
  | {
16364
17098
  type: 'dragstart'
@@ -16394,7 +17128,7 @@ declare const editorMachine: StateMachine<
16394
17128
  initialReadOnly: boolean
16395
17129
  maxBlocks: number | undefined
16396
17130
  selection: EditorSelection_2
16397
- incomingValue: Array<PortableTextBlock> | undefined
17131
+ incomingValue: Array<PortableTextBlock_2> | undefined
16398
17132
  internalDrag?: {
16399
17133
  ghost?: HTMLElement
16400
17134
  origin: Pick<EventPosition_2, 'selection'>
@@ -16403,7 +17137,7 @@ declare const editorMachine: StateMachine<
16403
17137
  },
16404
17138
  {
16405
17139
  type: 'update value'
16406
- value: Array<PortableTextBlock> | undefined
17140
+ value: Array<PortableTextBlock_2> | undefined
16407
17141
  },
16408
17142
  | InternalPatchEvent
16409
17143
  | MutationEvent
@@ -16433,7 +17167,7 @@ declare const editorMachine: StateMachine<
16433
17167
  }
16434
17168
  | {
16435
17169
  type: 'update value'
16436
- value: Array<PortableTextBlock> | undefined
17170
+ value: Array<PortableTextBlock_2> | undefined
16437
17171
  }
16438
17172
  | {
16439
17173
  type: 'update maxBlocks'
@@ -16472,8 +17206,8 @@ declare const editorMachine: StateMachine<
16472
17206
  | {
16473
17207
  type: 'notify.mutation'
16474
17208
  patches: Array<Patch>
16475
- snapshot: Array<PortableTextBlock> | undefined
16476
- value: Array<PortableTextBlock> | undefined
17209
+ snapshot: Array<PortableTextBlock_2> | undefined
17210
+ value: Array<PortableTextBlock_2> | undefined
16477
17211
  }
16478
17212
  | {
16479
17213
  type: 'notify.blurred'
@@ -16498,7 +17232,7 @@ declare const editorMachine: StateMachine<
16498
17232
  | {
16499
17233
  type: 'notify.invalid value'
16500
17234
  resolution: InvalidValueResolution | null
16501
- value: Array<PortableTextBlock> | undefined
17235
+ value: Array<PortableTextBlock_2> | undefined
16502
17236
  }
16503
17237
  | {
16504
17238
  type: 'notify.loading'
@@ -16515,11 +17249,11 @@ declare const editorMachine: StateMachine<
16515
17249
  }
16516
17250
  | {
16517
17251
  type: 'notify.value changed'
16518
- value: Array<PortableTextBlock> | undefined
17252
+ value: Array<PortableTextBlock_2> | undefined
16519
17253
  }
16520
17254
  | {
16521
17255
  type: 'notify.unset'
16522
- previousValue: Array<PortableTextBlock>
17256
+ previousValue: Array<PortableTextBlock_2>
16523
17257
  }
16524
17258
  | {
16525
17259
  type: 'dragstart'
@@ -16552,7 +17286,7 @@ declare const editorMachine: StateMachine<
16552
17286
  initialReadOnly: boolean
16553
17287
  maxBlocks: number | undefined
16554
17288
  selection: EditorSelection_2
16555
- incomingValue: Array<PortableTextBlock> | undefined
17289
+ incomingValue: Array<PortableTextBlock_2> | undefined
16556
17290
  internalDrag?: {
16557
17291
  ghost?: HTMLElement
16558
17292
  origin: Pick<EventPosition_2, 'selection'>
@@ -16591,7 +17325,7 @@ declare const editorMachine: StateMachine<
16591
17325
  }
16592
17326
  | {
16593
17327
  type: 'update value'
16594
- value: Array<PortableTextBlock> | undefined
17328
+ value: Array<PortableTextBlock_2> | undefined
16595
17329
  }
16596
17330
  | {
16597
17331
  type: 'update maxBlocks'
@@ -16630,8 +17364,8 @@ declare const editorMachine: StateMachine<
16630
17364
  | {
16631
17365
  type: 'notify.mutation'
16632
17366
  patches: Array<Patch>
16633
- snapshot: Array<PortableTextBlock> | undefined
16634
- value: Array<PortableTextBlock> | undefined
17367
+ snapshot: Array<PortableTextBlock_2> | undefined
17368
+ value: Array<PortableTextBlock_2> | undefined
16635
17369
  }
16636
17370
  | {
16637
17371
  type: 'notify.blurred'
@@ -16656,7 +17390,7 @@ declare const editorMachine: StateMachine<
16656
17390
  | {
16657
17391
  type: 'notify.invalid value'
16658
17392
  resolution: InvalidValueResolution | null
16659
- value: Array<PortableTextBlock> | undefined
17393
+ value: Array<PortableTextBlock_2> | undefined
16660
17394
  }
16661
17395
  | {
16662
17396
  type: 'notify.loading'
@@ -16673,11 +17407,11 @@ declare const editorMachine: StateMachine<
16673
17407
  }
16674
17408
  | {
16675
17409
  type: 'notify.value changed'
16676
- value: Array<PortableTextBlock> | undefined
17410
+ value: Array<PortableTextBlock_2> | undefined
16677
17411
  }
16678
17412
  | {
16679
17413
  type: 'notify.unset'
16680
- previousValue: Array<PortableTextBlock>
17414
+ previousValue: Array<PortableTextBlock_2>
16681
17415
  }
16682
17416
  | {
16683
17417
  type: 'dragstart'
@@ -16722,7 +17456,7 @@ declare const editorMachine: StateMachine<
16722
17456
  initialReadOnly: boolean
16723
17457
  maxBlocks: number | undefined
16724
17458
  selection: EditorSelection_2
16725
- incomingValue: Array<PortableTextBlock> | undefined
17459
+ incomingValue: Array<PortableTextBlock_2> | undefined
16726
17460
  internalDrag?: {
16727
17461
  ghost?: HTMLElement
16728
17462
  origin: Pick<EventPosition_2, 'selection'>
@@ -16761,7 +17495,7 @@ declare const editorMachine: StateMachine<
16761
17495
  initialReadOnly: boolean
16762
17496
  maxBlocks: number | undefined
16763
17497
  selection: EditorSelection_2
16764
- incomingValue: Array<PortableTextBlock> | undefined
17498
+ incomingValue: Array<PortableTextBlock_2> | undefined
16765
17499
  internalDrag?: {
16766
17500
  ghost?: HTMLElement
16767
17501
  origin: Pick<EventPosition_2, 'selection'>
@@ -16795,7 +17529,7 @@ declare const editorMachine: StateMachine<
16795
17529
  initialReadOnly: boolean
16796
17530
  maxBlocks: number | undefined
16797
17531
  selection: EditorSelection_2
16798
- incomingValue: Array<PortableTextBlock> | undefined
17532
+ incomingValue: Array<PortableTextBlock_2> | undefined
16799
17533
  internalDrag?: {
16800
17534
  ghost?: HTMLElement
16801
17535
  origin: Pick<EventPosition_2, 'selection'>
@@ -16830,7 +17564,7 @@ declare const editorMachine: StateMachine<
16830
17564
  initialReadOnly: boolean
16831
17565
  maxBlocks: number | undefined
16832
17566
  selection: EditorSelection_2
16833
- incomingValue: Array<PortableTextBlock> | undefined
17567
+ incomingValue: Array<PortableTextBlock_2> | undefined
16834
17568
  internalDrag?: {
16835
17569
  ghost?: HTMLElement
16836
17570
  origin: Pick<EventPosition_2, 'selection'>
@@ -16865,7 +17599,7 @@ declare const editorMachine: StateMachine<
16865
17599
  initialReadOnly: boolean
16866
17600
  maxBlocks: number | undefined
16867
17601
  selection: EditorSelection_2
16868
- incomingValue: Array<PortableTextBlock> | undefined
17602
+ incomingValue: Array<PortableTextBlock_2> | undefined
16869
17603
  internalDrag?: {
16870
17604
  ghost?: HTMLElement
16871
17605
  origin: Pick<EventPosition_2, 'selection'>
@@ -16904,7 +17638,7 @@ declare const editorMachine: StateMachine<
16904
17638
  }
16905
17639
  | {
16906
17640
  type: 'update value'
16907
- value: Array<PortableTextBlock> | undefined
17641
+ value: Array<PortableTextBlock_2> | undefined
16908
17642
  }
16909
17643
  | {
16910
17644
  type: 'update maxBlocks'
@@ -16943,8 +17677,8 @@ declare const editorMachine: StateMachine<
16943
17677
  | {
16944
17678
  type: 'notify.mutation'
16945
17679
  patches: Array<Patch>
16946
- snapshot: Array<PortableTextBlock> | undefined
16947
- value: Array<PortableTextBlock> | undefined
17680
+ snapshot: Array<PortableTextBlock_2> | undefined
17681
+ value: Array<PortableTextBlock_2> | undefined
16948
17682
  }
16949
17683
  | {
16950
17684
  type: 'notify.blurred'
@@ -16969,7 +17703,7 @@ declare const editorMachine: StateMachine<
16969
17703
  | {
16970
17704
  type: 'notify.invalid value'
16971
17705
  resolution: InvalidValueResolution | null
16972
- value: Array<PortableTextBlock> | undefined
17706
+ value: Array<PortableTextBlock_2> | undefined
16973
17707
  }
16974
17708
  | {
16975
17709
  type: 'notify.loading'
@@ -16986,11 +17720,11 @@ declare const editorMachine: StateMachine<
16986
17720
  }
16987
17721
  | {
16988
17722
  type: 'notify.value changed'
16989
- value: Array<PortableTextBlock> | undefined
17723
+ value: Array<PortableTextBlock_2> | undefined
16990
17724
  }
16991
17725
  | {
16992
17726
  type: 'notify.unset'
16993
- previousValue: Array<PortableTextBlock>
17727
+ previousValue: Array<PortableTextBlock_2>
16994
17728
  }
16995
17729
  | {
16996
17730
  type: 'dragstart'
@@ -17032,7 +17766,7 @@ declare const editorMachine: StateMachine<
17032
17766
  initialReadOnly: boolean
17033
17767
  maxBlocks: number | undefined
17034
17768
  selection: EditorSelection_2
17035
- incomingValue: Array<PortableTextBlock> | undefined
17769
+ incomingValue: Array<PortableTextBlock_2> | undefined
17036
17770
  internalDrag?: {
17037
17771
  ghost?: HTMLElement
17038
17772
  origin: Pick<EventPosition_2, 'selection'>
@@ -17072,7 +17806,7 @@ declare const editorMachine: StateMachine<
17072
17806
  }
17073
17807
  | {
17074
17808
  type: 'update value'
17075
- value: Array<PortableTextBlock> | undefined
17809
+ value: Array<PortableTextBlock_2> | undefined
17076
17810
  }
17077
17811
  | {
17078
17812
  type: 'update maxBlocks'
@@ -17111,8 +17845,8 @@ declare const editorMachine: StateMachine<
17111
17845
  | {
17112
17846
  type: 'notify.mutation'
17113
17847
  patches: Array<Patch>
17114
- snapshot: Array<PortableTextBlock> | undefined
17115
- value: Array<PortableTextBlock> | undefined
17848
+ snapshot: Array<PortableTextBlock_2> | undefined
17849
+ value: Array<PortableTextBlock_2> | undefined
17116
17850
  }
17117
17851
  | {
17118
17852
  type: 'notify.blurred'
@@ -17137,7 +17871,7 @@ declare const editorMachine: StateMachine<
17137
17871
  | {
17138
17872
  type: 'notify.invalid value'
17139
17873
  resolution: InvalidValueResolution | null
17140
- value: Array<PortableTextBlock> | undefined
17874
+ value: Array<PortableTextBlock_2> | undefined
17141
17875
  }
17142
17876
  | {
17143
17877
  type: 'notify.loading'
@@ -17154,11 +17888,11 @@ declare const editorMachine: StateMachine<
17154
17888
  }
17155
17889
  | {
17156
17890
  type: 'notify.value changed'
17157
- value: Array<PortableTextBlock> | undefined
17891
+ value: Array<PortableTextBlock_2> | undefined
17158
17892
  }
17159
17893
  | {
17160
17894
  type: 'notify.unset'
17161
- previousValue: Array<PortableTextBlock>
17895
+ previousValue: Array<PortableTextBlock_2>
17162
17896
  }
17163
17897
  | {
17164
17898
  type: 'dragstart'
@@ -17222,7 +17956,7 @@ declare const editorMachine: StateMachine<
17222
17956
  initialReadOnly: boolean
17223
17957
  maxBlocks: number | undefined
17224
17958
  selection: EditorSelection_2
17225
- incomingValue: Array<PortableTextBlock> | undefined
17959
+ incomingValue: Array<PortableTextBlock_2> | undefined
17226
17960
  internalDrag?: {
17227
17961
  ghost?: HTMLElement
17228
17962
  origin: Pick<EventPosition_2, 'selection'>
@@ -17257,7 +17991,7 @@ declare const editorMachine: StateMachine<
17257
17991
  }
17258
17992
  | {
17259
17993
  type: 'update value'
17260
- value: Array<PortableTextBlock> | undefined
17994
+ value: Array<PortableTextBlock_2> | undefined
17261
17995
  }
17262
17996
  | {
17263
17997
  type: 'update maxBlocks'
@@ -17296,8 +18030,8 @@ declare const editorMachine: StateMachine<
17296
18030
  | {
17297
18031
  type: 'notify.mutation'
17298
18032
  patches: Array<Patch>
17299
- snapshot: Array<PortableTextBlock> | undefined
17300
- value: Array<PortableTextBlock> | undefined
18033
+ snapshot: Array<PortableTextBlock_2> | undefined
18034
+ value: Array<PortableTextBlock_2> | undefined
17301
18035
  }
17302
18036
  | {
17303
18037
  type: 'notify.blurred'
@@ -17322,7 +18056,7 @@ declare const editorMachine: StateMachine<
17322
18056
  | {
17323
18057
  type: 'notify.invalid value'
17324
18058
  resolution: InvalidValueResolution | null
17325
- value: Array<PortableTextBlock> | undefined
18059
+ value: Array<PortableTextBlock_2> | undefined
17326
18060
  }
17327
18061
  | {
17328
18062
  type: 'notify.loading'
@@ -17339,11 +18073,11 @@ declare const editorMachine: StateMachine<
17339
18073
  }
17340
18074
  | {
17341
18075
  type: 'notify.value changed'
17342
- value: Array<PortableTextBlock> | undefined
18076
+ value: Array<PortableTextBlock_2> | undefined
17343
18077
  }
17344
18078
  | {
17345
18079
  type: 'notify.unset'
17346
- previousValue: Array<PortableTextBlock>
18080
+ previousValue: Array<PortableTextBlock_2>
17347
18081
  }
17348
18082
  | {
17349
18083
  type: 'dragstart'
@@ -17384,7 +18118,7 @@ declare const editorMachine: StateMachine<
17384
18118
  }
17385
18119
  | {
17386
18120
  type: 'update value'
17387
- value: Array<PortableTextBlock> | undefined
18121
+ value: Array<PortableTextBlock_2> | undefined
17388
18122
  }
17389
18123
  | {
17390
18124
  type: 'update maxBlocks'
@@ -17423,8 +18157,8 @@ declare const editorMachine: StateMachine<
17423
18157
  | {
17424
18158
  type: 'notify.mutation'
17425
18159
  patches: Array<Patch>
17426
- snapshot: Array<PortableTextBlock> | undefined
17427
- value: Array<PortableTextBlock> | undefined
18160
+ snapshot: Array<PortableTextBlock_2> | undefined
18161
+ value: Array<PortableTextBlock_2> | undefined
17428
18162
  }
17429
18163
  | {
17430
18164
  type: 'notify.blurred'
@@ -17449,7 +18183,7 @@ declare const editorMachine: StateMachine<
17449
18183
  | {
17450
18184
  type: 'notify.invalid value'
17451
18185
  resolution: InvalidValueResolution | null
17452
- value: Array<PortableTextBlock> | undefined
18186
+ value: Array<PortableTextBlock_2> | undefined
17453
18187
  }
17454
18188
  | {
17455
18189
  type: 'notify.loading'
@@ -17466,11 +18200,11 @@ declare const editorMachine: StateMachine<
17466
18200
  }
17467
18201
  | {
17468
18202
  type: 'notify.value changed'
17469
- value: Array<PortableTextBlock> | undefined
18203
+ value: Array<PortableTextBlock_2> | undefined
17470
18204
  }
17471
18205
  | {
17472
18206
  type: 'notify.unset'
17473
- previousValue: Array<PortableTextBlock>
18207
+ previousValue: Array<PortableTextBlock_2>
17474
18208
  }
17475
18209
  | {
17476
18210
  type: 'dragstart'
@@ -17495,7 +18229,7 @@ declare const editorMachine: StateMachine<
17495
18229
  initialReadOnly: boolean
17496
18230
  maxBlocks: number | undefined
17497
18231
  selection: EditorSelection_2
17498
- incomingValue: Array<PortableTextBlock> | undefined
18232
+ incomingValue: Array<PortableTextBlock_2> | undefined
17499
18233
  internalDrag?: {
17500
18234
  ghost?: HTMLElement
17501
18235
  origin: Pick<EventPosition_2, 'selection'>
@@ -17530,7 +18264,7 @@ declare const editorMachine: StateMachine<
17530
18264
  }
17531
18265
  | {
17532
18266
  type: 'update value'
17533
- value: Array<PortableTextBlock> | undefined
18267
+ value: Array<PortableTextBlock_2> | undefined
17534
18268
  }
17535
18269
  | {
17536
18270
  type: 'update maxBlocks'
@@ -17569,8 +18303,8 @@ declare const editorMachine: StateMachine<
17569
18303
  | {
17570
18304
  type: 'notify.mutation'
17571
18305
  patches: Array<Patch>
17572
- snapshot: Array<PortableTextBlock> | undefined
17573
- value: Array<PortableTextBlock> | undefined
18306
+ snapshot: Array<PortableTextBlock_2> | undefined
18307
+ value: Array<PortableTextBlock_2> | undefined
17574
18308
  }
17575
18309
  | {
17576
18310
  type: 'notify.blurred'
@@ -17595,7 +18329,7 @@ declare const editorMachine: StateMachine<
17595
18329
  | {
17596
18330
  type: 'notify.invalid value'
17597
18331
  resolution: InvalidValueResolution | null
17598
- value: Array<PortableTextBlock> | undefined
18332
+ value: Array<PortableTextBlock_2> | undefined
17599
18333
  }
17600
18334
  | {
17601
18335
  type: 'notify.loading'
@@ -17612,11 +18346,11 @@ declare const editorMachine: StateMachine<
17612
18346
  }
17613
18347
  | {
17614
18348
  type: 'notify.value changed'
17615
- value: Array<PortableTextBlock> | undefined
18349
+ value: Array<PortableTextBlock_2> | undefined
17616
18350
  }
17617
18351
  | {
17618
18352
  type: 'notify.unset'
17619
- previousValue: Array<PortableTextBlock>
18353
+ previousValue: Array<PortableTextBlock_2>
17620
18354
  }
17621
18355
  | {
17622
18356
  type: 'dragstart'
@@ -17657,7 +18391,7 @@ declare const editorMachine: StateMachine<
17657
18391
  }
17658
18392
  | {
17659
18393
  type: 'update value'
17660
- value: Array<PortableTextBlock> | undefined
18394
+ value: Array<PortableTextBlock_2> | undefined
17661
18395
  }
17662
18396
  | {
17663
18397
  type: 'update maxBlocks'
@@ -17696,8 +18430,8 @@ declare const editorMachine: StateMachine<
17696
18430
  | {
17697
18431
  type: 'notify.mutation'
17698
18432
  patches: Array<Patch>
17699
- snapshot: Array<PortableTextBlock> | undefined
17700
- value: Array<PortableTextBlock> | undefined
18433
+ snapshot: Array<PortableTextBlock_2> | undefined
18434
+ value: Array<PortableTextBlock_2> | undefined
17701
18435
  }
17702
18436
  | {
17703
18437
  type: 'notify.blurred'
@@ -17722,7 +18456,7 @@ declare const editorMachine: StateMachine<
17722
18456
  | {
17723
18457
  type: 'notify.invalid value'
17724
18458
  resolution: InvalidValueResolution | null
17725
- value: Array<PortableTextBlock> | undefined
18459
+ value: Array<PortableTextBlock_2> | undefined
17726
18460
  }
17727
18461
  | {
17728
18462
  type: 'notify.loading'
@@ -17739,11 +18473,11 @@ declare const editorMachine: StateMachine<
17739
18473
  }
17740
18474
  | {
17741
18475
  type: 'notify.value changed'
17742
- value: Array<PortableTextBlock> | undefined
18476
+ value: Array<PortableTextBlock_2> | undefined
17743
18477
  }
17744
18478
  | {
17745
18479
  type: 'notify.unset'
17746
- previousValue: Array<PortableTextBlock>
18480
+ previousValue: Array<PortableTextBlock_2>
17747
18481
  }
17748
18482
  | {
17749
18483
  type: 'dragstart'
@@ -17950,6 +18684,21 @@ export declare function effect(
17950
18684
  effect: () => void,
17951
18685
  ): PickFromUnion_2<BehaviorAction, 'type', 'effect'>
17952
18686
 
18687
+ /** @public */
18688
+ declare interface EmailDefinition extends BaseSchemaDefinition {
18689
+ type: 'email'
18690
+ options?: EmailOptions
18691
+ placeholder?: string
18692
+ validation?: ValidationBuilder<EmailRule, string>
18693
+ initialValue?: InitialValueProperty<any, string>
18694
+ }
18695
+
18696
+ /** @public */
18697
+ declare interface EmailOptions extends BaseSchemaTypeOptions {}
18698
+
18699
+ /** @public */
18700
+ declare interface EmailRule extends RuleDef<EmailRule, string> {}
18701
+
17953
18702
  /**
17954
18703
  * @beta
17955
18704
  */
@@ -17966,6 +18715,16 @@ export declare type EmojiPickerBehaviorsConfig<TEmojiMatch> = {
17966
18715
  parseMatch: ({match}: {match: TEmojiMatch}) => string | undefined
17967
18716
  }
17968
18717
 
18718
+ /** @public */
18719
+ declare interface EmptyProps {}
18720
+
18721
+ /** @public */
18722
+ declare interface EnumListProps<V = unknown> {
18723
+ list?: Array<TitledListValue<V> | V>
18724
+ layout?: 'radio' | 'dropdown'
18725
+ direction?: 'horizontal' | 'vertical'
18726
+ }
18727
+
17969
18728
  declare type EventPosition_2 = {
17970
18729
  block: 'start' | 'end'
17971
18730
  /**
@@ -17985,6 +18744,137 @@ export declare function execute(
17985
18744
  declare type ExtractNamespace<TType extends string> =
17986
18745
  TType extends `${infer Namespace}.${string}` ? Namespace : TType
17987
18746
 
18747
+ /**
18748
+ * The shape of a field definition. Note, it's recommended to use the
18749
+ * `defineField` function instead of using this type directly.
18750
+ *
18751
+ * Where `defineField` infers the exact field type,
18752
+ * FieldDefinition is a compromise union of all types a field can have.
18753
+ *
18754
+ * A field definition can be a reference to another registered top-level type
18755
+ * or a inline type definition.
18756
+ *
18757
+ * @public
18758
+ */
18759
+ declare type FieldDefinition<
18760
+ TType extends IntrinsicTypeName = IntrinsicTypeName,
18761
+ TAlias extends IntrinsicTypeName | undefined = undefined,
18762
+ > = (InlineFieldDefinition[TType] | TypeAliasDefinition<string, TAlias>) &
18763
+ FieldDefinitionBase
18764
+
18765
+ /** @public */
18766
+ declare interface FieldDefinitionBase {
18767
+ fieldset?: string
18768
+ group?: string | string[]
18769
+ }
18770
+
18771
+ /** @public */
18772
+ declare interface FieldGroup {
18773
+ name: string
18774
+ icon?: ComponentType
18775
+ title?: string
18776
+ description?: string
18777
+ i18n?: I18nTextRecord<'title'>
18778
+ hidden?: ConditionalProperty
18779
+ default?: boolean
18780
+ fields?: ObjectField[]
18781
+ }
18782
+
18783
+ /** @public */
18784
+ declare type FieldGroupDefinition = {
18785
+ name: string
18786
+ title?: string
18787
+ hidden?: ConditionalProperty
18788
+ icon?: ComponentType
18789
+ default?: boolean
18790
+ i18n?: I18nTextRecord<'title'>
18791
+ }
18792
+
18793
+ /**
18794
+ * Holds a reference to a different field
18795
+ * NOTE: Only use this through {@link Rule.valueOfField}
18796
+ *
18797
+ * @public
18798
+ */
18799
+ declare interface FieldReference {
18800
+ type: symbol
18801
+ path: string | string[]
18802
+ }
18803
+
18804
+ /** @public */
18805
+ declare type FieldRules = {
18806
+ [fieldKey: string]: SchemaValidationValue
18807
+ }
18808
+
18809
+ /** @public */
18810
+ declare type Fieldset = SingleFieldSet | MultiFieldSet
18811
+
18812
+ /** @public */
18813
+ declare type FieldsetDefinition = {
18814
+ name: string
18815
+ title?: string
18816
+ description?: string
18817
+ group?: string
18818
+ hidden?: ConditionalProperty
18819
+ readOnly?: ConditionalProperty
18820
+ options?: ObjectOptions
18821
+ }
18822
+
18823
+ /** @public */
18824
+ declare interface File_2 {
18825
+ [key: string]: unknown
18826
+ asset?: Reference
18827
+ }
18828
+
18829
+ /** @public */
18830
+ declare interface FileDefinition
18831
+ extends Omit<
18832
+ ObjectDefinition,
18833
+ 'type' | 'fields' | 'options' | 'groups' | 'validation'
18834
+ > {
18835
+ type: 'file'
18836
+ fields?: ObjectDefinition['fields']
18837
+ options?: FileOptions
18838
+ validation?: ValidationBuilder<FileRule, FileValue>
18839
+ initialValue?: InitialValueProperty<any, FileValue>
18840
+ }
18841
+
18842
+ /** @public */
18843
+ declare interface FileOptions extends ObjectOptions {
18844
+ storeOriginalFilename?: boolean
18845
+ accept?: string
18846
+ sources?: AssetSource[]
18847
+ }
18848
+
18849
+ /** @public */
18850
+ declare interface FileRule extends RuleDef<FileRule, FileValue> {
18851
+ /**
18852
+ * Require a file field has an asset.
18853
+ *
18854
+ * @example
18855
+ * ```ts
18856
+ * defineField({
18857
+ * name: 'file',
18858
+ * title: 'File',
18859
+ * type: 'file',
18860
+ * validation: (Rule) => Rule.required().assetRequired(),
18861
+ * })
18862
+ * ```
18863
+ */
18864
+ assetRequired(): FileRule
18865
+ }
18866
+
18867
+ /** @public */
18868
+ declare interface FileSchemaType extends Omit<ObjectSchemaType, 'options'> {
18869
+ options?: FileOptions
18870
+ }
18871
+
18872
+ /** @public */
18873
+ declare interface FileValue {
18874
+ asset?: Reference
18875
+ [index: string]: unknown
18876
+ }
18877
+
17988
18878
  /**
17989
18879
  * @beta
17990
18880
  */
@@ -17992,6 +18882,63 @@ export declare function forward(
17992
18882
  event: NativeBehaviorEvent | SyntheticBehaviorEvent | CustomBehaviorEvent,
17993
18883
  ): PickFromUnion_2<BehaviorAction, 'type', 'forward'>
17994
18884
 
18885
+ /** @public */
18886
+ declare interface GeopointDefinition extends BaseSchemaDefinition {
18887
+ type: 'geopoint'
18888
+ options?: GeopointOptions
18889
+ validation?: ValidationBuilder<GeopointRule, GeopointValue>
18890
+ initialValue?: InitialValueProperty<any, Omit<GeopointValue, '_type'>>
18891
+ }
18892
+
18893
+ /** @public */
18894
+ declare interface GeopointOptions extends BaseSchemaTypeOptions {}
18895
+
18896
+ /** @public */
18897
+ declare interface GeopointRule extends RuleDef<GeopointRule, GeopointValue> {}
18898
+
18899
+ /**
18900
+ * Geographical point representing a pair of latitude and longitude coordinates,
18901
+ * stored as degrees, in the World Geodetic System 1984 (WGS 84) format. Also
18902
+ * includes an optional `alt` property representing the altitude in meters.
18903
+ *
18904
+ * @public
18905
+ */
18906
+ declare interface GeopointValue {
18907
+ /**
18908
+ * Type of the object. Must be `geopoint`.
18909
+ */
18910
+ _type: 'geopoint'
18911
+ /**
18912
+ * Latitude in degrees
18913
+ */
18914
+ lat: number
18915
+ /**
18916
+ * Longitude in degrees
18917
+ */
18918
+ lng: number
18919
+ /**
18920
+ * Altitude in meters
18921
+ */
18922
+ alt?: number
18923
+ }
18924
+
18925
+ /** @public */
18926
+ declare interface GlobalDocumentReferenceDefinition
18927
+ extends BaseSchemaDefinition {
18928
+ type: 'globalDocumentReference'
18929
+ weak?: boolean
18930
+ to: {
18931
+ type: string
18932
+ title?: string
18933
+ icon?: ComponentType
18934
+ preview?: PreviewConfig
18935
+ }[]
18936
+ resourceType: string
18937
+ resourceId: string
18938
+ options?: ReferenceOptions
18939
+ studioUrl?: (document: {id: string; type?: string}) => string | null
18940
+ }
18941
+
17995
18942
  declare type HasTag = ReturnType<EditorActor['getSnapshot']>['hasTag']
17996
18943
 
17997
18944
  declare interface History_2 {
@@ -18004,6 +18951,178 @@ declare type HistoryItem = {
18004
18951
  timestamp: Date
18005
18952
  }
18006
18953
 
18954
+ /** @public */
18955
+ declare interface HotspotOptions {
18956
+ previews?: HotspotPreview[]
18957
+ }
18958
+
18959
+ /** @public */
18960
+ declare interface HotspotPreview {
18961
+ title: string
18962
+ aspectRatio: number
18963
+ }
18964
+
18965
+ /** @public */
18966
+ declare type I18nTextRecord<K extends string> = {
18967
+ [P in K]?: {
18968
+ key: string
18969
+ ns: string
18970
+ }
18971
+ }
18972
+
18973
+ /** @public */
18974
+ declare interface ImageAsset extends Asset {
18975
+ _type: 'sanity.imageAsset'
18976
+ metadata: ImageMetadata
18977
+ }
18978
+
18979
+ /** @public */
18980
+ declare interface ImageCrop {
18981
+ _type?: 'sanity.imageCrop'
18982
+ left: number
18983
+ bottom: number
18984
+ right: number
18985
+ top: number
18986
+ }
18987
+
18988
+ /** @public */
18989
+ declare interface ImageDefinition
18990
+ extends Omit<
18991
+ ObjectDefinition,
18992
+ 'type' | 'fields' | 'options' | 'groups' | 'validation'
18993
+ > {
18994
+ type: 'image'
18995
+ fields?: FieldDefinition[]
18996
+ options?: ImageOptions
18997
+ validation?: ValidationBuilder<ImageRule, ImageValue>
18998
+ initialValue?: InitialValueProperty<any, ImageValue>
18999
+ }
19000
+
19001
+ /** @public */
19002
+ declare interface ImageDimensions {
19003
+ _type: 'sanity.imageDimensions'
19004
+ height: number
19005
+ width: number
19006
+ aspectRatio: number
19007
+ }
19008
+
19009
+ /** @public */
19010
+ declare interface ImageHotspot {
19011
+ _type?: 'sanity.imageHotspot'
19012
+ width: number
19013
+ height: number
19014
+ x: number
19015
+ y: number
19016
+ }
19017
+
19018
+ /** @public */
19019
+ declare interface ImageMetadata {
19020
+ [key: string]: unknown
19021
+ _type: 'sanity.imageMetadata'
19022
+ dimensions: ImageDimensions
19023
+ palette?: ImagePalette
19024
+ lqip?: string
19025
+ blurHash?: string
19026
+ hasAlpha: boolean
19027
+ isOpaque: boolean
19028
+ }
19029
+
19030
+ /** @public */
19031
+ declare type ImageMetadataType =
19032
+ | 'blurhash'
19033
+ | 'lqip'
19034
+ | 'palette'
19035
+ | 'exif'
19036
+ | 'image'
19037
+ | 'location'
19038
+
19039
+ /** @public */
19040
+ declare interface ImageOptions extends FileOptions {
19041
+ metadata?: ImageMetadataType[]
19042
+ hotspot?: boolean | HotspotOptions
19043
+ }
19044
+
19045
+ /** @public */
19046
+ declare interface ImagePalette {
19047
+ _type: 'sanity.imagePalette'
19048
+ darkMuted?: ImageSwatch
19049
+ darkVibrant?: ImageSwatch
19050
+ dominant?: ImageSwatch
19051
+ lightMuted?: ImageSwatch
19052
+ lightVibrant?: ImageSwatch
19053
+ muted?: ImageSwatch
19054
+ vibrant?: ImageSwatch
19055
+ }
19056
+
19057
+ /** @public */
19058
+ declare interface ImageRule extends RuleDef<ImageRule, ImageValue> {
19059
+ /**
19060
+ * Require an image field has an asset.
19061
+ *
19062
+ * @example
19063
+ * ```ts
19064
+ * defineField({
19065
+ * name: 'image',
19066
+ * title: 'Image',
19067
+ * type: 'image',
19068
+ * validation: (Rule) => Rule.required().assetRequired(),
19069
+ * })
19070
+ * ```
19071
+ */
19072
+ assetRequired(): ImageRule
19073
+ }
19074
+
19075
+ /** @public */
19076
+ declare interface ImageSwatch {
19077
+ _type: 'sanity.imagePaletteSwatch'
19078
+ background: string
19079
+ foreground: string
19080
+ population: number
19081
+ title?: string
19082
+ }
19083
+
19084
+ /** @public */
19085
+ declare interface ImageValue extends FileValue {
19086
+ crop?: ImageCrop
19087
+ hotspot?: ImageHotspot
19088
+ [index: string]: unknown
19089
+ }
19090
+
19091
+ /** @public */
19092
+ declare type IndexTuple = [number | '', number | '']
19093
+
19094
+ /** @public */
19095
+ declare type InitialValueProperty<Params, Value> =
19096
+ | Value
19097
+ | InitialValueResolver<Params, Value>
19098
+ | undefined
19099
+
19100
+ /** @public */
19101
+ declare type InitialValueResolver<Params, Value> = (
19102
+ params: Params | undefined,
19103
+ context: InitialValueResolverContext,
19104
+ ) => Promise<Value> | Value
19105
+
19106
+ /** @public */
19107
+ declare interface InitialValueResolverContext {
19108
+ projectId: string
19109
+ dataset: string
19110
+ schema: Schema
19111
+ currentUser: CurrentUser | null
19112
+ getClient: (options: {apiVersion: string}) => SanityClient
19113
+ }
19114
+
19115
+ /** @public */
19116
+ declare type InlineFieldDefinition = {
19117
+ [K in keyof IntrinsicDefinitions]: Omit<
19118
+ IntrinsicDefinitions[K],
19119
+ 'initialValue' | 'validation'
19120
+ > & {
19121
+ validation?: SchemaValidationValue
19122
+ initialValue?: InitialValueProperty<any, any>
19123
+ }
19124
+ }
19125
+
18007
19126
  /**
18008
19127
  * Used to represent native InputEvents that hold a DataTransfer object.
18009
19128
  *
@@ -18022,13 +19141,98 @@ declare type InputBehaviorEvent_2 = {
18022
19141
  }
18023
19142
  }
18024
19143
 
19144
+ /** @alpha This API may change */
19145
+ declare interface InsertMenuOptions {
19146
+ /**
19147
+ * @defaultValue `'auto'`
19148
+ * `filter: 'auto'` automatically turns on filtering if there are more than 5
19149
+ * schema types added to the menu.
19150
+ */
19151
+ filter?: 'auto' | boolean
19152
+ groups?: Array<{
19153
+ name: string
19154
+ title?: string
19155
+ of?: Array<string>
19156
+ }>
19157
+ /** defaultValue `true` */
19158
+ showIcons?: boolean
19159
+ /** @defaultValue `[{name: 'list'}]` */
19160
+ views?: Array<
19161
+ | {
19162
+ name: 'list'
19163
+ }
19164
+ | {
19165
+ name: 'grid'
19166
+ previewImageUrl?: (schemaTypeName: string) => string | undefined
19167
+ }
19168
+ >
19169
+ }
19170
+
18025
19171
  declare type InsertPlacement_2 = 'auto' | 'after' | 'before'
18026
19172
 
18027
19173
  declare type InternalPatchEvent = NamespaceEvent<PatchEvent, 'internal'> & {
18028
19174
  actionId?: string
18029
- value: Array<PortableTextBlock>
19175
+ value: Array<PortableTextBlock_2>
19176
+ }
19177
+
19178
+ /** @public */
19179
+ declare type IntrinsicArrayOfDefinition = {
19180
+ [K in keyof IntrinsicDefinitions]: Omit<
19181
+ ArrayOfEntry<IntrinsicDefinitions[K]>,
19182
+ 'validation' | 'initialValue'
19183
+ > & {
19184
+ validation?: SchemaValidationValue
19185
+ initialValue?: InitialValueProperty<any, any>
19186
+ }
19187
+ }
19188
+
19189
+ /**
19190
+ * `IntrinsicDefinitions` is a lookup map for "predefined" schema definitions.
19191
+ * Schema types in `IntrinsicDefinitions` will have good type-completion and type-safety in {@link defineType},
19192
+ * {@link defineField} and {@link defineArrayMember} once the `type` property is provided.
19193
+ *
19194
+ * By default, `IntrinsicDefinitions` contains all standard Sanity schema types (`array`, `string`, `number` ect),
19195
+ * but it is an interface and as such, open for extension.
19196
+ *
19197
+ * This type can be extended using declaration merging; this way new entries can be added.
19198
+ * See {@link defineType} for examples on how this can be accomplished.
19199
+ *
19200
+ * @see defineType
19201
+ *
19202
+ * @public
19203
+ */
19204
+ declare interface IntrinsicDefinitions {
19205
+ array: ArrayDefinition
19206
+ block: BlockDefinition
19207
+ boolean: BooleanDefinition
19208
+ date: DateDefinition
19209
+ datetime: DatetimeDefinition
19210
+ document: DocumentDefinition
19211
+ file: FileDefinition
19212
+ geopoint: GeopointDefinition
19213
+ image: ImageDefinition
19214
+ number: NumberDefinition
19215
+ object: ObjectDefinition
19216
+ reference: ReferenceDefinition
19217
+ crossDatasetReference: CrossDatasetReferenceDefinition
19218
+ globalDocumentReference: GlobalDocumentReferenceDefinition
19219
+ slug: SlugDefinition
19220
+ string: StringDefinition
19221
+ text: TextDefinition
19222
+ url: UrlDefinition
19223
+ email: EmailDefinition
18030
19224
  }
18031
19225
 
19226
+ /**
19227
+ * A union of all intrinsic types allowed natively in the schema.
19228
+ *
19229
+ * @see IntrinsicDefinitions
19230
+ *
19231
+ * @public
19232
+ */
19233
+ declare type IntrinsicTypeName =
19234
+ IntrinsicDefinitions[keyof IntrinsicDefinitions]['type']
19235
+
18032
19236
  /**
18033
19237
  * The editor has invalid data in the value that can be resolved by the user
18034
19238
  * @beta */
@@ -18037,7 +19241,11 @@ declare type InvalidValueResolution = {
18037
19241
  patches: Patch[]
18038
19242
  description: string
18039
19243
  action: string
18040
- item: PortableTextBlock[] | PortableTextBlock | PortableTextChild | undefined
19244
+ item:
19245
+ | PortableTextBlock_2[]
19246
+ | PortableTextBlock_2
19247
+ | PortableTextChild
19248
+ | undefined
18041
19249
  /**
18042
19250
  * i18n keys for the description and action
18043
19251
  *
@@ -18068,6 +19276,11 @@ declare type KeyboardBehaviorEvent =
18068
19276
  >
18069
19277
  }
18070
19278
 
19279
+ /** @public */
19280
+ declare type KeyedSegment_2 = {
19281
+ _key: string
19282
+ }
19283
+
18071
19284
  /**
18072
19285
  * @beta
18073
19286
  */
@@ -18082,6 +19295,22 @@ export declare type LinkBehaviorsConfig = {
18082
19295
  | undefined
18083
19296
  }
18084
19297
 
19298
+ /**
19299
+ * Holds localized validation messages for a given field.
19300
+ *
19301
+ * @example Custom message for English (US) and Norwegian (Bokmål):
19302
+ * ```
19303
+ * {
19304
+ * 'en-US': 'Needs to start with a capital letter',
19305
+ * 'no-NB': 'Må starte med stor bokstav',
19306
+ * }
19307
+ * ```
19308
+ * @public
19309
+ */
19310
+ declare interface LocalizedValidationMessages {
19311
+ [locale: string]: string
19312
+ }
19313
+
18085
19314
  /**
18086
19315
  * @beta
18087
19316
  */
@@ -18111,6 +19340,21 @@ declare type MouseBehaviorEvent_2 = {
18111
19340
  position: EventPosition_2
18112
19341
  }
18113
19342
 
19343
+ /** @public */
19344
+ declare interface MultiFieldSet {
19345
+ name: string
19346
+ title?: string
19347
+ description?: string
19348
+ single?: false
19349
+ group?: string | string[]
19350
+ options?: CollapseOptions & {
19351
+ columns?: number
19352
+ }
19353
+ fields: ObjectField[]
19354
+ hidden?: ConditionalProperty
19355
+ readOnly?: ConditionalProperty
19356
+ }
19357
+
18114
19358
  /**
18115
19359
  * @public
18116
19360
  */
@@ -18120,8 +19364,8 @@ declare type MutationEvent = {
18120
19364
  /**
18121
19365
  * @deprecated Use `value` instead
18122
19366
  */
18123
- snapshot: Array<PortableTextBlock> | undefined
18124
- value: Array<PortableTextBlock> | undefined
19367
+ snapshot: Array<PortableTextBlock_2> | undefined
19368
+ value: Array<PortableTextBlock_2> | undefined
18125
19369
  }
18126
19370
 
18127
19371
  declare type NamespacedBehaviorEventType<
@@ -18178,33 +19422,155 @@ declare const nativeBehaviorEventTypes: readonly [
18178
19422
  'mouse.click',
18179
19423
  ]
18180
19424
 
19425
+ /** @public */
19426
+ declare interface NumberDefinition extends BaseSchemaDefinition {
19427
+ type: 'number'
19428
+ options?: NumberOptions
19429
+ placeholder?: string
19430
+ validation?: ValidationBuilder<NumberRule, number>
19431
+ initialValue?: InitialValueProperty<any, number>
19432
+ }
19433
+
19434
+ /** @public */
19435
+ declare interface NumberOptions
19436
+ extends EnumListProps<number>,
19437
+ BaseSchemaTypeOptions {}
19438
+
19439
+ /** @public */
19440
+ declare interface NumberRule extends RuleDef<NumberRule, number> {
19441
+ min: (minNumber: number | FieldReference) => NumberRule
19442
+ max: (maxNumber: number | FieldReference) => NumberRule
19443
+ lessThan: (limit: number | FieldReference) => NumberRule
19444
+ greaterThan: (limit: number | FieldReference) => NumberRule
19445
+ integer: () => NumberRule
19446
+ precision: (limit: number | FieldReference) => NumberRule
19447
+ positive: () => NumberRule
19448
+ negative: () => NumberRule
19449
+ }
19450
+
19451
+ /** @public */
19452
+ declare interface NumberSchemaType extends BaseSchemaType {
19453
+ jsonType: 'number'
19454
+ options?: NumberOptions
19455
+ initialValue?: InitialValueProperty<any, number>
19456
+ }
19457
+
18181
19458
  declare type ObjectBlockWithOptionalKey = Omit<PortableTextObject, '_key'> & {
18182
19459
  _key?: PortableTextObject['_key']
18183
19460
  }
18184
19461
 
18185
- /**
18186
- * @public
18187
- */
18188
- declare type PatchesEvent = {
18189
- type: 'patches'
18190
- patches: Array<Patch>
18191
- snapshot: Array<PortableTextBlock> | undefined
19462
+ /** @public */
19463
+ declare interface ObjectDefinition extends BaseSchemaDefinition {
19464
+ type: 'object'
19465
+ /**
19466
+ * Object must have at least one field. This is validated at Studio startup.
19467
+ */
19468
+ fields: FieldDefinition[]
19469
+ groups?: FieldGroupDefinition[]
19470
+ fieldsets?: FieldsetDefinition[]
19471
+ preview?: PreviewConfig
19472
+ options?: ObjectOptions
19473
+ validation?: ValidationBuilder<ObjectRule, Record<string, unknown>>
19474
+ initialValue?: InitialValueProperty<any, Record<string, unknown>>
18192
19475
  }
18193
19476
 
18194
- declare type PatchEvent = {
18195
- type: 'patch'
18196
- patch: Patch
19477
+ /** @public */
19478
+ declare interface ObjectField<T extends SchemaType = SchemaType> {
19479
+ name: string
19480
+ fieldset?: string
19481
+ group?: string | string[]
19482
+ type: ObjectFieldType<T>
18197
19483
  }
18198
19484
 
18199
- /**
18200
- * @internal
18201
- */
18202
- declare type PickFromUnion_2<
18203
- TUnion,
18204
- TTagKey extends keyof TUnion,
18205
- TPickedTags extends TUnion[TTagKey],
19485
+ /** @public */
19486
+ declare type ObjectFieldType<T extends SchemaType = SchemaType> = T & {
19487
+ hidden?: ConditionalProperty
19488
+ readOnly?: ConditionalProperty
19489
+ }
19490
+
19491
+ /** @public */
19492
+ declare interface ObjectOptions extends BaseSchemaTypeOptions {
19493
+ collapsible?: boolean
19494
+ collapsed?: boolean
19495
+ columns?: number
19496
+ modal?: {
19497
+ type?: 'dialog' | 'popover'
19498
+ width?: number | number[] | 'auto'
19499
+ }
19500
+ }
19501
+
19502
+ /** @public */
19503
+ declare interface ObjectRule
19504
+ extends RuleDef<ObjectRule, Record<string, unknown>> {}
19505
+
19506
+ /** @public */
19507
+ declare interface ObjectSchemaType extends BaseSchemaType {
19508
+ jsonType: 'object'
19509
+ fields: ObjectField[]
19510
+ groups?: FieldGroup[]
19511
+ fieldsets?: Fieldset[]
19512
+ initialValue?: InitialValueProperty<any, Record<string, unknown>>
19513
+ weak?: boolean
19514
+ /** @deprecated Unused. Use the new field-level search config. */
19515
+ __experimental_search?: {
19516
+ path: (string | number)[]
19517
+ weight: number
19518
+ mapWith?: string
19519
+ }[]
19520
+ /** @alpha */
19521
+ __experimental_omnisearch_visibility?: boolean
19522
+ /** @alpha */
19523
+ __experimental_actions?: string[]
19524
+ /** @alpha */
19525
+ __experimental_formPreviewTitle?: boolean
19526
+ /**
19527
+ * @beta
19528
+ */
19529
+ orderings?: SortOrdering[]
19530
+ options?: any
19531
+ }
19532
+
19533
+ /**
19534
+ * @public
19535
+ */
19536
+ declare type PatchesEvent = {
19537
+ type: 'patches'
19538
+ patches: Array<Patch>
19539
+ snapshot: Array<PortableTextBlock_2> | undefined
19540
+ }
19541
+
19542
+ declare type PatchEvent = {
19543
+ type: 'patch'
19544
+ patch: Patch
19545
+ }
19546
+
19547
+ /** @public */
19548
+ declare type Path = PathSegment[]
19549
+
19550
+ /** @public */
19551
+ declare type PathSegment = string | number | KeyedSegment_2 | IndexTuple
19552
+
19553
+ /**
19554
+ * @internal
19555
+ */
19556
+ declare type PickFromUnion_2<
19557
+ TUnion,
19558
+ TTagKey extends keyof TUnion,
19559
+ TPickedTags extends TUnion[TTagKey],
18206
19560
  > = TUnion extends Record<TTagKey, TPickedTags> ? TUnion : never
18207
19561
 
19562
+ /** @alpha */
19563
+ declare type PortableTextBlock_2 = PortableTextTextBlock | PortableTextObject
19564
+
19565
+ /** @alpha */
19566
+ declare type PortableTextChild = PortableTextObject | PortableTextSpan
19567
+
19568
+ /** @alpha */
19569
+ declare interface PortableTextListBlock extends PortableTextTextBlock {
19570
+ listItem: string
19571
+ level: number
19572
+ }
19573
+
18208
19574
  /** @beta */
18209
19575
  declare type PortableTextMemberSchemaTypes = {
18210
19576
  annotations: (ObjectSchemaType & {
@@ -18214,12 +19580,19 @@ declare type PortableTextMemberSchemaTypes = {
18214
19580
  blockObjects: ObjectSchemaType[]
18215
19581
  decorators: BlockDecoratorDefinition[]
18216
19582
  inlineObjects: ObjectSchemaType[]
18217
- portableText: ArraySchemaType<PortableTextBlock>
19583
+ portableText: ArraySchemaType<PortableTextBlock_2>
18218
19584
  span: ObjectSchemaType
18219
19585
  styles: BlockStyleDefinition[]
18220
19586
  lists: BlockListDefinition[]
18221
19587
  }
18222
19588
 
19589
+ /** @alpha */
19590
+ declare interface PortableTextObject {
19591
+ _type: string
19592
+ _key: string
19593
+ [other: string]: unknown
19594
+ }
19595
+
18223
19596
  declare interface PortableTextSlateEditor extends ReactEditor {
18224
19597
  _key: 'editor'
18225
19598
  _type: 'editor'
@@ -18253,6 +19626,57 @@ declare interface PortableTextSlateEditor extends ReactEditor {
18253
19626
  redo: () => void
18254
19627
  }
18255
19628
 
19629
+ /** @alpha */
19630
+ declare interface PortableTextSpan {
19631
+ _key: string
19632
+ _type: 'span'
19633
+ text: string
19634
+ marks?: string[]
19635
+ }
19636
+
19637
+ /** @alpha */
19638
+ declare interface PortableTextTextBlock<
19639
+ TChild = PortableTextSpan | PortableTextObject,
19640
+ > {
19641
+ _type: string
19642
+ _key: string
19643
+ children: TChild[]
19644
+ markDefs?: PortableTextObject[]
19645
+ listItem?: string
19646
+ style?: string
19647
+ level?: number
19648
+ }
19649
+
19650
+ /** @public */
19651
+ declare interface PrepareViewOptions {
19652
+ /** @beta */
19653
+ ordering?: SortOrdering
19654
+ }
19655
+
19656
+ /** @public */
19657
+ declare interface PreviewConfig<
19658
+ Select extends Record<string, string> = Record<string, string>,
19659
+ PrepareValue extends Record<keyof Select, any> = Record<keyof Select, any>,
19660
+ > {
19661
+ select?: Select
19662
+ prepare?: (
19663
+ value: PrepareValue,
19664
+ viewOptions?: PrepareViewOptions,
19665
+ ) => PreviewValue
19666
+ }
19667
+
19668
+ /** @public */
19669
+ declare interface PreviewValue {
19670
+ _id?: string
19671
+ _createdAt?: string
19672
+ _updatedAt?: string
19673
+ title?: string
19674
+ subtitle?: string
19675
+ description?: string
19676
+ media?: ReactNode | ElementType
19677
+ imageUrl?: string
19678
+ }
19679
+
18256
19680
  /**
18257
19681
  * @beta
18258
19682
  */
@@ -18260,6 +19684,111 @@ export declare function raise(
18260
19684
  event: SyntheticBehaviorEvent | CustomBehaviorEvent,
18261
19685
  ): PickFromUnion_2<BehaviorAction, 'type', 'raise'>
18262
19686
 
19687
+ /** @public */
19688
+ declare interface Reference {
19689
+ _type: string
19690
+ _ref: string
19691
+ _key?: string
19692
+ _weak?: boolean
19693
+ _strengthenOnPublish?: {
19694
+ type: string
19695
+ weak?: boolean
19696
+ template?: {
19697
+ id: string
19698
+ params: Record<string, string | number | boolean>
19699
+ }
19700
+ }
19701
+ }
19702
+
19703
+ /** @public */
19704
+ declare interface ReferenceBaseOptions extends BaseSchemaTypeOptions {
19705
+ disableNew?: boolean
19706
+ }
19707
+
19708
+ /** @public */
19709
+ declare interface ReferenceDefinition extends BaseSchemaDefinition {
19710
+ type: 'reference'
19711
+ to: ReferenceTo
19712
+ weak?: boolean
19713
+ options?: ReferenceOptions
19714
+ validation?: ValidationBuilder<ReferenceRule, ReferenceValue>
19715
+ initialValue?: InitialValueProperty<any, Omit<ReferenceValue, '_type'>>
19716
+ }
19717
+
19718
+ /** @public */
19719
+ declare type ReferenceFilterOptions =
19720
+ | ReferenceFilterResolverOptions
19721
+ | ReferenceFilterQueryOptions
19722
+
19723
+ /** @public */
19724
+ declare interface ReferenceFilterQueryOptions {
19725
+ filter: string
19726
+ filterParams?: Record<string, unknown>
19727
+ }
19728
+
19729
+ /** @public */
19730
+ declare type ReferenceFilterResolver = (
19731
+ context: ReferenceFilterResolverContext,
19732
+ ) => ReferenceFilterSearchOptions | Promise<ReferenceFilterSearchOptions>
19733
+
19734
+ /** @public */
19735
+ declare interface ReferenceFilterResolverContext {
19736
+ document: SanityDocument
19737
+ parent?: Record<string, unknown> | Record<string, unknown>[]
19738
+ parentPath: Path
19739
+ getClient: (options: {apiVersion: string}) => SanityClient
19740
+ }
19741
+
19742
+ /** @public */
19743
+ declare interface ReferenceFilterResolverOptions {
19744
+ filter?: ReferenceFilterResolver
19745
+ filterParams?: never
19746
+ }
19747
+
19748
+ /** @public */
19749
+ declare type ReferenceFilterSearchOptions = {
19750
+ filter?: string
19751
+ params?: Record<string, unknown>
19752
+ tag?: string
19753
+ maxFieldDepth?: number
19754
+ strategy?: SearchStrategy
19755
+ perspective?: ClientPerspective
19756
+ }
19757
+
19758
+ /**
19759
+ * Types are closed for extension. To add properties via declaration merging to this type,
19760
+ * redeclare and add the properties to the interfaces that make up ReferenceOptions type.
19761
+ *
19762
+ * @see ReferenceFilterOptions
19763
+ * @see ReferenceFilterResolverOptions
19764
+ * @see ReferenceBaseOptions
19765
+ *
19766
+ * @public
19767
+ */
19768
+ declare type ReferenceOptions = ReferenceBaseOptions & ReferenceFilterOptions
19769
+
19770
+ /** @public */
19771
+ declare interface ReferenceRule
19772
+ extends RuleDef<ReferenceRule, ReferenceValue> {}
19773
+
19774
+ /** @public */
19775
+ declare interface ReferenceSchemaType
19776
+ extends Omit<ObjectSchemaType, 'options'> {
19777
+ jsonType: 'object'
19778
+ to: ObjectSchemaType[]
19779
+ weak?: boolean
19780
+ options?: ReferenceOptions
19781
+ }
19782
+
19783
+ /** @public */
19784
+ declare type ReferenceTo =
19785
+ | SchemaTypeDefinition
19786
+ | TypeReference
19787
+ | Array<SchemaTypeDefinition | TypeReference>
19788
+
19789
+ /** @public */
19790
+ declare type ReferenceValue = Reference
19791
+
18263
19792
  /**************************************
18264
19793
  * Resolve behavior event
18265
19794
  **************************************/
@@ -18285,6 +19814,437 @@ declare type ResolveBehaviorEvent<
18285
19814
  ? PickFromUnion_2<BehaviorEvent, 'type', TBehaviorEventType>
18286
19815
  : never
18287
19816
 
19817
+ /** @public */
19818
+ declare interface Role {
19819
+ name: string
19820
+ title: string
19821
+ description?: string
19822
+ }
19823
+
19824
+ /** @public */
19825
+ declare interface Rule {
19826
+ /**
19827
+ * @internal
19828
+ * @deprecated internal use only
19829
+ */
19830
+ _type: RuleTypeConstraint | undefined
19831
+ /**
19832
+ * @internal
19833
+ * @deprecated internal use only
19834
+ */
19835
+ _level: 'error' | 'warning' | 'info' | undefined
19836
+ /**
19837
+ * @internal
19838
+ * @deprecated internal use only
19839
+ */
19840
+ _required: 'required' | 'optional' | undefined
19841
+ /**
19842
+ * @internal
19843
+ * @deprecated internal use only
19844
+ */
19845
+ _typeDef: SchemaType | undefined
19846
+ /**
19847
+ * @internal
19848
+ * @deprecated internal use only
19849
+ */
19850
+ _message: string | LocalizedValidationMessages | undefined
19851
+ /**
19852
+ * @internal
19853
+ * @deprecated internal use only
19854
+ */
19855
+ _rules: RuleSpec[]
19856
+ /**
19857
+ * @internal
19858
+ * @deprecated internal use only
19859
+ */
19860
+ _fieldRules: FieldRules | undefined
19861
+ /**
19862
+ * Takes in a path and returns an object with a symbol.
19863
+ *
19864
+ * When the validation lib sees this symbol, it will use the provided path to
19865
+ * get a value from the current field's parent and use that value as the input
19866
+ * to the Rule.
19867
+ *
19868
+ * The path that's given is forwarded to `lodash/get`
19869
+ *
19870
+ * ```js
19871
+ * fields: [
19872
+ * // ...
19873
+ * {
19874
+ * // ...
19875
+ * name: 'highestTemperature',
19876
+ * type: 'number',
19877
+ * validation: (Rule) => Rule.positive().min(Rule.valueOfField('lowestTemperature')),
19878
+ * // ...
19879
+ * },
19880
+ * ]
19881
+ * ```
19882
+ */
19883
+ valueOfField: (path: string | string[]) => FieldReference
19884
+ error(message?: string | LocalizedValidationMessages): Rule
19885
+ warning(message?: string | LocalizedValidationMessages): Rule
19886
+ info(message?: string | LocalizedValidationMessages): Rule
19887
+ reset(): this
19888
+ isRequired(): boolean
19889
+ clone(): Rule
19890
+ cloneWithRules(rules: RuleSpec[]): Rule
19891
+ merge(rule: Rule): Rule
19892
+ type(targetType: RuleTypeConstraint | Lowercase<RuleTypeConstraint>): Rule
19893
+ all(children: Rule[]): Rule
19894
+ either(children: Rule[]): Rule
19895
+ optional(): Rule
19896
+ required(): Rule
19897
+ custom<T = unknown>(
19898
+ fn: CustomValidator<T>,
19899
+ options?: {
19900
+ bypassConcurrencyLimit?: boolean
19901
+ },
19902
+ ): Rule
19903
+ min(len: number | string | FieldReference): Rule
19904
+ max(len: number | string | FieldReference): Rule
19905
+ length(len: number | FieldReference): Rule
19906
+ valid(value: unknown | unknown[]): Rule
19907
+ integer(): Rule
19908
+ precision(limit: number | FieldReference): Rule
19909
+ positive(): Rule
19910
+ negative(): Rule
19911
+ greaterThan(num: number | FieldReference): Rule
19912
+ lessThan(num: number | FieldReference): Rule
19913
+ uppercase(): Rule
19914
+ lowercase(): Rule
19915
+ regex(
19916
+ pattern: RegExp,
19917
+ name: string,
19918
+ options: {
19919
+ name?: string
19920
+ invert?: boolean
19921
+ },
19922
+ ): Rule
19923
+ regex(
19924
+ pattern: RegExp,
19925
+ options: {
19926
+ name?: string
19927
+ invert?: boolean
19928
+ },
19929
+ ): Rule
19930
+ regex(pattern: RegExp, name: string): Rule
19931
+ regex(pattern: RegExp): Rule
19932
+ email(): Rule
19933
+ uri(options?: UriValidationOptions): Rule
19934
+ unique(): Rule
19935
+ reference(): Rule
19936
+ fields(rules: FieldRules): Rule
19937
+ assetRequired(): Rule
19938
+ validate(
19939
+ value: unknown,
19940
+ options: ValidationContext & {
19941
+ /**
19942
+ * @deprecated Internal use only
19943
+ * @internal
19944
+ */
19945
+ __internal?: {
19946
+ customValidationConcurrencyLimiter?: {
19947
+ ready: () => Promise<void>
19948
+ release: () => void
19949
+ }
19950
+ }
19951
+ },
19952
+ ): Promise<ValidationMarker[]>
19953
+ }
19954
+
19955
+ /** @public */
19956
+ declare type RuleBuilder<
19957
+ T extends RuleDef<T, FieldValue>,
19958
+ FieldValue = unknown,
19959
+ > = T | T[]
19960
+
19961
+ /** @public */
19962
+ declare interface RuleDef<T, FieldValue = unknown> {
19963
+ required: () => T
19964
+ custom: <LenientFieldValue extends FieldValue>(
19965
+ fn: CustomValidator<LenientFieldValue | undefined>,
19966
+ ) => T
19967
+ info: (message?: string | LocalizedValidationMessages) => T
19968
+ error: (message?: string | LocalizedValidationMessages) => T
19969
+ warning: (message?: string | LocalizedValidationMessages) => T
19970
+ valueOfField: (path: string | string[]) => FieldReference
19971
+ }
19972
+
19973
+ /** @public */
19974
+ declare type RuleSpec =
19975
+ | {
19976
+ flag: 'integer'
19977
+ }
19978
+ | {
19979
+ flag: 'email'
19980
+ }
19981
+ | {
19982
+ flag: 'unique'
19983
+ }
19984
+ | {
19985
+ flag: 'reference'
19986
+ }
19987
+ | {
19988
+ flag: 'type'
19989
+ constraint: RuleTypeConstraint
19990
+ }
19991
+ | {
19992
+ flag: 'all'
19993
+ constraint: Rule[]
19994
+ }
19995
+ | {
19996
+ flag: 'either'
19997
+ constraint: Rule[]
19998
+ }
19999
+ | {
20000
+ flag: 'presence'
20001
+ constraint: 'optional' | 'required'
20002
+ }
20003
+ | {
20004
+ flag: 'custom'
20005
+ constraint: CustomValidator
20006
+ }
20007
+ | {
20008
+ flag: 'min'
20009
+ constraint: number | string
20010
+ }
20011
+ | {
20012
+ flag: 'max'
20013
+ constraint: number | string
20014
+ }
20015
+ | {
20016
+ flag: 'length'
20017
+ constraint: number
20018
+ }
20019
+ | {
20020
+ flag: 'valid'
20021
+ constraint: unknown[]
20022
+ }
20023
+ | {
20024
+ flag: 'precision'
20025
+ constraint: number
20026
+ }
20027
+ | {
20028
+ flag: 'lessThan'
20029
+ constraint: number
20030
+ }
20031
+ | {
20032
+ flag: 'greaterThan'
20033
+ constraint: number
20034
+ }
20035
+ | {
20036
+ flag: 'stringCasing'
20037
+ constraint: 'uppercase' | 'lowercase'
20038
+ }
20039
+ | {
20040
+ flag: 'assetRequired'
20041
+ constraint: {
20042
+ assetType: 'asset' | 'image' | 'file'
20043
+ }
20044
+ }
20045
+ | {
20046
+ flag: 'regex'
20047
+ constraint: {
20048
+ pattern: RegExp
20049
+ name?: string
20050
+ invert: boolean
20051
+ }
20052
+ }
20053
+ | {
20054
+ flag: 'uri'
20055
+ constraint: {
20056
+ options: {
20057
+ scheme: RegExp[]
20058
+ allowRelative: boolean
20059
+ relativeOnly: boolean
20060
+ allowCredentials: boolean
20061
+ }
20062
+ }
20063
+ }
20064
+
20065
+ /** @public */
20066
+ declare type RuleTypeConstraint =
20067
+ | 'Array'
20068
+ | 'Boolean'
20069
+ | 'Date'
20070
+ | 'Number'
20071
+ | 'Object'
20072
+ | 'String'
20073
+
20074
+ /**
20075
+ * Options for configuring how Sanity Create interfaces with the type or field.
20076
+ *
20077
+ * @public
20078
+ */
20079
+ declare interface SanityCreateOptions {
20080
+ /** Set to true to exclude a type or field from appearing in Sanity Create */
20081
+ exclude?: boolean
20082
+ /**
20083
+ * A short description of what the type or field is used for.
20084
+ * Purpose can be used to improve how and when content mapping uses the field.
20085
+ * */
20086
+ purpose?: string
20087
+ }
20088
+
20089
+ /** @public */
20090
+ declare interface SanityDocument {
20091
+ _id: string
20092
+ _type: string
20093
+ _createdAt: string
20094
+ _updatedAt: string
20095
+ _rev: string
20096
+ [key: string]: unknown
20097
+ }
20098
+
20099
+ /** @public */
20100
+ declare interface Schema {
20101
+ /** @internal */
20102
+ _original?: {
20103
+ name: string
20104
+ types: SchemaTypeDefinition[]
20105
+ }
20106
+ /** @internal */
20107
+ _registry: {
20108
+ [typeName: string]: any
20109
+ }
20110
+ /** @internal */
20111
+ _validation?: SchemaValidationProblemGroup[]
20112
+ name: string
20113
+ get: (name: string) => SchemaType | undefined
20114
+ has: (name: string) => boolean
20115
+ getTypeNames: () => string[]
20116
+ }
20117
+
20118
+ /**
20119
+ * Note: you probably want `SchemaTypeDefinition` instead
20120
+ * @see SchemaTypeDefinition
20121
+ *
20122
+ * @public
20123
+ */
20124
+ declare type SchemaType =
20125
+ | ArraySchemaType
20126
+ | BooleanSchemaType
20127
+ | FileSchemaType
20128
+ | NumberSchemaType
20129
+ | ObjectSchemaType
20130
+ | StringSchemaType
20131
+ | ReferenceSchemaType
20132
+
20133
+ /**
20134
+ * Represents a Sanity schema type definition with an optional type parameter.
20135
+ *
20136
+ * It's recommend to use the `defineType` helper instead of this type by
20137
+ * itself.
20138
+ *
20139
+ * @see defineType
20140
+ *
20141
+ * @public
20142
+ */
20143
+ declare type SchemaTypeDefinition<
20144
+ TType extends IntrinsicTypeName = IntrinsicTypeName,
20145
+ > = IntrinsicDefinitions[IntrinsicTypeName] | TypeAliasDefinition<string, TType>
20146
+
20147
+ /** @public */
20148
+ declare interface SchemaValidationError {
20149
+ helpId?: string
20150
+ message: string
20151
+ severity: 'error'
20152
+ }
20153
+
20154
+ /** @internal */
20155
+ declare type SchemaValidationProblem =
20156
+ | SchemaValidationError
20157
+ | SchemaValidationWarning
20158
+
20159
+ /** @internal */
20160
+ declare interface SchemaValidationProblemGroup {
20161
+ path: SchemaValidationProblemPath
20162
+ problems: SchemaValidationProblem[]
20163
+ }
20164
+
20165
+ /** @internal */
20166
+ declare type SchemaValidationProblemPath = Array<
20167
+ | {
20168
+ kind: 'type'
20169
+ type: string
20170
+ name?: string
20171
+ }
20172
+ | {
20173
+ kind: 'property'
20174
+ name: string
20175
+ }
20176
+ >
20177
+
20178
+ /**
20179
+ * Represents the possible values of a schema type's `validation` field.
20180
+ *
20181
+ * If the schema has not been run through `inferFromSchema` from
20182
+ * `sanity/validation` then value could be a function.
20183
+ *
20184
+ * `inferFromSchema` mutates the schema converts this value to an array of
20185
+ * `Rule` instances.
20186
+ *
20187
+ * @privateRemarks
20188
+ *
20189
+ * Usage of the schema inside the studio will almost always be from the compiled
20190
+ * `createSchema` function. In this case, you can cast the value or throw to
20191
+ * narrow the type. E.g.:
20192
+ *
20193
+ * ```ts
20194
+ * if (typeof type.validation === 'function') {
20195
+ * throw new Error(
20196
+ * `Schema type "${type.name}"'s \`validation\` was not run though \`inferFromSchema\``
20197
+ * )
20198
+ * }
20199
+ * ```
20200
+ *
20201
+ * @public
20202
+ */
20203
+ declare type SchemaValidationValue =
20204
+ | false
20205
+ | undefined
20206
+ | Rule
20207
+ | SchemaValidationValue[]
20208
+ | ((rule: Rule) => SchemaValidationValue)
20209
+
20210
+ /** @internal */
20211
+ declare interface SchemaValidationWarning {
20212
+ helpId?: string
20213
+ message: string
20214
+ severity: 'warning'
20215
+ }
20216
+
20217
+ /** @public */
20218
+ declare interface SearchConfiguration {
20219
+ search?: {
20220
+ /**
20221
+ * Defines a search weight for this field to prioritize its importance
20222
+ * during search operations in the Studio. This setting allows the specified
20223
+ * field to be ranked higher in search results compared to other fields.
20224
+ *
20225
+ * By default, all fields are assigned a weight of 1. However, if a field is
20226
+ * chosen as the `title` in the preview configuration's `select` option, it
20227
+ * will automatically receive a default weight of 10. Similarly, if selected
20228
+ * as the `subtitle`, the default weight is 5. Fields marked as
20229
+ * `hidden: true` (no function) are assigned a weight of 0 by default.
20230
+ *
20231
+ * Note: Search weight configuration is currently supported only for fields
20232
+ * of type string or portable text arrays.
20233
+ */
20234
+ weight?: number
20235
+ }
20236
+ }
20237
+
20238
+ /**
20239
+ * @public
20240
+ */
20241
+ declare const searchStrategies: readonly ['groqLegacy', 'groq2024']
20242
+
20243
+ /**
20244
+ * @public
20245
+ */
20246
+ declare type SearchStrategy = (typeof searchStrategies)[number]
20247
+
18288
20248
  declare type Serializer<TMIMEType extends MIMEType_2> = ({
18289
20249
  snapshot,
18290
20250
  event,
@@ -18297,8 +20257,159 @@ declare type Serializer<TMIMEType extends MIMEType_2> = ({
18297
20257
  'serialization.success' | 'serialization.failure'
18298
20258
  >
18299
20259
 
20260
+ /** @public */
20261
+ declare interface SingleFieldSet {
20262
+ single: true
20263
+ field: ObjectField
20264
+ hidden?: ConditionalProperty
20265
+ readOnly?: ConditionalProperty
20266
+ group?: string | string[]
20267
+ }
20268
+
20269
+ /** @public */
20270
+ declare interface SlugDefinition extends BaseSchemaDefinition {
20271
+ type: 'slug'
20272
+ options?: SlugOptions
20273
+ validation?: ValidationBuilder<SlugRule, SlugValue>
20274
+ initialValue?: InitialValueProperty<any, Omit<SlugValue, '_type'>>
20275
+ }
20276
+
20277
+ /** @public */
20278
+ declare type SlugifierFn = (
20279
+ source: string,
20280
+ schemaType: SlugSchemaType,
20281
+ context: SlugSourceContext,
20282
+ ) => string | Promise<string>
20283
+
20284
+ /** @public */
20285
+ declare type SlugIsUniqueValidator = (
20286
+ slug: string,
20287
+ context: SlugValidationContext,
20288
+ ) => boolean | Promise<boolean>
20289
+
20290
+ /** @public */
20291
+ declare interface SlugOptions
20292
+ extends SearchConfiguration,
20293
+ BaseSchemaTypeOptions {
20294
+ source?: string | Path | SlugSourceFn
20295
+ maxLength?: number
20296
+ slugify?: SlugifierFn
20297
+ isUnique?: SlugIsUniqueValidator
20298
+ disableArrayWarning?: boolean
20299
+ }
20300
+
20301
+ /** @public */
20302
+ declare type SlugParent = Record<string, unknown> | Record<string, unknown>[]
20303
+
20304
+ /** @public */
20305
+ declare interface SlugRule extends RuleDef<SlugRule, SlugValue> {}
20306
+
20307
+ /** @public */
20308
+ declare interface SlugSchemaType extends ObjectSchemaType {
20309
+ jsonType: 'object'
20310
+ options?: SlugOptions
20311
+ }
20312
+
20313
+ /** @public */
20314
+ declare interface SlugSourceContext {
20315
+ parentPath: Path
20316
+ parent: SlugParent
20317
+ projectId: string
20318
+ dataset: string
20319
+ schema: Schema
20320
+ currentUser: CurrentUser | null
20321
+ getClient: (options: {apiVersion: string}) => SanityClient
20322
+ }
20323
+
20324
+ /** @public */
20325
+ declare type SlugSourceFn = (
20326
+ document: SanityDocument,
20327
+ context: SlugSourceContext,
20328
+ ) => string | Promise<string>
20329
+
20330
+ /** @public */
20331
+ declare interface SlugValidationContext extends ValidationContext {
20332
+ parent: SlugParent
20333
+ type: SlugSchemaType
20334
+ defaultIsUnique: SlugIsUniqueValidator
20335
+ }
20336
+
20337
+ /** @public */
20338
+ declare interface SlugValue {
20339
+ _type: 'slug'
20340
+ current?: string
20341
+ }
20342
+
20343
+ /** @beta */
20344
+ declare type SortOrdering = {
20345
+ title: string
20346
+ i18n?: I18nTextRecord<'title'>
20347
+ name: string
20348
+ by: SortOrderingItem[]
20349
+ }
20350
+
20351
+ /** @beta */
20352
+ declare interface SortOrderingItem {
20353
+ field: string
20354
+ direction: 'asc' | 'desc'
20355
+ }
20356
+
18300
20357
  declare type StrictExtract_2<T, U extends T> = U
18301
20358
 
20359
+ /** @public */
20360
+ declare interface StringDefinition extends BaseSchemaDefinition {
20361
+ type: 'string'
20362
+ options?: StringOptions
20363
+ placeholder?: string
20364
+ validation?: ValidationBuilder<StringRule, string>
20365
+ initialValue?: InitialValueProperty<any, string>
20366
+ }
20367
+
20368
+ /** @public */
20369
+ declare interface StringOptions
20370
+ extends EnumListProps<string>,
20371
+ SearchConfiguration,
20372
+ BaseSchemaTypeOptions {}
20373
+
20374
+ /** @public */
20375
+ declare interface StringRule extends RuleDef<StringRule, string> {
20376
+ min: (minNumber: number | FieldReference) => StringRule
20377
+ max: (maxNumber: number | FieldReference) => StringRule
20378
+ length: (exactLength: number | FieldReference) => StringRule
20379
+ uppercase: () => StringRule
20380
+ lowercase: () => StringRule
20381
+ regex(
20382
+ pattern: RegExp,
20383
+ name: string,
20384
+ options: {
20385
+ name?: string
20386
+ invert?: boolean
20387
+ },
20388
+ ): StringRule
20389
+ regex(
20390
+ pattern: RegExp,
20391
+ options: {
20392
+ name?: string
20393
+ invert?: boolean
20394
+ },
20395
+ ): StringRule
20396
+ regex(pattern: RegExp, name: string): StringRule
20397
+ regex(pattern: RegExp): StringRule
20398
+ email(): StringRule
20399
+ }
20400
+
20401
+ /**
20402
+ * This is used for string, text, date and datetime.
20403
+ * This interface represent the compiled version at runtime, when accessed through Schema.
20404
+ *
20405
+ * @public
20406
+ */
20407
+ declare interface StringSchemaType extends BaseSchemaType {
20408
+ jsonType: 'string'
20409
+ options?: StringOptions & TextOptions & DateOptions & DatetimeOptions
20410
+ initialValue?: InitialValueProperty<any, string>
20411
+ }
20412
+
18302
20413
  /**
18303
20414
  * @beta
18304
20415
  */
@@ -18320,12 +20431,12 @@ export declare type SyntheticBehaviorEvent =
18320
20431
  }
18321
20432
  | {
18322
20433
  type: StrictExtract_2<SyntheticBehaviorEventType, 'block.set'>
18323
- at: [KeyedSegment]
20434
+ at: [KeyedSegment_2]
18324
20435
  props: Record<string, unknown>
18325
20436
  }
18326
20437
  | {
18327
20438
  type: StrictExtract_2<SyntheticBehaviorEventType, 'block.unset'>
18328
- at: [KeyedSegment]
20439
+ at: [KeyedSegment_2]
18329
20440
  props: Array<string>
18330
20441
  }
18331
20442
  | {
@@ -18350,7 +20461,7 @@ export declare type SyntheticBehaviorEvent =
18350
20461
  }
18351
20462
  | {
18352
20463
  type: StrictExtract_2<SyntheticBehaviorEventType, 'delete.block'>
18353
- at: [KeyedSegment]
20464
+ at: [KeyedSegment_2]
18354
20465
  }
18355
20466
  | {
18356
20467
  type: StrictExtract_2<SyntheticBehaviorEventType, 'delete.forward'>
@@ -18398,8 +20509,8 @@ export declare type SyntheticBehaviorEvent =
18398
20509
  }
18399
20510
  | {
18400
20511
  type: StrictExtract_2<SyntheticBehaviorEventType, 'move.block'>
18401
- at: [KeyedSegment]
18402
- to: [KeyedSegment]
20512
+ at: [KeyedSegment_2]
20513
+ to: [KeyedSegment_2]
18403
20514
  }
18404
20515
  | {
18405
20516
  type: StrictExtract_2<SyntheticBehaviorEventType, 'move.forward'>
@@ -18448,9 +20559,199 @@ declare type TextBlockWithOptionalKey = Omit<PortableTextTextBlock, '_key'> & {
18448
20559
  _key?: PortableTextTextBlock['_key']
18449
20560
  }
18450
20561
 
20562
+ /** @public */
20563
+ declare interface TextDefinition extends BaseSchemaDefinition {
20564
+ type: 'text'
20565
+ rows?: number
20566
+ options?: TextOptions
20567
+ placeholder?: string
20568
+ validation?: ValidationBuilder<TextRule, string>
20569
+ initialValue?: InitialValueProperty<any, string>
20570
+ }
20571
+
20572
+ /** @public */
20573
+ declare interface TextOptions extends StringOptions {}
20574
+
20575
+ /** @public */
20576
+ declare interface TextRule extends StringRule {}
20577
+
20578
+ /** @public */
20579
+ declare interface TitledListValue<V = unknown> {
20580
+ _key?: string
20581
+ title: string
20582
+ value?: V
20583
+ }
20584
+
20585
+ /**
20586
+ * Represents a type definition that is an alias/extension of an existing type
20587
+ * in your schema. Creating a type alias will re-register that existing type
20588
+ * under a different name. You can also override the default type options with
20589
+ * a type alias definition.
20590
+ *
20591
+ * @public
20592
+ */
20593
+ declare interface TypeAliasDefinition<
20594
+ TType extends string,
20595
+ TAlias extends IntrinsicTypeName | undefined,
20596
+ > extends BaseSchemaDefinition {
20597
+ type: TType
20598
+ options?: TAlias extends IntrinsicTypeName
20599
+ ? IntrinsicDefinitions[TAlias]['options']
20600
+ : unknown
20601
+ validation?: SchemaValidationValue
20602
+ initialValue?: InitialValueProperty<any, any>
20603
+ preview?: PreviewConfig
20604
+ components?: {
20605
+ annotation?: ComponentType<any>
20606
+ block?: ComponentType<any>
20607
+ inlineBlock?: ComponentType<any>
20608
+ diff?: ComponentType<any>
20609
+ field?: ComponentType<any>
20610
+ input?: ComponentType<any>
20611
+ item?: ComponentType<any>
20612
+ preview?: ComponentType<any>
20613
+ }
20614
+ }
20615
+
20616
+ /**
20617
+ * Represents a reference to another type registered top-level in your schema.
20618
+ *
20619
+ * @public
20620
+ */
20621
+ declare interface TypeReference {
20622
+ type: string
20623
+ name?: string
20624
+ icon?: ComponentType | ReactNode
20625
+ options?: {
20626
+ [key: string]: unknown
20627
+ }
20628
+ }
20629
+
18451
20630
  declare type UnsetEvent = {
18452
20631
  type: 'unset'
18453
- previousValue: Array<PortableTextBlock>
20632
+ previousValue: Array<PortableTextBlock_2>
20633
+ }
20634
+
20635
+ /** @public */
20636
+ declare interface UriValidationOptions {
20637
+ scheme?: (string | RegExp) | Array<string | RegExp>
20638
+ allowRelative?: boolean
20639
+ relativeOnly?: boolean
20640
+ allowCredentials?: boolean
20641
+ }
20642
+
20643
+ /** @public */
20644
+ declare interface UrlDefinition extends BaseSchemaDefinition {
20645
+ type: 'url'
20646
+ options?: UrlOptions
20647
+ placeholder?: string
20648
+ validation?: ValidationBuilder<UrlRule, string>
20649
+ initialValue?: InitialValueProperty<any, string>
20650
+ }
20651
+
20652
+ /** @public */
20653
+ declare interface UrlOptions extends BaseSchemaTypeOptions {}
20654
+
20655
+ /** @public */
20656
+ declare interface UrlRule extends RuleDef<UrlRule, string> {
20657
+ uri(options: UriValidationOptions): UrlRule
20658
+ }
20659
+
20660
+ /** @public */
20661
+ declare type ValidationBuilder<
20662
+ T extends RuleDef<T, FieldValue>,
20663
+ FieldValue = unknown,
20664
+ > = (rule: T) => RuleBuilder<T, FieldValue>
20665
+
20666
+ /**
20667
+ * A context object passed around during validation. This includes the
20668
+ * `Rule.custom` context.
20669
+ *
20670
+ * e.g.
20671
+ *
20672
+ * ```js
20673
+ * Rule.custom((_, validationContext) => {
20674
+ * // ...
20675
+ * })`
20676
+ * ```
20677
+ *
20678
+ * @public
20679
+ */
20680
+ declare interface ValidationContext {
20681
+ getClient: (options: {apiVersion: string}) => SanityClient
20682
+ schema: Schema
20683
+ parent?: unknown
20684
+ type?: SchemaType
20685
+ document?: SanityDocument
20686
+ path?: Path
20687
+ getDocumentExists?: (options: {id: string}) => Promise<boolean>
20688
+ environment: 'cli' | 'studio'
20689
+ }
20690
+
20691
+ /**
20692
+ * The shape that can be returned from a custom validator to be converted into
20693
+ * a validation marker by the validation logic. Inside of a custom validator,
20694
+ * you can return an array of these in order to specify multiple paths within
20695
+ * an object or array.
20696
+ *
20697
+ * @public
20698
+ */
20699
+ declare interface ValidationError {
20700
+ /**
20701
+ * The message describing why the value is not valid. This message will be
20702
+ * included in the validation markers after validation has finished running.
20703
+ */
20704
+ message: string
20705
+ /**
20706
+ * If writing a custom validator, you can return validation messages to
20707
+ * specific path inside of the current value (object or array) by populating
20708
+ * this `path` prop.
20709
+ *
20710
+ * NOTE: This path is relative to the current value and _not_ relative to
20711
+ * the document.
20712
+ */
20713
+ path?: Path
20714
+ /**
20715
+ * Same as `path` but allows more than one value. If provided, the same
20716
+ * message will create two markers from each path with the same message
20717
+ * provided.
20718
+ *
20719
+ * @deprecated prefer `path`
20720
+ */
20721
+ paths?: Path[]
20722
+ /**
20723
+ * @deprecated Unused. Was used to store the results from `.either()` /`.all()`
20724
+ */
20725
+ children?: ValidationMarker[]
20726
+ /**
20727
+ * @deprecated Unused. Was used to signal if this error came from an `.either()`/`.all()`.
20728
+ */
20729
+ operation?: 'AND' | 'OR'
20730
+ /**
20731
+ * @deprecated Unused. Was relevant when validation error was used as a class.
20732
+ */
20733
+ cloneWithMessage?(message: string): ValidationError
20734
+ }
20735
+
20736
+ /** @public */
20737
+ declare interface ValidationMarker {
20738
+ level: 'error' | 'warning' | 'info'
20739
+ /**
20740
+ * The validation message for this marker. E.g. "Must be greater than 0"
20741
+ */
20742
+ message: string
20743
+ /**
20744
+ * @deprecated use `message` instead
20745
+ */
20746
+ item?: ValidationError
20747
+ /**
20748
+ * The sanity path _relative to the root of the current document_ to this
20749
+ * marker.
20750
+ *
20751
+ * NOTE: Sanity paths may contain keyed segments (i.e. `{_key: string}`) that
20752
+ * are not compatible with deep getters like lodash/get
20753
+ */
20754
+ path: Path
18454
20755
  }
18455
20756
 
18456
20757
  export {}