Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
21 changes: 21 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Build artifacts
dist/

# Demo artifacts
demo/

*.md

.github/

# Test fixtures
__tests__/fixtures/

# Dependencies
node_modules/

# Test coverage
coverage/

# Package manager files
package-lock.json
7 changes: 7 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"singleQuote": true,
"trailingComma": "all",
"semi": true,
"printWidth": 130,
"tabWidth": 2
}
4 changes: 1 addition & 3 deletions __tests__/integration/components/AddComponentA.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import React from 'react';

Check warning on line 1 in __tests__/integration/components/AddComponentA.jsx

View workflow job for this annotation

GitHub Actions / build (24.x)

'React' is defined but never used

Check warning on line 1 in __tests__/integration/components/AddComponentA.jsx

View workflow job for this annotation

GitHub Actions / build (20.x)

'React' is defined but never used

Check warning on line 1 in __tests__/integration/components/AddComponentA.jsx

View workflow job for this annotation

GitHub Actions / build (22.x)

'React' is defined but never used

const AddComponentA = () => (
<div data-testid="add-plugin-component-a">Plugin A</div>
);
const AddComponentA = () => <div data-testid="add-plugin-component-a">Plugin A</div>;

export default AddComponentA;
4 changes: 1 addition & 3 deletions __tests__/integration/components/AddComponentB.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import React from 'react';

Check warning on line 1 in __tests__/integration/components/AddComponentB.jsx

View workflow job for this annotation

GitHub Actions / build (24.x)

'React' is defined but never used

Check warning on line 1 in __tests__/integration/components/AddComponentB.jsx

View workflow job for this annotation

GitHub Actions / build (20.x)

'React' is defined but never used

Check warning on line 1 in __tests__/integration/components/AddComponentB.jsx

View workflow job for this annotation

GitHub Actions / build (22.x)

'React' is defined but never used

const AddComponentB = () => (
<div data-testid="add-plugin-component-b">Plugin B</div>
);
const AddComponentB = () => <div data-testid="add-plugin-component-b">Plugin B</div>;

export default AddComponentB;
6 changes: 1 addition & 5 deletions __tests__/integration/components/AddComponentC.jsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
import React from 'react';

Check warning on line 1 in __tests__/integration/components/AddComponentC.jsx

View workflow job for this annotation

GitHub Actions / build (24.x)

'React' is defined but never used

Check warning on line 1 in __tests__/integration/components/AddComponentC.jsx

View workflow job for this annotation

GitHub Actions / build (20.x)

'React' is defined but never used

Check warning on line 1 in __tests__/integration/components/AddComponentC.jsx

View workflow job for this annotation

GitHub Actions / build (22.x)

'React' is defined but never used

const AddComponentC = (props) => (
<div id="add-plugin-component-c">
Plugin C
</div>
);
const AddComponentC = (props) => <div id="add-plugin-component-c">Plugin C</div>;

Check warning on line 3 in __tests__/integration/components/AddComponentC.jsx

View workflow job for this annotation

GitHub Actions / build (24.x)

'props' is defined but never used

Check warning on line 3 in __tests__/integration/components/AddComponentC.jsx

View workflow job for this annotation

GitHub Actions / build (20.x)

'props' is defined but never used

Check warning on line 3 in __tests__/integration/components/AddComponentC.jsx

View workflow job for this annotation

GitHub Actions / build (22.x)

'props' is defined but never used

export default AddComponentC;
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import React from 'react';

Check warning on line 1 in __tests__/integration/components/CompanionWindowButtonComponent.jsx

View workflow job for this annotation

GitHub Actions / build (24.x)

'React' is defined but never used

Check warning on line 1 in __tests__/integration/components/CompanionWindowButtonComponent.jsx

View workflow job for this annotation

GitHub Actions / build (20.x)

'React' is defined but never used

Check warning on line 1 in __tests__/integration/components/CompanionWindowButtonComponent.jsx

View workflow job for this annotation

GitHub Actions / build (22.x)

'React' is defined but never used

const CompanionWindowButtonComponent = () => (
<span data-testid="add-plugin-companion-window-button" role="button">Companion Window Button Component</span>
<span data-testid="add-plugin-companion-window-button" role="button">
Companion Window Button Component
</span>
);
CompanionWindowButtonComponent.value = 'specialMiradorKey';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
import React from 'react';

Check warning on line 1 in __tests__/integration/components/CompanionWindowComponent.jsx

