@sanity/assist 4.4.7 → 5.0.0

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
@@ -1363,8 +1363,9 @@ function conditionalState(memberState) {
1363
1363
  return {
1364
1364
  path: sanity.pathToString(memberState.path),
1365
1365
  readOnly: !!memberState.readOnly,
1366
+ // Use actual form state readOnly value
1366
1367
  hidden: !1,
1367
- // if its in members, its not hidden
1368
+ // If it's in form state members, it's not hidden
1368
1369
  conditional: isConditional(memberState.schemaType)
1369
1370
  };
1370
1371
  }
@@ -1399,7 +1400,7 @@ function extractConditionalPaths(node, maxDepth2) {
1399
1400
  ), innerFields = extractConditionalPaths(member.fieldSet, maxDepth2).map((f) => ({
1400
1401
  ...f,
1401
1402
  // if fieldset is conditional, visible fields must also be considered conditional
1402
- conditional: conditionalFieldset ?? f.conditional
1403
+ conditional: conditionalFieldset || f.conditional
1403
1404
  }));
1404
1405
  return [...acc, ...innerFields];
1405
1406
  }