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

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.
@@ -391,8 +391,8 @@ declare const builtinTypes: ({
391
391
  name: string;
392
392
  type: string;
393
393
  title: string;
394
- readOnly?: undefined;
395
394
  fieldset?: undefined;
395
+ readOnly?: undefined;
396
396
  validation?: undefined;
397
397
  hidden?: undefined;
398
398
  } | {
@@ -470,8 +470,8 @@ declare const builtinTypes: ({
470
470
  name: string;
471
471
  type: string;
472
472
  title: string;
473
- readOnly?: undefined;
474
473
  fieldset?: undefined;
474
+ readOnly?: undefined;
475
475
  validation?: undefined;
476
476
  hidden?: undefined;
477
477
  } | {
@@ -547,17 +547,17 @@ declare const builtinTypes: ({
547
547
  };
548
548
  }[];
549
549
  fields: ({
550
- title?: undefined;
551
- readOnly?: undefined;
552
- fieldset?: undefined;
553
550
  name: string;
554
551
  type: string;
555
- } | {
552
+ fieldset?: undefined;
553
+ title?: undefined;
556
554
  readOnly?: undefined;
555
+ } | {
557
556
  name: string;
558
557
  title: string;
559
558
  type: string;
560
559
  fieldset: string;
560
+ readOnly?: undefined;
561
561
  } | {
562
562
  fieldset?: undefined;
563
563
  name: string;
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 } : {};