View workflow job for this annotation

GitHub Actions / build (24.x)

'React' is defined but never used

Check warning on line 1 in __tests__/integration/components/CompanionWindowComponent.jsx

View workflow job for this annotation

GitHub Actions / build (20.x)

'React' is defined but never used

Check warning on line 1 in __tests__/integration/components/CompanionWindowComponent.jsx

View workflow job for this annotation

GitHub Actions / build (22.x)

'React' is defined but never used

const CompanionWindowComponent = (props) => (
<div data-testid="add-plugin-companion-window">
Companion Window Component
</div>
);
const CompanionWindowComponent = (props) => <div data-testid="add-plugin-companion-window">Companion Window Component</div>;

Check warning on line 3 in __tests__/integration/components/CompanionWindowComponent.jsx

View workflow job for this annotation

GitHub Actions / build (24.x)

'props' is defined but never used

Check warning on line 3 in __tests__/integration/components/CompanionWindowComponent.jsx

View workflow job for this annotation

GitHub Actions / build (20.x)

'props' is defined but never used

Check warning on line 3 in __tests__/integration/components/CompanionWindowComponent.jsx

View workflow job for this annotation

GitHub Actions / build (22.x)

'props' is defined but never used

export default CompanionWindowComponent;
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable react/prop-types */
const StateDependentComponent = ({ incSomeNumber, manifestId }) => (
<button id="plugin-button" onClick={incSomeNumber} style={{ width: 64 }} type="button">
{ `Plugin:${manifestId}` }
{`Plugin:${manifestId}`}
</button>
);

