-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #149 from samvera-labs/4230-custom-display-poc
Support custom canvas displays
- Loading branch information
Showing
21 changed files
with
2,480 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,4 +12,7 @@ coverage/ | |
html/ | ||
|
||
# OS | ||
.DS_Store | ||
.DS_Store | ||
|
||
# VSCode | ||
.vscode/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/** | ||
* Example of a custom component which accepts a Canvas id from | ||
* a Manifest. It then renders expected PDF content by wrapping | ||
* in a simple iFrame (uses browser's default PDF renderer). | ||
* | ||
* One could make this as complex as they like, for flexible implementations. | ||
*/ | ||
|
||
import { LabeledIIIFExternalWebResource } from "src/types/presentation-3"; | ||
|
||
const PDFViewer = ({ | ||
id, | ||
annotationBody, | ||
...restProps | ||
}: { | ||
id: string; | ||
annotationBody: LabeledIIIFExternalWebResource; | ||
restProps: { | ||
[key: string]: unknown; | ||
}; | ||
}) => { | ||
return ( | ||
<> | ||
<p>CustomProps:</p> | ||
<pre style={{ paddingBottom: "1rem" }}>{JSON.stringify(restProps)}</pre> | ||
<div style={{ background: "hotpink", padding: "2rem" }}> | ||
<iframe id={id} src={annotationBody.id} width="100%" height="600" /> | ||
</div> | ||
</> | ||
); | ||
}; | ||
|
||
export default PDFViewer; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.