@sanity/schema 6.16.1-next.5 → 6.17.0-next.14

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.
@@ -396,8 +396,8 @@ export declare const builtinTypes: ({
396
396
  title: string;
397
397
  validation?: undefined;
398
398
  hidden?: undefined;
399
- readOnly?: undefined;
400
399
  fieldset?: undefined;
400
+ readOnly?: undefined;
401
401
  } | {
402
402
  name: string;
403
403
  type: string;
@@ -475,8 +475,8 @@ export declare const builtinTypes: ({
475
475
  title: string;
476
476
  validation?: undefined;
477
477
  hidden?: undefined;
478
- readOnly?: undefined;
479
478
  fieldset?: undefined;
479
+ readOnly?: undefined;
480
480
  } | {
481
481
  name: string;
482
482
  type: string;
@@ -550,17 +550,17 @@ export declare const builtinTypes: ({
550
550
  };
551
551
  }[];
552
552
  fields: ({
553
- title?: undefined;
554
- readOnly?: undefined;
555
- fieldset?: undefined;
556
553
  name: string;
557
554
  type: string;
558
- } | {
555
+ fieldset?: undefined;
556
+ title?: undefined;
559
557
  readOnly?: undefined;
558
+ } | {
560
559
  name: string;
561
560
  title: string;
562
561
  type: string;
563
562
  fieldset: string;
563
+ readOnly?: undefined;
564
564
  } | {
565
565
  fieldset?: undefined;
566
566
  name: string;
package/lib/_internal.js CHANGED
@@ -1360,6 +1360,7 @@ const ACTIONS_FLAG = "__experimental_actions", DEFAULT_ACTIONS = [
1360
1360
  OBJECT_FIELD_NAME_INVALID: "schema-object-fields-invalid",
1361
1361
  OBJECT_FIELD_DEFINITION_INVALID_TYPE: "schema-object-fields-invalid",
1362
1362
  ARRAY_PREDEFINED_CHOICES_INVALID: "schema-predefined-choices-invalid",
1363
+ ARRAY_COLLAPSE_ITEMS_AFTER_INVALID: "schema-array-collapse-items-after-invalid",
1363
1364
  ARRAY_OF_ARRAY: "schema-array-of-array",
1364
1365
  ARRAY_OF_INVALID: "schema-array-of-invalid",
1365
1366
  ARRAY_OF_NOT_UNIQUE: "schema-array-of-invalid",
@@ -1675,6 +1676,8 @@ var array_default = (typeDef, visitorContext) => {
1675
1676
  problems.push(warning(`Array cannot contain multiple members with JSON type "${jsonType}" (${humanizeList(typeNames.map(quote$2))}) as there is no way to distinguish between them`, HELP_IDS.ARRAY_OF_DUPLICATE_PRIMITIVE_JSON_TYPE));
1676
1677
  }
1677
1678
  }
1679
+ let collapseItemsAfter = typeDef?.options?.collapseItemsAfter;
1680
+ collapseItemsAfter !== void 0 && collapseItemsAfter !== !1 && (typeof collapseItemsAfter == "number" && Number.isInteger(collapseItemsAfter) && collapseItemsAfter > 0 || problems.push(error(`The array type's "options.collapseItemsAfter" must be a positive integer, or false to always render every item. Found ${format(collapseItemsAfter)}`, HELP_IDS.ARRAY_COLLAPSE_ITEMS_AFTER_INVALID)));
1678
1681
  let list = typeDef?.options?.list;
1679
1682
  return !isMixedArray && Array.isArray(list) && (primitiveTypes.length > 0 ? list.forEach((option) => {
1680
1683
  let value = option?.value ?? option;