@sanity/schema 6.7.0-next.58 → 6.7.0-next.64

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.
@@ -384,17 +384,17 @@ declare const builtinTypes: ({
384
384
  type: string;
385
385
  title: string;
386
386
  readOnly: boolean;
387
- fieldset?: undefined;
388
387
  validation?: undefined;
389
388
  hidden?: undefined;
389
+ fieldset?: undefined;
390
390
  } | {
391
391
  name: string;
392
392
  type: string;
393
393
  title: string;
394
- readOnly?: undefined;
395
- fieldset?: undefined;
396
394
  validation?: undefined;
397
395
  hidden?: undefined;
396
+ readOnly?: undefined;
397
+ fieldset?: undefined;
398
398
  } | {
399
399
  name: string;
400
400
  type: string;
@@ -409,8 +409,8 @@ declare const builtinTypes: ({
409
409
  readOnly: boolean;
410
410
  hidden: boolean;
411
411
  fieldset: string;
412
- title?: undefined;
413
412
  validation?: undefined;
413
+ title?: undefined;
414
414
  } | {
415
415
  name: string;
416
416
  type: string;
@@ -463,17 +463,17 @@ declare const builtinTypes: ({
463
463
  type: string;
464
464
  title: string;
465
465
  readOnly: boolean;
466
- fieldset?: undefined;
467
466
  validation?: undefined;
468
467
  hidden?: undefined;
468
+ fieldset?: undefined;
469
469
  } | {
470
470
  name: string;
471
471
  type: string;
472
472
  title: string;
473
- readOnly?: undefined;
474
- fieldset?: undefined;
475
473
  validation?: undefined;
476
474
  hidden?: undefined;
475
+ readOnly?: undefined;
476
+ fieldset?: undefined;
477
477
  } | {
478
478
  name: string;
479
479
  type: string;
@@ -483,21 +483,21 @@ declare const builtinTypes: ({
483
483
  validation: (Rule: import("@sanity/types").Rule) => import("@sanity/types").Rule;
484
484
  hidden?: undefined;
485
485
  } | {
486
+ validation?: undefined;
486
487
  name: string;
487
488
  type: string;
488
489
  readOnly: boolean;
489
490
  hidden: boolean;
490
491
  fieldset: string;
491
492
  title?: undefined;
492
- validation?: undefined;
493
493
  } | {
494
+ validation?: undefined;
495
+ hidden?: undefined;
494
496
  name: string;
495
497
  type: string;
496
498
  title: string;
497
499
  readOnly: boolean;
498
500
  fieldset: string;
499
- validation?: undefined;
500
- hidden?: undefined;
501
501
  })[];
502
502
  preview: {
503
503
  select: {
package/lib/_internal.js CHANGED
@@ -1,4 +1,4 @@
1
- import { a as DEFAULT_MAX_FIELD_DEPTH, c as ALL_FIELDS_GROUP_NAME, l as OWN_PROPS_NAME, n as Schema$1, o as resolveSearchConfig, s as resolveSearchConfigForBaseFieldPaths, u as Rule } from "./Schema-B6NrqInd.js";
1
+ import { a as DEFAULT_MAX_FIELD_DEPTH, c as ALL_FIELDS_GROUP_NAME, l as OWN_PROPS_NAME, n as Schema$1, o as resolveSearchConfig, s as resolveSearchConfigForBaseFieldPaths, u as Rule } from "./Schema-BckCkziq.js";
2
2
  import { SetBuilder, processSetSynchronization } from "@sanity/descriptors";
3
3
  import { isSpanSchemaType } from "@sanity/types";
4
4
  import isEqual from "lodash-es/isEqual.js";
@@ -687,7 +687,7 @@ function resolveRequester(options) {
687
687
  * captured before the awaited work and read at completion.
688
688
  */
689
689
  function makeEmit(onPhaseComplete) {
690
- return function(phase, startedAt, iteration) {
690
+ return function emit(phase, startedAt, iteration) {
691
691
  if (!onPhaseComplete) return;
692
692
  let event = {
693
693
  phase,
@@ -1387,7 +1387,7 @@ function groupProblems(types) {
1387
1387
  return flatten(types.map((type) => getTypeProblems(type))).filter((type) => type.problems.length > 0);
1388
1388
  }
1389
1389
  function createTypeWithMembersProblemsAccessor(memberPropertyName, getMembers = (type) => get(type, memberPropertyName)) {
1390
- return function(type, parentPath) {
1390
+ return function getProblems(type, parentPath) {
1391
1391
  let currentPath = [...parentPath, {
1392
1392
  kind: "type",
1393
1393
  type: type.type,
@@ -2045,16 +2045,17 @@ var rootType_default = (typeDef, visitorContext) => {
2045
2045
  function looksLikeEsmModule(typeDef) {
2046
2046
  return !typeDef.name && typeDef.default && (typeDef.default.name || typeDef.default.title);
2047
2047
  }
2048
+ var slug_default = (typeDef, visitorContext) => {
2049
+ let problems = [];
2050
+ return typeDef.options && typeDef.options.slugifyFn && (problems.push(warning("Heads up! The \"slugifyFn\" option has been renamed to \"slugify\".", HELP_IDS.SLUG_SLUGIFY_FN_RENAMED)), typeDef.options.slugify = typeDef.options.slugifyFn), {
2051
+ ...typeDef,
2052
+ _problems: problems
2053
+ };
2054
+ };
2048
2055
  const typeVisitors = {
2049
2056
  array: array_default,
2050
2057
  object: object_default,
2051
- slug: (typeDef, visitorContext) => {
2052
- let problems = [];
2053
- return typeDef.options && typeDef.options.slugifyFn && (problems.push(warning("Heads up! The \"slugifyFn\" option has been renamed to \"slugify\".", HELP_IDS.SLUG_SLUGIFY_FN_RENAMED)), typeDef.options.slugify = typeDef.options.slugifyFn), {
2054
- ...typeDef,
2055
- _problems: problems
2056
- };
2057
- },
2058
+ slug: slug_default,
2058
2059
  file: file_default,
2059
2060
  image: image_default,
2060
2061
  block: validateBlockType,
@@ -2392,10 +2393,10 @@ function transformGlobalDocumentReference(reference) {
2392
2393
  };
2393
2394
  }) };
2394
2395
  }
2395
- const validationRuleTransformers = { type: (rule) => ({
2396
+ const transformTypeValidationRule = (rule) => ({
2396
2397
  ...rule,
2397
2398
  constraint: "constraint" in rule && (typeof rule.constraint == "string" ? rule.constraint.toLowerCase() : retainSerializableProps(rule.constraint))
2398
- }) };
2399
+ }), validationRuleTransformers = { type: transformTypeValidationRule };
2399
2400
  function transformValidation(validation) {
2400
2401
  let validationArray = (Array.isArray(validation) ? validation : [validation]).filter((value) => typeof value == "object" && "_type" in value), disallowedFlags = ["type"], disallowedConstraintTypes = [Rule.FIELD_REF], serializedValidation = validationArray.map(({ _rules, _message, _level }) => {
2401
2402
  let message = typeof _message == "string" ? { message: _message } : {};