Expand Down
4 changes: 1 addition & 3 deletions __tests__/integration/mirador-configs/collections.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
export default {
catalog: [
{ manifestId: 'https://www.e-codices.unifr.ch/metadata/iiif/collection.json' },
],
catalog: [{ manifestId: 'https://www.e-codices.unifr.ch/metadata/iiif/collection.json' }],
id: 'mirador',
windows: [
{
Expand Down
17 changes: 11 additions & 6 deletions __tests__/integration/mirador-configs/content-search.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
export default {
catalog: [
{ manifestId: 'https://damsssl.llgc.org.uk/iiif/2.0/4566425/manifest.json', provider: 'LLGC' },
{ manifestId: 'https://wellcomelibrary.org/iiif/b18035723/manifest', provider: 'Wellcome Library' },
{
manifestId: 'https://wellcomelibrary.org/iiif/b18035723/manifest',
provider: 'Wellcome Library',
},
{ manifestId: 'https://scta.info/iiif/graciliscommentary/lon/manifest', provider: 'SCTA' },
{ manifestId: 'https://purl.stanford.edu/zx429wp8334/iiif/manifest', provider: 'SUL' },
],
id: 'mirador',
windows: [{
loadedManifest: 'https://purl.stanford.edu/fg165hz3589/iiif/manifest',
// defaultSearchQuery: 'NSF',
suggestedSearches: ['NSF'],
}],
windows: [
{
loadedManifest: 'https://purl.stanford.edu/fg165hz3589/iiif/manifest',
// defaultSearchQuery: 'NSF',
suggestedSearches: ['NSF'],
},
],
};
3 changes: 2 additions & 1 deletion __tests__/integration/mirador-configs/fallback-image.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@ export default {
{
manifestId: '/__tests__/fixtures/version-3/fallback-image.json',
thumbnailNavigation: 'far-bottom',
}],
},
],
};
67 changes: 51 additions & 16 deletions __tests__/integration/mirador-configs/i18n.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,59 @@ import { PRIMARY_MANIFEST_FIXTURE_URL } from './constants';
export default {
catalog: [
{ manifestId: PRIMARY_MANIFEST_FIXTURE_URL },
{ manifestId: 'https://iiif.bodleian.ox.ac.uk/iiif/manifest/e32a277e-91e2-4a6d-8ba6-cc4bad230410.json' },
{ manifestId: 'https://media.nga.gov/public/manifests/nga_highlights.json', provider: 'National Gallery of Art' },
{ manifestId: 'https://wellcomelibrary.org/iiif/b18035723/manifest', provider: 'Wellcome Library' },
{ manifestId: 'https://demos.biblissima.fr/iiif/metadata/florus-dispersus/manifest.json', provider: 'Biblissima' },
{ manifestId: 'https://www.e-codices.unifr.ch/metadata/iiif/gau-Fragment/manifest.json', provider: 'e-codices - Virtual Manuscript Library of Switzerland' },
{ manifestId: 'https://wellcomelibrary.org/iiif/collection/b18031511', provider: 'Wellcome Library' },
{ manifestId: 'https://gallica.bnf.fr/iiif/ark:/12148/btv1b10022508f/manifest.json', provider: 'Bibliothèque nationale de France' },
{ manifestId: 'https://manifests.britishart.yale.edu/Osbornfa1', provider: 'Beinecke Rare Book and Manuscript Library, Yale University' },
{ manifestId: 'https://iiif.biblissima.fr/chateauroux/B360446201_MS0005/manifest.json', provider: 'Biblissima' },
{ manifestId: 'https://iiif.durham.ac.uk/manifests/trifle/32150/t1/m4/q7/t1m4q77fr328/manifest', provider: 'Durham University Library' },
{
manifestId: 'https://iiif.bodleian.ox.ac.uk/iiif/manifest/e32a277e-91e2-4a6d-8ba6-cc4bad230410.json',
},
{
manifestId: 'https://media.nga.gov/public/manifests/nga_highlights.json',
provider: 'National Gallery of Art',
},
{
manifestId: 'https://wellcomelibrary.org/iiif/b18035723/manifest',
provider: 'Wellcome Library',
},
{
manifestId: 'https://demos.biblissima.fr/iiif/metadata/florus-dispersus/manifest.json',
provider: 'Biblissima',
},
{
manifestId: 'https://www.e-codices.unifr.ch/metadata/iiif/gau-Fragment/manifest.json',
provider: 'e-codices - Virtual Manuscript Library of Switzerland',
},
{
manifestId: 'https://wellcomelibrary.org/iiif/collection/b18031511',
provider: 'Wellcome Library',
},
{
manifestId: 'https://gallica.bnf.fr/iiif/ark:/12148/btv1b10022508f/manifest.json',
provider: 'Bibliothèque nationale de France',
},
{
manifestId: 'https://manifests.britishart.yale.edu/Osbornfa1',
provider: 'Beinecke Rare Book and Manuscript Library, Yale University',
},
{
manifestId: 'https://iiif.biblissima.fr/chateauroux/B360446201_MS0005/manifest.json',
provider: 'Biblissima',
},
{
manifestId: 'https://iiif.durham.ac.uk/manifests/trifle/32150/t1/m4/q7/t1m4q77fr328/manifest',
provider: 'Durham University Library',
},
// { manifestId: "https://iiif.vam.ac.uk/collections/O1023003/manifest.json", provider: "Ocean liners"},
{ manifestId: 'https://zavicajna.digitalna.rs/iiif/iiif/api/presentation/2/4aa44ad1-0b74-4590-ab09-534a38cb7c53%252F00000001%252Fostalo01%252F00000012/manifest', provider: "Библиотека 'Милутин Бојић'" },
{
manifestId:
'https://zavicajna.digitalna.rs/iiif/iiif/api/presentation/2/4aa44ad1-0b74-4590-ab09-534a38cb7c53%252F00000001%252Fostalo01%252F00000012/manifest',
provider: "Библиотека 'Милутин Бојић'",
},
],
id: 'mirador',
language: 'fr',
windows: [{
manifestId: 'https://iiif.io/api/cookbook/recipe/0006-text-language/manifest.json',
showLocalePicker: true,
thumbnailNavigationPosition: 'far-bottom',
}],
windows: [
{
manifestId: 'https://iiif.io/api/cookbook/recipe/0006-text-language/manifest.json',
showLocalePicker: true,
thumbnailNavigationPosition: 'far-bottom',
},
],
};
8 changes: 5 additions & 3 deletions __tests__/integration/mirador-configs/iiif-v3.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ export default {
window: {
hideSearchPanel: false,
},
windows: [{
manifestId: 'https://iiif.bodleian.ox.ac.uk/iiif/manifest/e32a277e-91e2-4a6d-8ba6-cc4bad230410.json',
}],
windows: [
{
manifestId: 'https://iiif.bodleian.ox.ac.uk/iiif/manifest/e32a277e-91e2-4a6d-8ba6-cc4bad230410.json',
},
],
};
75 changes: 55 additions & 20 deletions __tests__/integration/mirador-configs/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,64 @@ import { PRIMARY_CANVAS_FIXTURE_URL, PRIMARY_MANIFEST_FIXTURE_URL } from './cons
export default {
catalog: [
{ manifestId: PRIMARY_MANIFEST_FIXTURE_URL },
{ manifestId: 'https://iiif.bodleian.ox.ac.uk/iiif/manifest/e32a277e-91e2-4a6d-8ba6-cc4bad230410.json' },
{ manifestId: 'https://media.nga.gov/public/manifests/nga_highlights.json', provider: 'National Gallery of Art' },
{ manifestId: 'https://wellcomelibrary.org/iiif/b18035723/manifest', provider: 'Wellcome Library' },
{ manifestId: 'https://demos.biblissima.fr/iiif/metadata/florus-dispersus/manifest.json', provider: 'Biblissima' },
{ manifestId: 'https://www.e-codices.unifr.ch/metadata/iiif/gau-Fragment/manifest.json', provider: 'e-codices - Virtual Manuscript Library of Switzerland' },
{ manifestId: 'https://wellcomelibrary.org/iiif/collection/b18031511', provider: 'Wellcome Library' },
{ manifestId: 'https://gallica.bnf.fr/iiif/ark:/12148/btv1b10022508f/manifest.json', provider: 'Bibliothèque nationale de France' },
{ manifestId: 'https://manifests.britishart.yale.edu/Osbornfa1', provider: 'Beinecke Rare Book and Manuscript Library, Yale University' },
{ manifestId: 'https://iiif.biblissima.fr/chateauroux/B360446201_MS0005/manifest.json', provider: 'Biblissima' },
{ manifestId: 'https://iiif.durham.ac.uk/manifests/trifle/32150/t1/m4/q7/t1m4q77fr328/manifest', provider: 'Durham University Library' },
{ manifestId: 'https://zavicajna.digitalna.rs/iiif/api/presentation/3/96571949-03d6-478e-ab44-a2d5ad68f935%252F00000001%252Fostalo01%252F00000071/manifest', provider: "Библиотека 'Милутин Бојић'" },
{
manifestId: 'https://iiif.bodleian.ox.ac.uk/iiif/manifest/e32a277e-91e2-4a6d-8ba6-cc4bad230410.json',
},
{
manifestId: 'https://media.nga.gov/public/manifests/nga_highlights.json',
provider: 'National Gallery of Art',
},
{
manifestId: 'https://wellcomelibrary.org/iiif/b18035723/manifest',
provider: 'Wellcome Library',
},
{
manifestId: 'https://demos.biblissima.fr/iiif/metadata/florus-dispersus/manifest.json',
provider: 'Biblissima',
},
{
manifestId: 'https://www.e-codices.unifr.ch/metadata/iiif/gau-Fragment/manifest.json',
provider: 'e-codices - Virtual Manuscript Library of Switzerland',
},
{
manifestId: 'https://wellcomelibrary.org/iiif/collection/b18031511',
provider: 'Wellcome Library',
},
{
manifestId: 'https://gallica.bnf.fr/iiif/ark:/12148/btv1b10022508f/manifest.json',
provider: 'Bibliothèque nationale de France',
},
{
manifestId: 'https://manifests.britishart.yale.edu/Osbornfa1',
provider: 'Beinecke Rare Book and Manuscript Library, Yale University',
},
{
manifestId: 'https://iiif.biblissima.fr/chateauroux/B360446201_MS0005/manifest.json',
provider: 'Biblissima',
},
{
manifestId: 'https://iiif.durham.ac.uk/manifests/trifle/32150/t1/m4/q7/t1m4q77fr328/manifest',
provider: 'Durham University Library',
},
{
manifestId:
'https://zavicajna.digitalna.rs/iiif/api/presentation/3/96571949-03d6-478e-ab44-a2d5ad68f935%252F00000001%252Fostalo01%252F00000071/manifest',
provider: "Библиотека 'Милутин Бојић'",
},
],
id: 'mirador',
theme: {
transitions: {},
},
windows: [{
canvasId: PRIMARY_CANVAS_FIXTURE_URL,
manifestId: PRIMARY_MANIFEST_FIXTURE_URL,
},
{
canvasId: 'https://iiif.bodleian.ox.ac.uk/iiif/canvas/e58b8c60-005c-4c41-a22f-07d49cb25ede.json',
manifestId: 'https://iiif.bodleian.ox.ac.uk/iiif/manifest/e32a277e-91e2-4a6d-8ba6-cc4bad230410.json',
thumbnailNavigationPosition: 'far-bottom',
}],
windows: [
{
canvasId: PRIMARY_CANVAS_FIXTURE_URL,
manifestId: PRIMARY_MANIFEST_FIXTURE_URL,
},
{
canvasId: 'https://iiif.bodleian.ox.ac.uk/iiif/canvas/e58b8c60-005c-4c41-a22f-07d49cb25ede.json',
manifestId: 'https://iiif.bodleian.ox.ac.uk/iiif/manifest/e32a277e-91e2-4a6d-8ba6-cc4bad230410.json',
thumbnailNavigationPosition: 'far-bottom',
},
],
};
22 changes: 12 additions & 10 deletions __tests__/integration/mirador-configs/initial-viewer-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,17 @@ import { PRIMARY_MANIFEST_FIXTURE_URL, PRIMARY_CANVAS_FIXTURE_URL } from './cons

