@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.js CHANGED
@@ -179,7 +179,7 @@ function isUnsupportedType(type) {
179
179
  }
180
180
  const inlineTypes = ["document", "object", "image", "file"];
181
181
  function serializeSchema(schema, options) {
182
- const list = schema.getTypeNames().filter(t => !(hiddenTypes.includes(t) || t.startsWith("sanity."))).map(t => schema.get(t)).filter(t => !!t).filter(t => isAssistSupported(t)).filter(t => !t.hidden && !t.readOnly).map(t => getSchemaStub(t, schema, options)).filter(t => {
182
+ 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 => {
183
183
  if ("to" in t && t.to && !t.to.length) {
184
184
  return false;
185
185
  }
@@ -4757,15 +4757,23 @@ const assist = sanity.definePlugin(config => {
4757
4757
  }
4758
4758
  return prev;
4759
4759
  },
4760
- unstable_fieldActions: prev => {
4761
- return [...prev, assistFieldActions];
4760
+ unstable_fieldActions: (prev, _ref17) => {
4761
+ let {
4762
+ documentType,
4763
+ schema
4764
+ } = _ref17;
4765
+ const docSchema = schema.get(documentType);
4766
+ if (docSchema && isSchemaAssistEnabled(docSchema)) {
4767
+ return [...prev, assistFieldActions];
4768
+ }
4769
+ return prev;
4762
4770
  },
4763
- unstable_languageFilter: (prev, _ref17) => {
4771
+ unstable_languageFilter: (prev, _ref18) => {
4764
4772
  let {
4765
4773
  documentId,
4766
4774
  schema,
4767
4775
  schemaType
4768
- } = _ref17;
4776
+ } = _ref18;
4769
4777
  const docSchema = schema.get(schemaType);
4770
4778
  if (docSchema && sanity.isObjectSchemaType(docSchema) && isSchemaAssistEnabled(docSchema)) {
4771
4779
  return [...prev, createAssistDocumentPresence(documentId, docSchema)];