@seidhr/sanity-plugin-muna-schemas
Version:
Muna or ᛗᚢᚾᚨ means remember in norse. Muna is a schema for the Sanity Studio that enables detailed descriptions of cultural heritage objects and knowledge about their contexts as well as pages about them (or anything else really.)
94 lines (85 loc) • 2.06 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _fa = require("react-icons/fa");
var _defaultFieldsets = require("../../../../lib/fieldsets/defaultFieldsets");
var _helpers = require("../../../helpers");
var _datatype = require("../../properties/datatype");
var _object = require("../../properties/object");
var _default = {
name: 'Storage',
type: 'document',
title: 'Storage',
description: 'Storage is a subclass of place.',
initialValue: {
editorialState: 'published',
accessState: 'secret'
},
icon: _fa.FaBox,
fieldsets: _defaultFieldsets.defaultFieldsets,
fields: [_datatype.editorialState, _datatype.accessState, _datatype.preferredIdentifier, _object.identifiedBy, {
name: 'hasType',
title: 'Klassifisert som',
titleEN: 'Classified as',
type: 'reference',
to: [{
type: 'StorageType'
}],
validation: Rule => Rule.required(),
options: {
semanticSanity: {
'@type': '@id'
}
}
}, _object.referredToBy, _object.timespan, {
name: 'location',
title: 'Lokasjon',
titleEN: 'Location',
type: 'geopoint',
options: {
semanticSanity: {
'@type': '@json'
}
}
}, _object.tookPlaceAt, {
name: 'consistsOf',
title: 'Består av',
titleEN: 'consistsOf',
type: 'array',
of: [{
type: 'reference',
to: [{
type: 'Storage'
}, {
type: 'HumanMadeObject'
}, {
type: 'Collection'
}]
}],
options: {
editModal: 'fullscreen',
semanticSanity: {
'@container': '@list',
'@type': '@id'
}
}
}],
preview: {
select: {
id: 'preferredIdentifier',
type: 'hasType.label'
},
prepare(selection) {
var id = selection.id,
type = selection.type;
return {
title: "".concat(id ? id : ''),
subtitle: (0, _helpers.coalesceLabel)(type)
};
}
}
};
exports.default = _default;
//# sourceMappingURL=Storage.js.map