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

Feature/newspaper viewer revisions (WIP) #166

Closed
Show file tree
Hide file tree
Changes from 48 commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
8d519ea
add package-lock.json
wykhuh Jan 7, 2024
0d33799
add newspaper manifest
wykhuh Dec 9, 2023
66e5240
add page to display newspaper example
wykhuh Dec 9, 2023
a0dfa22
give plugins access to opensnapdragon viewer
wykhuh Dec 7, 2023
2e04af8
add methods to process annotations
wykhuh Dec 9, 2023
f3076d4
add newspaper page that highlights search word
wykhuh Dec 7, 2023
95c6e7c
display annotation resources on information panel
wykhuh Dec 9, 2023
164971f
click on annotation to zoom and pan; add osd viewer to store
wykhuh Dec 9, 2023
c349432
replace unneeded osdViewerCallback with osd viewer in store
wykhuh Dec 9, 2023
a053083
add overlays to OpenSeadragon viewer using annotations manifest
wykhuh Dec 9, 2023
8927726
remove add overlay code from newspaper page
wykhuh Dec 9, 2023
1e6dc54
add page to display annotation examples from IIIF cookbook
wykhuh Dec 12, 2023
350872b
make annotation overlays work with point selectors
wykhuh Dec 9, 2023
dfb5cf1
render annotations that use html
wykhuh Dec 10, 2023
797337b
make annotation overlays work with svg
wykhuh Dec 11, 2023
2f6fbfd
add zoomLevel to annotation config
wykhuh Dec 12, 2023
a797dee
remove annotation manifest from newspaper page
wykhuh Dec 13, 2023
a108528
refactor seadragon-svg - add import, export; get rid of require
wykhuh Dec 14, 2023
be9418a
show information panel renderAnnotation is true, but no annotation
wykhuh Dec 15, 2023
979825e
refactor checking if annotation has valid motivation
wykhuh Dec 19, 2023
df500e8
fix tests for annotation overlay
wykhuh Dec 19, 2023
93c715f
fix linting errors
wykhuh Jan 8, 2024
ced93b7
remove osdViewerCallback
wykhuh Jan 8, 2024
c8bc0e8
show information panel on annotations docs
wykhuh Jan 8, 2024
aec8e04
remove deprecated prop from newspaper page
wykhuh Jan 8, 2024
6d44c5c
fix openseadragon svg - rename file; to check if viewer has been loaded
wykhuh Jan 8, 2024
38fcaba
remove hardcoded code for svg bounding box
wykhuh Jan 9, 2024
b3c9351
add note about svg overlay bug
wykhuh Jan 9, 2024
0331f85
Consolidate annotation resource gathering.
mathewjordan Jan 16, 2024
94452df
Create Annotation folder under InformationPanel
adamjarling Jan 17, 2024
ac85e18
Parse annotation format and target; rewire VTTs.
mathewjordan Jan 17, 2024
c4110d7
Update openseadragon helpers, abstact rect creation.
mathewjordan Jan 18, 2024
98e5096
Get OSD overlays working
adamjarling Jan 18, 2024
3572c2d
Fix test for addOverlaysToViewer()
adamjarling Jan 18, 2024
1056284
Get click handler working (part way) for 0261 recipe non-rectangular …
adamjarling Jan 31, 2024
a9e2c62
Update annotation parsing to handle tagging motivation, which support…
adamjarling Jan 31, 2024
22e3aa3
Support image annotation for recipe 11, Image in annotations
adamjarling Feb 1, 2024
e1c3148
Update styling of annotation items, consolidate with previous VTT cue…
adamjarling Feb 1, 2024
d8c4b68
TypeScript cleanup part one
adamjarling Feb 1, 2024
a6ceb5c
TypeScript cleanup part two
adamjarling Feb 2, 2024
9de1158
Get all tests to pass
adamjarling Feb 2, 2024
748ac8e
Video captions working again with new annotations structure
adamjarling Feb 2, 2024
974953b
Finish tests for getAnnotationResources helpers
adamjarling Feb 2, 2024
f6f0cdd
Remove old references to getSupplementingResources() helper function
adamjarling Feb 2, 2024
351fae9
Add fixed 0135 specific point recipe.
mathewjordan Feb 2, 2024
9736b86
Add some Annotation component tests
adamjarling Feb 2, 2024
b5efb3f
Merge branch 'feature/newspaper-viewer--revisions' of github.com:wykh…
adamjarling Feb 2, 2024
cc68774
Wrap up tests for new Annotation components
adamjarling Feb 5, 2024
28a1939
PR cleanup AnnotationItem component
adamjarling Feb 8, 2024
d73bbea
Update newspaper fixture manifest to have unique Annotation and Annot…
adamjarling Feb 8, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

