@sanity/schema 6.7.0-next.53 → 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.
package/lib/_internal.d.ts
CHANGED
|
@@ -384,17 +384,17 @@ declare const builtinTypes: ({
|
|
|
384
384
|
type: string;
|
|
385
385
|
title: string;
|
|
386
386
|
readOnly: boolean;
|
|
387
|
+
fieldset?: undefined;
|
|
387
388
|
validation?: undefined;
|
|
388
389
|
hidden?: undefined;
|
|
389
|
-
fieldset?: undefined;
|
|
390
390
|
} | {
|
|
391
391
|
name: string;
|
|
392
392
|
type: string;
|
|
393
393
|
title: string;
|
|
394
|
+
fieldset?: undefined;
|
|
395
|
+
readOnly?: undefined;
|
|
394
396
|
validation?: undefined;
|
|
395
397
|
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
|
-
validation?: undefined;
|
|
413
412
|
title?: undefined;
|
|
413
|
+
validation?: 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;
|
|
466
467
|
validation?: undefined;
|
|
467
468
|
hidden?: undefined;
|
|
468
|
-
fieldset?: undefined;
|
|
469
469
|
} | {
|
|
470
470
|
name: string;
|
|
471
471
|
type: string;
|
|
472
472
|
title: string;
|
|
473
|
+
fieldset?: undefined;
|
|
474
|
+
readOnly?: undefined;
|
|
473
475
|
validation?: undefined;
|
|
474
476
|
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;
|
|
487
486
|
name: string;
|
|
488
487
|
type: string;
|
|
489
488
|
readOnly: boolean;
|
|
490
489
|
hidden: boolean;
|
|
491
490
|
fieldset: string;
|
|
492
491
|
title?: undefined;
|
|
493
|
-
} | {
|
|
494
492
|
validation?: undefined;
|
|
495
|
-
|
|
493
|
+
} | {
|
|
496
494
|
name: string;
|
|
497
495
|
type: string;
|
|
498
496
|
title: string;
|
|
499
497
|
readOnly: boolean;
|
|
500
498
|
fieldset: string;
|
|
499
|
+
validation?: undefined;
|
|
500
|
+
hidden?: undefined;
|
|
501
501
|
})[];
|
|
502
502
|
preview: {
|
|
503
503
|
select: {
|
|
@@ -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-
|
|
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:
|
|
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
|
|
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 } : {};
|