-
Notifications
You must be signed in to change notification settings - Fork 256
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
Core mirador behaviors to provide a plugin target for text resources #4086
Conversation
barmintor
commented
Jan 29, 2025
- refactor type-based filters into a module
- MiradorCanvas.imagesResources does not assume any service is an image service
- stub TextViewer shows empty div, source elements for text resources, and canvas navigation
- fixes There is no component target for a plugin targeting paintable resources of type 'Text' #4085
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #4086 +/- ##
==========================================
+ Coverage 95.05% 95.07% +0.02%
==========================================
Files 315 317 +2
Lines 15905 15973 +68
Branches 2494 2509 +15
==========================================
+ Hits 15119 15187 +68
Misses 782 782
Partials 4 4 ☔ View full report in Codecov by Sentry. |
7c63af6
to
093d303
Compare
src/lib/serviceProfiles.js
Outdated
'level2', | ||
'level1', | ||
'level0', | ||
'http://iiif.io/api/image/2/level2.json', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there's an even older set of image profile urls, e.g.:
http://library.stanford.edu/iiif/image-api/compliance.html#level1
src/lib/canvasTypes.js
Outdated
/** values for type/@type that indicate a video content resource */ | ||
const videoTypes = ['Video', 'MovingImage', 'dctypes:Video', 'dctypes:MovingImage']; | ||
|
||
export default { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure how painful it'd be, but I wonder if we can push these into the config ( + redux store) so downstream applications can extend these lists? We've done something similar with thumbnails.preferredFormats
, auth.serviceProfiles
, and annotations.filteredMotivations
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it would be that bad, with the usual caveat of "naming is hard"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, I did this but it's a significant change - you need access to Mirador config everywhere you create a MiradorCanvas - so I put it in a separate branch. Do we want this in the PR? cul@d6e9db8
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, ew. Having to pass it around to make it available for ThumbnailFactory
(especially) seems pretty bad. Maybe that has to wait until we get around to doing something about Manifesto and can inject that configuration early?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another option might be to push ThumbnailFactory into the redux store behind a memoized selector?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(I should add that some of this is also background for Auth2, where you can't assume that image services are the only associated services)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
☝️ that commit takes the selector approach. I'm not sure it saves a lot of code, but it has a more appealing separation of concerns?
093d303
to
5120821
Compare
- stub TextViewer shows empty div, source elements for text resources, and canvas navigation - fixes ProjectMirador#4085
5120821
to
cf770ed
Compare
@cbeer noting that it is separately desirable to have a TextViewer target component and to have configurable canvas types and service profiles, I'm pushing a branch here that only does the former. |
👍 Handling those two concerns separately makes sense to me. |