@sanity/form-toolkit
3.0.63.0.7
dist/form-schema/index.js~
dist/form-schema/index.jsModified+2−2
Index: package/dist/form-schema/index.js
===================================================================
--- package/dist/form-schema/index.js
+++ package/dist/form-schema/index.js
@@ -114,9 +114,9 @@
name: "name",
title: "Field Name",
type: "string",
description: "Must start with a letter and contain only letters, numbers, underscores, or hyphens. Must be unique within the form.",
- validation: (Rule) => Rule.required().custom((name, context) => name ? /^[a-zA-Z][a-zA-Z0-9_-]*$/.test(name) ? (context.document?.fields?.map((field) => field.name) || []).filter((n) => n === name).length > 1 ? "Field name must be unique across all form fields" : [
+ validation: (Rule) => Rule.required().custom((name, context) => name ? /^[a-zA-Z][a-zA-Z0-9_-]*$/.test(name) ? (context.document?.fields?.map((field) => field.name) || []).filter((n) => n === name).length > 1 ? "Field name must be unique across all form fields" : ![
"action",
"method",
"target",
"enctype",
@@ -125,9 +125,9 @@
"novalidate",
"rel",
"submit",
"reset"
- ].includes(name.toLowerCase()) ? "This name is reserved for HTML form attributes. Please choose a different name." : !0 : "Field name must start with a letter and contain only letters, numbers, underscores, or hyphens" : "Required")
+ ].includes(name.toLowerCase()) || "This name is reserved for HTML form attributes. Please choose a different name." : "Field name must start with a letter and contain only letters, numbers, underscores, or hyphens" : "Required")
}),
defineField({
name: "required",
title: "Required",