@sanity/schema 6.23.0-next.19 → 6.23.0-next.32
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
|
@@ -428,8 +428,8 @@ export declare const builtinTypes: ({
|
|
|
428
428
|
title: string;
|
|
429
429
|
validation?: undefined;
|
|
430
430
|
hidden?: undefined;
|
|
431
|
-
fieldset?: undefined;
|
|
432
431
|
readOnly?: undefined;
|
|
432
|
+
fieldset?: undefined;
|
|
433
433
|
} | {
|
|
434
434
|
name: string;
|
|
435
435
|
type: string;
|
|
@@ -507,8 +507,8 @@ export declare const builtinTypes: ({
|
|
|
507
507
|
title: string;
|
|
508
508
|
validation?: undefined;
|
|
509
509
|
hidden?: undefined;
|
|
510
|
-
fieldset?: undefined;
|
|
511
510
|
readOnly?: undefined;
|
|
511
|
+
fieldset?: undefined;
|
|
512
512
|
} | {
|
|
513
513
|
name: string;
|
|
514
514
|
type: string;
|
|
@@ -582,17 +582,17 @@ export declare const builtinTypes: ({
|
|
|
582
582
|
};
|
|
583
583
|
}[];
|
|
584
584
|
fields: ({
|
|
585
|
-
name: string;
|
|
586
|
-
type: string;
|
|
587
|
-
fieldset?: undefined;
|
|
588
585
|
title?: undefined;
|
|
589
586
|
readOnly?: undefined;
|
|
587
|
+
fieldset?: undefined;
|
|
588
|
+
name: string;
|
|
589
|
+
type: string;
|
|
590
590
|
} | {
|
|
591
|
+
readOnly?: undefined;
|
|
591
592
|
name: string;
|
|
592
593
|
title: string;
|
|
593
594
|
type: string;
|
|
594
595
|
fieldset: string;
|
|
595
|
-
readOnly?: undefined;
|
|
596
596
|
} | {
|
|
597
597
|
fieldset?: undefined;
|
|
598
598
|
name: string;
|
package/lib/_internal.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as resolveSearchConfig, d as OWN_PROPS_NAME, f as Rule, l as resolveSearchConfigForBaseFieldPaths, n as Schema$1, s as DEFAULT_MAX_FIELD_DEPTH, u as ALL_FIELDS_GROUP_NAME } from "./Schema-
|
|
1
|
+
import { c as resolveSearchConfig, d as OWN_PROPS_NAME, f as Rule, l as resolveSearchConfigForBaseFieldPaths, n as Schema$1, s as DEFAULT_MAX_FIELD_DEPTH, u as ALL_FIELDS_GROUP_NAME } from "./Schema-A0BdoNMg.js";
|
|
2
2
|
import { SetBuilder, processSetSynchronization } from "@sanity/descriptors";
|
|
3
3
|
import { isSpanSchemaType } from "@sanity/types";
|
|
4
4
|
import { dequal } from "dequal/lite";
|
|
@@ -402,7 +402,7 @@ function maybeValidations(obj) {
|
|
|
402
402
|
let validation = maybeValidation(rule);
|
|
403
403
|
if (validation === void 0) continue;
|
|
404
404
|
let rulesToAdd = impliedRules.filter((ir) => !validation.rules.some((r) => r.type === ir.type));
|
|
405
|
-
rulesToAdd.length > 0 && validation.rules.unshift(...rulesToAdd),
|
|
405
|
+
rulesToAdd.length > 0 && validation.rules.unshift(...rulesToAdd), validations.some((v) => dequal(v, validation)) || validations.push(validation);
|
|
406
406
|
}
|
|
407
407
|
return validations.length > 0 ? validations : void 0;
|
|
408
408
|
}
|
|
@@ -1488,13 +1488,14 @@ function getDupes(array, selector = (v) => v) {
|
|
|
1488
1488
|
const NOOP_VISITOR = (typeDef) => typeDef, TYPE_TYPE = {
|
|
1489
1489
|
name: "type",
|
|
1490
1490
|
type: null
|
|
1491
|
-
}, FUTURE_RESERVED = [
|
|
1492
|
-
"any",
|
|
1493
|
-
"time",
|
|
1494
|
-
"date"
|
|
1495
|
-
];
|
|
1491
|
+
}, FUTURE_RESERVED = ["any", "time"];
|
|
1496
1492
|
function traverseSchema(types = [], coreTypes = [], visitor = NOOP_VISITOR, parentTypes = []) {
|
|
1497
|
-
let coreTypesRegistry = Object.create(null), registry = Object.create(null), parentTypesRegistry = Object.create(null), coreTypeNames = coreTypes.map((typeDef) => typeDef.name), parentTypeNames = parentTypes.map((typeDef) => typeDef.name), reservedTypeNames =
|
|
1493
|
+
let coreTypesRegistry = Object.create(null), registry = Object.create(null), parentTypesRegistry = Object.create(null), coreTypeNames = coreTypes.map((typeDef) => typeDef.name), parentTypeNames = parentTypes.map((typeDef) => typeDef.name), reservedTypeNames = /* @__PURE__ */ new Set([
|
|
1494
|
+
"type",
|
|
1495
|
+
...FUTURE_RESERVED,
|
|
1496
|
+
...coreTypeNames,
|
|
1497
|
+
...parentTypeNames
|
|
1498
|
+
]), typeNames = types.map((typeDef) => typeDef && typeDef.name).filter(Boolean);
|
|
1498
1499
|
coreTypes.forEach((coreType) => {
|
|
1499
1500
|
coreTypesRegistry[coreType.name] = coreType;
|
|
1500
1501
|
}), parentTypes.forEach((type) => {
|
|
@@ -1513,7 +1514,7 @@ function traverseSchema(types = [], coreTypes = [], visitor = NOOP_VISITOR, pare
|
|
|
1513
1514
|
return typeNames.concat(parentTypeNames, coreTypeNames);
|
|
1514
1515
|
}
|
|
1515
1516
|
function isReserved(typeName) {
|
|
1516
|
-
return
|
|
1517
|
+
return reservedTypeNames.has(typeName);
|
|
1517
1518
|
}
|
|
1518
1519
|
let visitType = (isRoot) => (typeDef, index) => visitor(typeDef, {
|
|
1519
1520
|
visit: visitType(!1),
|