@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.)
126 lines (116 loc) • 3.14 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _gi = require("react-icons/gi");
var _coalesceLabel = require("../../../../helpers/coalesceLabel");
var _timespanAsString = require("../../../../helpers/timespanAsString");
var _datatype = require("../../../properties/datatype");
var _object = require("../../../properties/object");
var capitalize = require('capitalize');
var _default = {
name: 'Modification',
type: 'document',
title: 'Modification',
titleEN: 'Produksjon',
icon: _gi.GiFactory,
fieldsets: _coalesceLabel.defaultFieldsets,
fields: [_datatype.featured, {
name: 'consistsOf',
title: 'Underaktiviteter',
titleEN: 'Sub activities',
type: 'array',
of: [{
type: 'Modification'
}],
options: {
semanticSanity: {
'@container': '@set',
'@type': '@id'
}
}
}, {
name: 'hasType',
title: 'Klassifisert som',
titleEN: 'Classified as',
type: 'array',
of: [{
type: 'reference',
to: [{
type: 'ActivityType'
}]
}],
options: {
semanticSanity: {
'@container': '@set',
'@type': '@id'
}
}
}, _object.contributionAssignedBy, _object.timespanSingleton, _object.tookPlaceAt, _object.referredToBy, {
name: 'hasModified',
title: 'Har modifisert',
titleEN: 'Has modified',
description: 'A production can modify an existing object',
type: 'array',
of: [{
type: 'reference',
to: [{
type: 'HumanMadeObject'
}]
}],
options: {
semanticSanity: {
'@container': '@set',
'@type': '@id'
}
}
}, _object.usedGeneralTechnique, _object.usedSpecificTechnique, {
name: 'employed',
title: 'Benyttet',
titleEN: 'Employed',
description: 'WIP, could be a API call to some source of authorities',
type: 'array',
of: [{
type: 'reference',
to: [{
type: 'Material'
}]
}],
options: {
semanticSanity: {
'@container': '@set',
'@type': '@id'
}
}
}],
preview: {
select: {
contributor: 'contributionAssignedBy.0.assignedActor.label',
contributorName: 'contributionAssignedBy.0.usedName.content',
bb: 'timespan.beginOfTheBegin',
eb: 'timespan.endOfTheBegin',
date: 'timespan.date',
be: 'timespan.beginOfTheEnd',
ee: 'timespan.endOfTheEnd',
type: '_type'
},
prepare(selection) {
var type = selection.type,
contributor = selection.contributor,
contributorName = selection.contributorName,
bb = selection.bb,
eb = selection.eb,
date = selection.date,
be = selection.be,
ee = selection.ee;
var timespanString = (0, _timespanAsString.timespanAsString)(bb, eb, date, be, ee, 'nb');
return {
title: "".concat(capitalize(type), ", by ").concat(contributor || contributorName || 'unknown'),
subtitle: timespanString
};
}
}
};
exports.default = _default;
//# sourceMappingURL=Modification.js.map