@sanity/types 6.5.1-next.2 → 6.5.1-next.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.d.ts +36 -24
- package/package.json +4 -5
package/lib/index.d.ts
CHANGED
|
@@ -746,29 +746,6 @@ declare function isValidationWarning(node: FormNodeValidation): node is FormNode
|
|
|
746
746
|
declare function isValidationInfo(node: FormNodeValidation): node is FormNodeValidation & {
|
|
747
747
|
level: 'info';
|
|
748
748
|
};
|
|
749
|
-
/** @alpha This API may change */
|
|
750
|
-
declare interface InsertMenuOptions {
|
|
751
|
-
/**
|
|
752
|
-
* @defaultValue `'auto'`
|
|
753
|
-
* `filter: 'auto'` automatically turns on filtering if there are more than 5
|
|
754
|
-
* schema types added to the menu.
|
|
755
|
-
*/
|
|
756
|
-
filter?: "auto" | boolean | undefined;
|
|
757
|
-
groups?: Array<{
|
|
758
|
-
name: string;
|
|
759
|
-
title?: string;
|
|
760
|
-
of?: Array<string>;
|
|
761
|
-
}> | undefined;
|
|
762
|
-
/** defaultValue `true` */
|
|
763
|
-
showIcons?: boolean | undefined;
|
|
764
|
-
/** @defaultValue `[{name: 'list'}]` */
|
|
765
|
-
views?: Array<{
|
|
766
|
-
name: "list";
|
|
767
|
-
} | {
|
|
768
|
-
name: "grid";
|
|
769
|
-
previewImageUrl?: (schemaTypeName: string) => string | undefined;
|
|
770
|
-
}> | undefined;
|
|
771
|
-
}
|
|
772
749
|
/** @public */
|
|
773
750
|
interface RuleDef<T, FieldValue = unknown> {
|
|
774
751
|
required: () => T;
|
|
@@ -915,6 +892,41 @@ interface SearchConfiguration {
|
|
|
915
892
|
weight?: number;
|
|
916
893
|
};
|
|
917
894
|
}
|
|
895
|
+
/**
|
|
896
|
+
* Options for the "insert menu" shown when adding items to an array with multiple member types.
|
|
897
|
+
*
|
|
898
|
+
* This is the canonical definition of these options. They are rendered by two separate
|
|
899
|
+
* implementations that integrate with one another: the Studio form input
|
|
900
|
+
* (`packages/sanity/src/insert-menu` in this repo, used by arrays in `sanity/structure`),
|
|
901
|
+
* and the app frontend via `@sanity/visual-editing` when previewing through
|
|
902
|
+
* `sanity/presentation`. `@sanity/visual-editing-types`
|
|
903
|
+
* (https://github.com/sanity-io/visual-editing/blob/main/packages/visual-editing-types/src/index.ts)
|
|
904
|
+
* re-uses this interface to derive the serialized form sent to the app frontend.
|
|
905
|
+
*
|
|
906
|
+
* @alpha This API may change
|
|
907
|
+
*/
|
|
908
|
+
interface InsertMenuOptions {
|
|
909
|
+
/**
|
|
910
|
+
* @defaultValue `'auto'`
|
|
911
|
+
* `filter: 'auto'` automatically turns on filtering if there are more than 5
|
|
912
|
+
* schema types added to the menu.
|
|
913
|
+
*/
|
|
914
|
+
filter?: 'auto' | boolean | undefined;
|
|
915
|
+
groups?: Array<{
|
|
916
|
+
name: string;
|
|
917
|
+
title?: string;
|
|
918
|
+
of?: Array<string>;
|
|
919
|
+
}> | undefined;
|
|
920
|
+
/** defaultValue `true` */
|
|
921
|
+
showIcons?: boolean | undefined;
|
|
922
|
+
/** @defaultValue `[{name: 'list'}]` */
|
|
923
|
+
views?: Array<{
|
|
924
|
+
name: 'list';
|
|
925
|
+
} | {
|
|
926
|
+
name: 'grid';
|
|
927
|
+
previewImageUrl?: (schemaTypeName: string) => string | undefined;
|
|
928
|
+
}> | undefined;
|
|
929
|
+
}
|
|
918
930
|
/**
|
|
919
931
|
* Types of array actions that can be performed
|
|
920
932
|
* @beta
|
|
@@ -3513,4 +3525,4 @@ interface UploadState {
|
|
|
3513
3525
|
};
|
|
3514
3526
|
previewImage?: string;
|
|
3515
3527
|
}
|
|
3516
|
-
export { ArrayActionName, ArrayDefinition, ArrayOfEntry, ArrayOfType, ArrayOptions, ArrayRule, ArraySchemaType, ArraySchemaTypeOf, Asset, AssetFromSource, AssetMetadataType, AssetSchemaTypeOptions, AssetSource, AssetSourceComponentAction, AssetSourceComponentProps, AssetSourceOpenInSourceResult, AssetSourceSpec, AssetSourceUploadEvent, AssetSourceUploadEventAbort, AssetSourceUploadEventAllComplete, AssetSourceUploadEventError, AssetSourceUploadEventProgress, AssetSourceUploadEventStatus, AssetSourceUploadFile, AssetSourceUploadSubscriber, AssetSourceUploader, AssetSourceUploaderClass, AutocompleteString, BaseSchemaDefinition, BaseSchemaType, BaseSchemaTypeOptions, BlockAnnotationDefinition, BlockChildrenObjectField, BlockDecoratorDefinition, BlockDefinition, BlockListDefinition, BlockListObjectField, BlockMarksDefinition, BlockOptions, BlockRule, BlockSchemaType, BlockStyleDefinition, BlockStyleObjectField, BooleanDefinition, BooleanOptions, BooleanRule, BooleanSchemaType, CanvasAppOptions, CanvasNotificationPayload, CollapseOptions, ConditionalIndexAccess, ConditionalProperty, ConditionalPropertyCallback, ConditionalPropertyCallbackContext, CreateIfNotExistsMutation, CreateMutation, CreateOrReplaceMutation, CreateSquashedMutation, CrossDatasetReferenceDefinition, CrossDatasetReferenceFilterResolver, CrossDatasetReferenceFilterSearchOptions, CrossDatasetReferenceSchemaType, CrossDatasetReferenceValue, CrossDatasetType, CurrentUser, CurrentUserAttribute, CustomValidator, CustomValidatorResult, DashboardNotificationPayload, DateDefinition, DateOptions, DateRule, DatetimeDefinition, DatetimeOptions, DatetimeRule, DefineArrayMemberBase, DefineSchemaBase, DefineSchemaOptions, DefineSchemaType, DeleteMutation, DeprecatedProperty, DeprecatedSchemaType, DeprecationConfiguration, DocumentDefinition, DocumentOptions, DocumentRule, DocumentSystem, DocumentSystemRef, EmailDefinition, EmailOptions, EmailRule, EmptyProps, EnumListProps, FieldDefinition, FieldDefinitionBase, FieldGroup, FieldGroupDefinition, FieldReference, FieldRules, Fieldset, FieldsetDefinition, File, FileAsset, FileDefinition, FileOptions, FileRule, FileSchemaType, FileValue, FormNodeValidation, GeopointDefinition, GeopointOptions, GeopointRule, GeopointValue, GlobalDocumentReferenceDefinition, GlobalDocumentReferenceFilterResolver, GlobalDocumentReferenceFilterSearchOptions, GlobalDocumentReferenceSchemaType, GlobalDocumentReferenceType, GlobalDocumentReferenceValue, HotspotOptions, HotspotPreview, I18nTextRecord, I18nTitledListValue, Image, ImageAsset, ImageCrop, ImageDefinition, ImageDimensions, ImageHotspot, ImageMetadata, ImageMetadataType, ImageOptions, ImagePalette, ImageRule, ImageSchemaType, ImageSwatch, ImageUrlAutoMode, ImageUrlCropMode, ImageUrlFitMode, ImageUrlFormat, ImageUrlOrientation, ImageUrlParams, ImageValue, IndexTuple, InitialValueProperty, InitialValueResolver, InitialValueResolverContext, InlineFieldDefinition,
|
|
3528
|
+
export { ArrayActionName, ArrayDefinition, ArrayOfEntry, ArrayOfType, ArrayOptions, ArrayRule, ArraySchemaType, ArraySchemaTypeOf, Asset, AssetFromSource, AssetMetadataType, AssetSchemaTypeOptions, AssetSource, AssetSourceComponentAction, AssetSourceComponentProps, AssetSourceOpenInSourceResult, AssetSourceSpec, AssetSourceUploadEvent, AssetSourceUploadEventAbort, AssetSourceUploadEventAllComplete, AssetSourceUploadEventError, AssetSourceUploadEventProgress, AssetSourceUploadEventStatus, AssetSourceUploadFile, AssetSourceUploadSubscriber, AssetSourceUploader, AssetSourceUploaderClass, AutocompleteString, BaseSchemaDefinition, BaseSchemaType, BaseSchemaTypeOptions, BlockAnnotationDefinition, BlockChildrenObjectField, BlockDecoratorDefinition, BlockDefinition, BlockListDefinition, BlockListObjectField, BlockMarksDefinition, BlockOptions, BlockRule, BlockSchemaType, BlockStyleDefinition, BlockStyleObjectField, BooleanDefinition, BooleanOptions, BooleanRule, BooleanSchemaType, CanvasAppOptions, CanvasNotificationPayload, CollapseOptions, ConditionalIndexAccess, ConditionalProperty, ConditionalPropertyCallback, ConditionalPropertyCallbackContext, CreateIfNotExistsMutation, CreateMutation, CreateOrReplaceMutation, CreateSquashedMutation, CrossDatasetReferenceDefinition, CrossDatasetReferenceFilterResolver, CrossDatasetReferenceFilterSearchOptions, CrossDatasetReferenceSchemaType, CrossDatasetReferenceValue, CrossDatasetType, CurrentUser, CurrentUserAttribute, CustomValidator, CustomValidatorResult, DashboardNotificationPayload, DateDefinition, DateOptions, DateRule, DatetimeDefinition, DatetimeOptions, DatetimeRule, DefineArrayMemberBase, DefineSchemaBase, DefineSchemaOptions, DefineSchemaType, DeleteMutation, DeprecatedProperty, DeprecatedSchemaType, DeprecationConfiguration, DocumentDefinition, DocumentOptions, DocumentRule, DocumentSystem, DocumentSystemRef, EmailDefinition, EmailOptions, EmailRule, EmptyProps, EnumListProps, FieldDefinition, FieldDefinitionBase, FieldGroup, FieldGroupDefinition, FieldReference, FieldRules, Fieldset, FieldsetDefinition, File, FileAsset, FileDefinition, FileOptions, FileRule, FileSchemaType, FileValue, FormNodeValidation, GeopointDefinition, GeopointOptions, GeopointRule, GeopointValue, GlobalDocumentReferenceDefinition, GlobalDocumentReferenceFilterResolver, GlobalDocumentReferenceFilterSearchOptions, GlobalDocumentReferenceSchemaType, GlobalDocumentReferenceType, GlobalDocumentReferenceValue, HotspotOptions, HotspotPreview, I18nTextRecord, I18nTitledListValue, Image, ImageAsset, ImageCrop, ImageDefinition, ImageDimensions, ImageHotspot, ImageMetadata, ImageMetadataType, ImageOptions, ImagePalette, ImageRule, ImageSchemaType, ImageSwatch, ImageUrlAutoMode, ImageUrlCropMode, ImageUrlFitMode, ImageUrlFormat, ImageUrlOrientation, ImageUrlParams, ImageValue, IndexTuple, InitialValueProperty, InitialValueResolver, InitialValueResolverContext, InlineFieldDefinition, InsertMenuOptions, InsertPatch, IntrinsicArrayOfBase, IntrinsicArrayOfDefinition, IntrinsicBase, IntrinsicDefinitions, IntrinsicTypeName, KeyedObject, KeyedSegment, LocalizedValidationMessages, MEDIA_LIBRARY_ASSET_ASPECT_TYPE_NAME, MaybeAllowUnknownProps, MaybePreview, MediaAssetTypes, MediaLibraryAssetAspectDefinition, MediaLibraryAssetAspectDocument, MediaLibraryAssetAspectSupportedFieldDefinitions, MediaLibraryAssetAspectTypeName, MediaLibraryAssetType, MediaLibraryFilter, MediaLibraryOptions, MediaValidationValue, MediaValidator, MendozaEffectPair, MendozaPatch, ModalOptions, MultiFieldSet, MultipleMutationResult, Mutation, MutationOperationName, MutationSelection, NarrowPreview, NumberDefinition, NumberOptions, NumberRule, NumberSchemaType, ObjectDefinition, ObjectField, ObjectFieldType, ObjectOptions, ObjectRule, ObjectSchemaType, ObjectSchemaTypeWithOptions, PatchMutation, PatchMutationOperation, PatchOperations, Path, PathSegment, PortableTextBlock, PortableTextChild, PortableTextListBlock, PortableTextObject, PortableTextSpan, PortableTextTextBlock, PrepareViewOptions, PreviewConfig, PreviewValue, Reference, ReferenceBaseOptions, ReferenceDefinition, ReferenceFilterOptions, ReferenceFilterQueryOptions, ReferenceFilterResolver, ReferenceFilterResolverContext, ReferenceFilterResolverOptions, ReferenceFilterSearchOptions, ReferenceOptions, ReferenceRule, ReferenceSchemaType, ReferenceTo, ReferenceTypeFilter, ReferenceTypeFilterContext, ReferenceTypeOption, ReferenceValue, Role, Rule, RuleBuilder, RuleClass, RuleDef, RuleSpec, RuleSpecConstraint, RuleTypeConstraint, SanityCreateOptions, SanityDocument, SanityDocumentLike, Schema, SchemaType, SchemaTypeDefinition, SchemaValidationError, SchemaValidationProblem, SchemaValidationProblemGroup, SchemaValidationProblemPath, SchemaValidationValue, SchemaValidationWarning, SearchConfiguration, SearchStrategy, SingleFieldSet, SingleMutationResult, Slug, SlugDefinition, SlugIsUniqueValidator, SlugOptions, SlugParent, SlugRule, SlugSchemaType, SlugSourceContext, SlugSourceFn, SlugValidationContext, SlugValue, SlugifierFn, SortOrdering, SortOrderingItem, SpanMarksObjectField, SpanSchemaType, SpanTextObjectField, StrictDefinition, StrictVersionLayeringOptions, StringDefinition, StringOptions, StringRule, StringSchemaType, StudioNotificationPayload, SwatchName, TextDefinition, TextOptions, TextRule, TextSchemaType, TitledListValue, TransactionLogEvent, TransactionLogEventWithEffects, TransactionLogEventWithMutations, TransactionLogMutation, TypeAliasDefinition, TypeReference, TypedObject, UploadState, UriValidationOptions, UrlDefinition, UrlOptions, UrlRule, User, UserAttributeType, UserAttributeValue, ValidationBuilder, ValidationContext, ValidationError, ValidationErrorClass, ValidationErrorOptions, ValidationMarker, Validator, Validators, WeakCrossDatasetReferenceValue, WeakGlobalDocumentReferenceValue, WeakReference, WidenInitialValue, WidenValidation, defineArrayMember, defineAssetAspect, defineField, defineType, isArrayOfBlocksSchemaType, isArrayOfObjectsSchemaType, isArrayOfPrimitivesSchemaType, isArrayOfStringsSchemaType, isArraySchemaType, isAssetAspect, isBlockChildrenObjectField, isBlockListObjectField, isBlockSchemaType, isBlockStyleObjectField, isBooleanSchemaType, isCreateIfNotExistsMutation, isCreateMutation, isCreateOrReplaceMutation, isCreateSquashedMutation, isCrossDatasetReference, isCrossDatasetReferenceSchemaType, isDateTimeSchemaType, isDeleteMutation, isDeprecatedSchemaType, isDeprecationConfiguration, isDocumentSchemaType, isFileSchemaType, isGlobalDocumentReference, isImage, isImageSchemaType, isIndexSegment, isIndexTuple, isKeySegment, isKeyedObject, isNumberSchemaType, isObjectSchemaType, isPatchMutation, isPortableTextListBlock, isPortableTextSpan, isPortableTextTextBlock, isPrimitiveSchemaType, isReference, isReferenceSchemaType, isSanityDocument, isSearchStrategy, isSlug, isSpanSchemaType, isStringSchemaType, isTitledListValue, isTypedObject, isValidationError, isValidationErrorMarker, isValidationInfo, isValidationInfoMarker, isValidationWarning, isValidationWarningMarker, searchStrategies, typed };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sanity/types",
|
|
3
|
-
"version": "6.5.1-next.
|
|
3
|
+
"version": "6.5.1-next.4",
|
|
4
4
|
"description": "Type definitions for common Sanity data structures",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cms",
|
|
@@ -38,7 +38,6 @@
|
|
|
38
38
|
"@sanity/media-library-types": "^1.5.0"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@sanity/insert-menu": "3.0.8",
|
|
42
41
|
"@sanity/pkg-utils": "^10.9.0",
|
|
43
42
|
"@types/react": "^19.2.17",
|
|
44
43
|
"@typescript/native-preview": "beta",
|
|
@@ -47,9 +46,9 @@
|
|
|
47
46
|
"rimraf": "^6.1.3",
|
|
48
47
|
"vite": "^8.1.4",
|
|
49
48
|
"vitest": "^4.1.9",
|
|
50
|
-
"@repo/
|
|
51
|
-
"@repo/
|
|
52
|
-
"@repo/tsconfig": "6.5.1-next.
|
|
49
|
+
"@repo/test-config": "6.5.1-next.4+b82ed3d1e5",
|
|
50
|
+
"@repo/package.config": "6.5.1-next.4+b82ed3d1e5",
|
|
51
|
+
"@repo/tsconfig": "6.5.1-next.4+b82ed3d1e5"
|
|
53
52
|
},
|
|
54
53
|
"peerDependencies": {
|
|
55
54
|
"@types/react": "*"
|