export default {
id: 'mirador',
windows: [{
canvasId: PRIMARY_CANVAS_FIXTURE_URL,
initialViewerConfig: {
thumbnailNavigationPosition: 'far-bottom',
x: 934,
y: 782,
// you need to specify zoom for this to look good
zoom: 0.0007,
windows: [
{
canvasId: PRIMARY_CANVAS_FIXTURE_URL,
initialViewerConfig: {
thumbnailNavigationPosition: 'far-bottom',
x: 934,
y: 782,
// you need to specify zoom for this to look good
zoom: 0.0007,
},
manifestId: PRIMARY_MANIFEST_FIXTURE_URL,
},
manifestId: PRIMARY_MANIFEST_FIXTURE_URL,
}],
],
};
28 changes: 20 additions & 8 deletions __tests__/integration/mirador-configs/layers.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,17 @@ export default {
{ manifestId: 'https://prtd.app/aom/manifest.json' },
{ manifestId: 'https://prtd.app/fv/manifest.json' },
{ manifestId: 'https://dvp.prtd.app/hamilton/manifest.json' },
{ manifestId: 'https://iiif.io/api/cookbook/recipe/0036-composition-from-multiple-images/manifest.json' },
{
manifestId: 'https://iiif.io/api/cookbook/recipe/0036-composition-from-multiple-images/manifest.json',
},
{ manifestId: 'https://iiif.io/api/cookbook/recipe/0033-choice/manifest.json' },
{ manifestId: 'https://iiif.bodleian.ox.ac.uk/iiif/manifest/1fc3f35d-bbb5-4524-8fbe-a5bcb5468be2.json' },
{
manifestId: 'https://iiif.bodleian.ox.ac.uk/iiif/manifest/1fc3f35d-bbb5-4524-8fbe-a5bcb5468be2.json',
},
{ manifestId: 'https://data.getty.edu/media/manifest/bayard-custom' },
{ manifestId: 'https://heritage.tudelft.nl/iiif/manifests/ejection-seat-front-side/manifest.json' },
{
manifestId: 'https://heritage.tudelft.nl/iiif/manifests/ejection-seat-front-side/manifest.json',
},
{ manifestId: 'https://iiif.ub.uni-leipzig.de/exp/manifests/layers2/manifest.json' },
],
id: 'mirador',
Expand All @@ -19,23 +25,29 @@ export default {
...options,
headers: {
...options.headers,
Accept: (url.includes('bodleian.ox.ac.uk') && (url.endsWith('/info.json')
? 'application/ld+json;profile=http://iiif.io/api/image/3/context.json'
: 'application/ld+json;profile=http://iiif.io/api/presentation/3/context.json')) || '',
Accept:
(url.includes('bodleian.ox.ac.uk') &&
(url.endsWith('/info.json')
? 'application/ld+json;profile=http://iiif.io/api/image/3/context.json'
: 'application/ld+json;profile=http://iiif.io/api/presentation/3/context.json')) ||
'',
},
}),
],
},
window: {
defaultSideBarPanel: 'layers',
panels: { // Configure which panels are visible in WindowSideBarButtons
panels: {
// Configure which panels are visible in WindowSideBarButtons
layers: true,
search: true,
},
sideBarOpenByDefault: true,
},
windows: [
{ manifestId: 'https://dvp.prtd.app/hamilton/manifest.json' },
{ manifestId: 'https://iiif.io/api/cookbook/recipe/0036-composition-from-multiple-images/manifest.json' },
{
manifestId: 'https://iiif.io/api/cookbook/recipe/0036-composition-from-multiple-images/manifest.json',
},
],
};
Loading
Loading