UNPKG

@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.)

116 lines (107 loc) 2.68 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _bi = require("react-icons/bi"); var _ = require("../../../.."); var _datatype = require("../../../properties/datatype"); var _object = require("../../../properties/object"); var capitalize = require('capitalize'); var _default = { name: 'Joining', type: 'document', title: 'Innlemmelse', titleEN: 'Joining', icon: _bi.BiDoorOpen, fieldsets: [{ name: 'core', title: 'coresregistrering', options: { collapsible: true, collapsed: false } }], fields: [_datatype.featured, { name: 'hasType', title: 'Klassifisert som', titleEN: 'Classified as', type: 'array', of: [{ type: 'reference', to: [{ type: 'EventType' }] }], options: { semanticSanity: { '@container': '@set', '@type': '@id' } } }, _object.timespanSingleton, _object.tookPlaceAt, { name: 'joinedWith', title: 'Innlemmet i gruppe', titleEN: 'Joined with', description: 'Group that actor(s) joined with', type: 'reference', to: [{ type: 'Actor' }], options: { filter: '_type == "Actor" && references($id)', filterParams: { id: 'd4ad3e47-1498-4b95-9b7f-c25be386691a' }, semanticSanity: { '@container': '@set', '@type': '@id' } } }, { name: 'joined', title: 'Innlemmet aktør(er)', titleEN: 'Joined', description: 'Actor(s) that joined this group', type: 'array', of: [{ type: 'reference', to: [{ type: 'Actor' }] }], options: { semanticSanity: { '@container': '@set', '@type': '@id' } } }, _object.referredToBy], preview: { select: { type: '_type', joinedWith: 'joinedWith.label', bb: 'timespan.beginOfTheBegin', eb: 'timespan.endOfTheBegin', date: 'timespan.date', be: 'timespan.beginOfTheEnd', ee: 'timespan.endOfTheEnd' }, prepare(selection) { var type = selection.type, joinedWith = selection.joinedWith, bb = selection.bb, eb = selection.eb, date = selection.date, be = selection.be, ee = selection.ee; var timespanString = (0, _.timespanAsString)(bb, eb, date, be, ee, 'nb'); return { title: "".concat(capitalize(type), ": ").concat(joinedWith ? (0, _.coalesceLabel)(joinedWith) : ''), subtitle: "".concat(timespanString ? timespanString : '') }; } } }; exports.default = _default; //# sourceMappingURL=Joining.js.map