Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Choice annotations. #148

Merged
merged 1 commit into from
Oct 16, 2023
Merged

Support Choice annotations. #148

merged 1 commit into from
Oct 16, 2023

Conversation

mathewjordan
Copy link
Member

@mathewjordan mathewjordan commented Oct 10, 2023

What does this do?

This is a big one...

This adds the ability for a user to select between options a Choice annotation type.
https://www.w3.org/TR/annotation-model/#choice-between-bodies

image

If a Choice exists on the active canvas, the options are presented to the user in a select render below the visible canvas (OpenSeadragon for Image, HTML5 video for Video and Sound). The work he abstracts out the Collection select and makes this component generic under src/components/internal/Select. The newly created Select component is then used for both the Collection drop down in the header, functioning as it did previously, and as the Choice select UI element. In the case of Choice, the the default option is the first item in the Choice array.

When reviewing, the following manifests should accomplish different things:

  1. An image manifest with choice will render the ImageViewer component with a Choice select below it. With this, Clover now supports the Multiple Choice of Images in a Single View (Canvas) recipe see: localhost:3000/docs/viewer/demo?iiif-content=https://iiif.io/api/cookbook/recipe/0033-choice/manifest.json locally.

  2. A video manifest with choice will render the Player component with a Choice select below it. With this, Clover will now support Avalon and Internet Archive manifests with choice options. See: localhost:3000/docs/viewer/demo?iiif-content=http://localhost:3000/manifest/avalon/transcript-annotation.json and localhost:3000/docs/viewer/demo?iiif-content=https://iiif.archive.org/iiif/Shogun_Miniseries/manifest.json locally. Note that the Internet Archive video formats may not currently be support by the browsers native HTML5 video element. It seems like Ogg Video is commonly supported.

  3. Collections should still function as expected, with a select render in the Header in lieu of a static text Manifest label. See: http://localhost:3000/docs/viewer/demo?iiif-content=https://canopy-iiif.github.io/canopy-iiif/api/facet/date/1910.json locally.

@mathewjordan mathewjordan self-assigned this Oct 13, 2023
@mathewjordan mathewjordan marked this pull request as ready for review October 13, 2023 13:18
Copy link
Collaborator

@adamjarling adamjarling left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks and performs well. Lots of code updates 👍

CollectionStyled,
} from "src/components/Viewer/Collection/Collection.styled";
import { Label, Thumbnail } from "src/components/Primitives";
import { Select, SelectOption } from "src/components/internal/Select";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice addition

InternationalString,
} from "@iiif/presentation-3";

export interface LabeledIIIFExternalWebResource
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this pattern of extending out some of the Presentation 3 package types.

@mathewjordan mathewjordan force-pushed the 4064-annotation-choice branch from 4734e00 to 1a8c86b Compare October 16, 2023 12:34
@mathewjordan mathewjordan changed the title Support Choice annotations Support Choice annotations. Oct 16, 2023
@mathewjordan mathewjordan merged commit be9a17c into main Oct 16, 2023
1 check passed
@mathewjordan mathewjordan deleted the 4064-annotation-choice branch October 16, 2023 12:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants