From 35137cbe060a2c2ec8fcdc09fc6b6bd9e932239f Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Sat, 16 Nov 2024 14:07:15 -0400 Subject: data: annotatedReferenceList, reference-list-helpers --- .../wiki-properties/annotatedReferenceList.js | 39 ++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 src/data/composite/wiki-properties/annotatedReferenceList.js (limited to 'src/data/composite/wiki-properties/annotatedReferenceList.js') diff --git a/src/data/composite/wiki-properties/annotatedReferenceList.js b/src/data/composite/wiki-properties/annotatedReferenceList.js new file mode 100644 index 00000000..e8e5ac8c --- /dev/null +++ b/src/data/composite/wiki-properties/annotatedReferenceList.js @@ -0,0 +1,39 @@ +import {input, templateCompositeFrom} from '#composite'; +import find from '#find'; +import {validateAnnotatedReferenceList} from '#validators'; +import {combineWikiDataArrays} from '#wiki-data'; + +import {exposeDependency} from '#composite/control-flow'; +import {inputWikiData, withResolvedAnnotatedReferenceList} + from '#composite/wiki-data'; + +import {referenceListInputDescriptions, referenceListUpdateDescription} + from './helpers/reference-list-helpers.js'; + +export default templateCompositeFrom({ + annotation: `referencedArtworkList`, + + compose: false, + + inputs: { + ...referenceListInputDescriptions(), + + data: inputWikiData({allowMixedTypes: true}), + find: input({type: 'function'}), + }, + + update: + referenceListUpdateDescription({ + validateReferenceList: validateAnnotatedReferenceList, + }), + + steps: () => [ + withResolvedAnnotatedReferenceList({ + list: input.updateValue(), + data: input('data'), + find: input('find'), + }), + + exposeDependency({dependency: '#resolvedAnnotatedReferenceList'}), + ], +}); -- cgit 1.3.0-6-gf8a5