diff --git a/web/libs/editor/src/mixins/Visibility.js b/web/libs/editor/src/mixins/Visibility.js index 802a4e561d00..191c70bc914d 100644 --- a/web/libs/editor/src/mixins/Visibility.js +++ b/web/libs/editor/src/mixins/Visibility.js @@ -55,6 +55,10 @@ const VisibilityMixin = types "no-region-selected": () => !self.annotation.highlightedNode, "choice-unselected": (params) => !fns["choice-selected"](params), + "tag-selected": ({ tagName }) => { + const tag = self.annotation.names.get(tagName); + return tag.isSelected; + }, }; if (Object.keys(fns).includes(self.visiblewhen)) { diff --git a/web/libs/editor/src/tags/visual/View.jsx b/web/libs/editor/src/tags/visual/View.jsx index c5e035fb8f09..0cd9b2cbd5c3 100644 --- a/web/libs/editor/src/tags/visual/View.jsx +++ b/web/libs/editor/src/tags/visual/View.jsx @@ -60,8 +60,8 @@ import { AnnotationMixin } from "../../mixins/AnnotationMixin"; * @param {string} [style] CSS style string * @param {string} [className] - Class name of the CSS style to apply. Use with the Style tag * @param {string} [idAttr] - Unique ID attribute to use in CSS - * @param {region-selected|choice-selected|no-region-selected|choice-unselected} [visibleWhen] Control visibility of the content. Can also be used with the `when*` parameters below to narrow visibility - * @param {string} [whenTagName] Use with `visibleWhen`. Narrow down visibility by tag name. For regions, use the name of the object tag, for choices, use the name of the `choices` tag + * @param {region-selected|choice-selected|no-region-selected|choice-unselected|tag-selected} [visibleWhen] Control visibility of the content. Can also be used with the `when*` parameters below to narrow visibility + * @param {string} [whenTagName] Use with `visibleWhen`. Narrow down visibility by tag name. For regions, use the name of the object tag, for choices, use the name of the `choices` tag, for tag use the name of the tag * @param {string} [whenLabelValue] Use with `visibleWhen="region-selected"`. Narrow down visibility by label value. Multiple values can be separated with commas * @param {string} [whenChoiceValue] Use with `visibleWhen` (`"choice-selected"` or `"choice-unselected"`) and `whenTagName`, both are required. Narrow down visibility by choice value. Multiple values can be separated with commas */ @@ -114,14 +114,17 @@ const Model = types.model({ "textarea", "pairwise", "style", + "label", "relations", "filter", + "timeseries", + "timeserieslabels", "pagedview", "paragraphs", "paragraphlabels", "video", "videorectangle", - "timelinelabels", + "ranker", ]), });