@sanity/schema
Advanced tools
Comparing version 0.104.30 to 0.104.34-alpha.136d385a
@@ -6,5 +6,2 @@ 'use strict'; | ||
}); | ||
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; | ||
exports.default = guessPreviewFields; | ||
@@ -45,27 +42,21 @@ var TITLE_CANDIDATES = ['title', 'name', 'label', 'heading', 'header', 'caption']; | ||
if (!titleField) { | ||
var _ret = function () { | ||
// last resort, pick all fields and concat them | ||
var fieldNames = fields.map(function (field) { | ||
return field.name; | ||
}); | ||
var fieldMapping = fieldNames.reduce(function (acc, fieldName) { | ||
acc[fieldName] = fieldName; | ||
return acc; | ||
}, {}); | ||
// last resort, pick all fields and concat them | ||
var fieldNames = fields.map(function (field) { | ||
return field.name; | ||
}); | ||
var fieldMapping = fieldNames.reduce(function (acc, fieldName) { | ||
acc[fieldName] = fieldName; | ||
return acc; | ||
}, {}); | ||
return { | ||
v: { | ||
select: fieldMapping, | ||
prepare: function prepare(data) { | ||
return { | ||
title: fieldNames.map(function (name) { | ||
return name + ': ' + JSON.stringify(data[name]); | ||
}).join(' / ') | ||
}; | ||
} | ||
} | ||
}; | ||
}(); | ||
if ((typeof _ret === 'undefined' ? 'undefined' : _typeof(_ret)) === "object") return _ret.v; | ||
return { | ||
select: fieldMapping, | ||
prepare: function prepare(data) { | ||
return { | ||
title: fieldNames.map(function (name) { | ||
return name + ': ' + JSON.stringify(data[name]); | ||
}).join(' / ') | ||
}; | ||
} | ||
}; | ||
} | ||
@@ -72,0 +63,0 @@ |
@@ -16,6 +16,2 @@ 'use strict'; | ||
var _guessPreviewConfig = require('../preview/guessPreviewConfig'); | ||
var _guessPreviewConfig2 = _interopRequireDefault(_guessPreviewConfig); | ||
var _fieldDefs = require('./image/fieldDefs'); | ||
@@ -22,0 +18,0 @@ |
@@ -140,2 +140,20 @@ 'use strict'; | ||
} | ||
}); | ||
var _block = require('./blocks/block'); | ||
Object.defineProperty(exports, 'block', { | ||
enumerable: true, | ||
get: function get() { | ||
return _block.BlockType; | ||
} | ||
}); | ||
var _span = require('./blocks/span'); | ||
Object.defineProperty(exports, 'span', { | ||
enumerable: true, | ||
get: function get() { | ||
return _span.SpanType; | ||
} | ||
}); |
{ | ||
"name": "@sanity/schema", | ||
"version": "0.104.30", | ||
"version": "0.104.34-alpha.136d385a", | ||
"description": "", | ||
@@ -17,4 +17,4 @@ "main": "lib/index.js", | ||
"@types/node": "6.0.52", | ||
"babel-cli": "^6.23.0", | ||
"babel-eslint": "^7.1.1", | ||
"babel-cli": "^6.24.0", | ||
"babel-eslint": "^7.2.1", | ||
"babel-plugin-lodash": "^3.2.11", | ||
@@ -29,3 +29,3 @@ "babel-plugin-syntax-class-properties": "^6.13.0", | ||
"eslint": "^3.18.0", | ||
"eslint-config-sanity": "^2.1.2", | ||
"eslint-config-sanity": "^2.1.4", | ||
"eslint-plugin-import": "^2.2.0", | ||
@@ -32,0 +32,0 @@ "interop-require": "^1.0.0", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
141690
49
5360