@sanity/assist 1.2.13 → 1.2.14
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/dist/index.esm.js +13 -5
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +13 -5
- package/dist/index.js.map +1 -1
- package/package.json +8 -8
- package/src/plugin.tsx +6 -2
- package/src/schemas/serialize/serializeSchema.test.ts +15 -2
- package/src/schemas/serialize/serializeSchema.ts +2 -1
package/dist/index.esm.js
CHANGED
|
@@ -166,7 +166,7 @@ function isUnsupportedType(type) {
|
|
|
166
166
|
}
|
|
167
167
|
const inlineTypes = ["document", "object", "image", "file"];
|
|
168
168
|
function serializeSchema(schema, options) {
|
|
169
|
-
const list = schema.getTypeNames().filter(t => !(hiddenTypes.includes(t) || t.startsWith("sanity."))).map(t => schema.get(t)).filter(t => !!t).filter(t =>
|
|
169
|
+
const list = schema.getTypeNames().filter(t => !(hiddenTypes.includes(t) || t.startsWith("sanity."))).map(t => schema.get(t)).filter(t => !!t).filter(t => !t.hidden && !t.readOnly).map(t => getSchemaStub(t, schema, options)).filter(t => {
|
|
170
170
|
if ("to" in t && t.to && !t.to.length) {
|
|
171
171
|
return false;
|
|
172
172
|
}
|
|
@@ -4744,15 +4744,23 @@ const assist = definePlugin(config => {
|
|
|
4744
4744
|
}
|
|
4745
4745
|
return prev;
|
|
4746
4746
|
},
|
|
4747
|
-
unstable_fieldActions: prev => {
|
|
4748
|
-
|
|
4747
|
+
unstable_fieldActions: (prev, _ref17) => {
|
|
4748
|
+
let {
|
|
4749
|
+
documentType,
|
|
4750
|
+
schema
|
|
4751
|
+
} = _ref17;
|
|
4752
|
+
const docSchema = schema.get(documentType);
|
|
4753
|
+
if (docSchema && isSchemaAssistEnabled(docSchema)) {
|
|
4754
|
+
return [...prev, assistFieldActions];
|
|
4755
|
+
}
|
|
4756
|
+
return prev;
|
|
4749
4757
|
},
|
|
4750
|
-
unstable_languageFilter: (prev,
|
|
4758
|
+
unstable_languageFilter: (prev, _ref18) => {
|
|
4751
4759
|
let {
|
|
4752
4760
|
documentId,
|
|
4753
4761
|
schema,
|
|
4754
4762
|
schemaType
|
|
4755
|
-
} =
|
|
4763
|
+
} = _ref18;
|
|
4756
4764
|
const docSchema = schema.get(schemaType);
|
|
4757
4765
|
if (docSchema && isObjectSchemaType(docSchema) && isSchemaAssistEnabled(docSchema)) {
|
|
4758
4766
|
return [...prev, createAssistDocumentPresence(documentId, docSchema)];
|