pnpm exec lint-staged
# pnpm exec lint-staged
38 changes: 19 additions & 19 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
"@radix-ui/react-switch": "^1.0.3",
"@radix-ui/react-tabs": "^1.0.4",
"@stitches/react": "^1.2.8",
"hls.js": "^1.4.14",
"hls.js": "^1.5.3",
"node-webvtt": "^1.9.4",
"openseadragon": "^2.4.2",
"react": "^18.2.0",
Expand All @@ -81,37 +81,37 @@
},
"devDependencies": {
"@iiif/presentation-3": "^1.1.3",
"@testing-library/jest-dom": "^6.1.6",
"@testing-library/react": "^14.1.2",
"@testing-library/jest-dom": "^6.4.1",
"@testing-library/react": "^14.2.1",
"@testing-library/user-event": "^14.5.2",
"@types/node": "20.10.6",
"@types/node": "20.11.16",
"@types/openseadragon": "^3.0.10",
"@types/react": "^18.2.46",
"@types/react": "^18.2.51",
"@types/react-dom": "^18.2.18",
"@types/sanitize-html": "^2.9.5",
"@typescript-eslint/eslint-plugin": "^6.17.0",
"@typescript-eslint/eslint-plugin": "^6.20.0",
"@vitejs/plugin-react": "^4.2.1",
"@vitest/coverage-v8": "^1.1.1",
"@vitest/ui": "^1.1.1",
"@vitest/coverage-v8": "^1.2.2",
"@vitest/ui": "^1.2.2",
"cross-fetch": "^4.0.0",
"dts-bundle-generator": "8.0.1",
"eslint-config-next": "14.0.4",
"eslint-config-next": "14.1.0",
"eslint-config-prettier": "^9.1.0",
"execa": "^8.0.1",
"husky": "^8.0.3",
"jsdom": "^23.0.1",
"lint-staged": "^15.2.0",
"next": "^14.0.4",
"nextra": "^2.13.2",
"nextra-theme-docs": "^2.13.2",
"jsdom": "^23.2.0",
"lint-staged": "^15.2.1",
"next": "^14.1.0",
"nextra": "^2.13.3",
"nextra-theme-docs": "^2.13.3",
"preact": "^10.19.3",
"prettier": "^3.1.1",
"prettier": "^3.2.4",
"rimraf": "^5.0.5",
"terser": "^5.26.0",
"terser": "^5.27.0",
"typescript": "^5.3.3",
"vite": "^5.0.10",
"vite-tsconfig-paths": "^4.2.3",
"vitest": "^1.1.1"
"vite": "^5.0.12",
"vite-tsconfig-paths": "^4.3.1",
"vitest": "^1.2.2"
},
"peerDependencies": {
"swiper": "^9.0.0"
Expand Down
7 changes: 7 additions & 0 deletions pages/docs/viewer/_meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,12 @@
"sidebar": false,
"layout": "full"
}
},
"annotations": {
"title": "Annotations",
"theme": {
"sidebar": false,
"layout": "full"
}
}
}
23 changes: 23 additions & 0 deletions pages/docs/viewer/annotations.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import Viewer from "docs/components/DynamicImports/Viewer";
import CallToAction from "docs/components/CallToAction";


## Viewer

<br />
<CallToAction href="/docs/viewer" text="Docs" size="small" />

## Displays "Other kinds of annotations" from [IIIF cookbook](https://iiif.io/api/cookbook/).

<Viewer
iiifContent="http://localhost:3000/manifest/annotations/annotations.json"
options={{
informationPanel: { open: true },
canvasHeight: "640px",
openSeadragon: {
gestureSettingsMouse: {
scrollToZoom: false,
},
},
}}
/>
12 changes: 12 additions & 0 deletions pages/newspaper.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import React from "react";
Copy link
Contributor

@wykhuh wykhuh Feb 7, 2024

Choose a reason for hiding this comment

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

There is a weird bug. When there is a collection, Clover will display a dropdown menu to switch between items in the collection. If you use the menu to switch items the first time, the canvas is updated. If you use the menu to switch items 2nd, 3rd, etc times, the manifest changes but the canvas painting does not change.

http://localhost:3000/newspaper

The bug exists on the version of Clover that is running the GitHub pages.
https://samvera-labs.github.io/clover-iiif/docs/viewer/demo?iiif-content=https://iiif.io/api/cookbook/recipe/0068-newspaper/newspaper_title-collection.json

Copy link
Collaborator

@adamjarling adamjarling Feb 8, 2024

Choose a reason for hiding this comment

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

@wykhuh @mathewjordan Spent the morning digging into this odd behavior, and getting quite familiar with vaults storage structure. Which finally pointed me to the underlying problem, or at least the cause of this bug. vault will store it's resources, ("Collection", "Annotation", "AnnotationPage", etc) keyed by the resource id. There were duplicate resource ids (URIs), for an Annotation and AnnotationPage between the two fixture files:

  • public/manifest/newspaper/newspaper_issue_1.json
  • public/manifest/newspaper/newspaper_issue_2.json

When switching to the 2nd manifest in public/manifest/newspaper/newspaper_collection.json, vault was overriding the value for:

  • http://localhost:3000/manifest/newspaper/annotation_page_painting/ap1
  • http://localhost:3000/manifest/newspaper/annotation/p1

Updating the ids in newspaper_issue_2.json makes vault happy and it can uniquely retrieve items as expected once again.

Copy link
Contributor

Choose a reason for hiding this comment

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

@adamjarling The bug also happens in the IIIF newspaper recipe https://iiif.io/api/cookbook/recipe/0068-newspaper/newspaper_title-collection.json Is the bug also caused by a duplicate id in the IIIF recipe?

Copy link
Collaborator

Choose a reason for hiding this comment

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

@wykhuh Hmmm, well that is interesting. I don't see any duplicate ids in that manifest, so that's not the problem, but something else is. I think we should add that recipe to the annotations test page and look into further.


import Viewer from "docs/components/DynamicImports/Viewer";

function Newspaper() {
const iiifContent =
"http://localhost:3000/manifest/newspaper/newspaper_collection.json";

return <Viewer iiifContent={iiifContent} />;
}

export default Newspaper;
Loading
Loading