diff options
author | (quasar) nebula <qznebula@protonmail.com> | 2024-03-04 20:25:05 -0400 |
---|---|---|
committer | (quasar) nebula <qznebula@protonmail.com> | 2024-06-18 22:56:00 -0300 |
commit | 7f3bd77e36839b8601b498b6d13c0a60406d9899 (patch) | |
tree | cbe3f1f28bd656848f766fd7f5dee65d99033743 /src/data/things | |
parent | 32cafa563c289dc5893565afb4133e2a84ac4fcc (diff) |
data: contribution: context
Diffstat (limited to 'src/data/things')
-rw-r--r-- | src/data/things/contribution.js | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/src/data/things/contribution.js b/src/data/things/contribution.js index 7eb8cfc7..e6479a1e 100644 --- a/src/data/things/contribution.js +++ b/src/data/things/contribution.js @@ -10,7 +10,10 @@ import {isStringNonEmpty, isThing, validateReference} from '#validators'; import {exposeDependency} from '#composite/control-flow'; import {withResolvedReference} from '#composite/wiki-data'; -import {withContributionArtist} from '#composite/things/contribution'; +import { + withContributionArtist, + withContributionContext, +} from '#composite/things/contribution'; export class Contribution extends Thing { static [Thing.getPropertyDescriptors] = () => ({ @@ -42,6 +45,27 @@ export class Contribution extends Thing { flags: {update: true, expose: true}, update: {validate: isStringNonEmpty}, }, + + // Expose only + + context: [ + withContributionContext(), + + { + dependencies: [ + '#contributionTarget', + '#contributionProperty', + ], + + compute: ({ + ['#contributionTarget']: target, + ['#contributionProperty']: property, + }) => ({ + target, + property, + }), + }, + ], }); [inspect.custom](depth, options, inspect) { |