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

Use vite to replace webpack etc #3985

Draft
wants to merge 10 commits into
base: master
Choose a base branch
from
Draft
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"default-param-last": "off",
"arrow-parens": "off",
"import/no-anonymous-default-export": "off",
"import/no-extraneous-dependencies": "off",
"max-len": ["error", {
"code": 120,
"ignoreComments": true,
Expand Down
4 changes: 2 additions & 2 deletions __tests__/integration/mirador/auth.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
</head>
<body>
<div id="mirador" style="position: absolute; top: 0; bottom: 0; left: 0; right: 0;"></div>
<script>document.write("<script type='text/javascript' src='../../../dist/mirador.min.js?v=" + Date.now() + "'><\/script>");</script>
<script type="text/javascript">
<script type="module">
import Mirador from '../../../src/index.js';
var miradorInstance = Mirador.viewer({
id: 'mirador',
windows: [
Expand Down
4 changes: 2 additions & 2 deletions __tests__/integration/mirador/blank.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
</head>
<body>
<div id="mirador" style="position: absolute; top: 0; bottom: 0; left: 0; right: 0;"></div>
<script>document.write("<script type='text/javascript' src='../../../dist/mirador.min.js?v=" + Date.now() + "'><\/script>");</script>
<script type="text/javascript">
<script type="module">
import Mirador from '../../../src/index.js';
var miradorInstance = Mirador.viewer({
id: 'mirador',
windows: [],
Expand Down
4 changes: 2 additions & 2 deletions __tests__/integration/mirador/collections.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
</head>
<body>
<div id="mirador" style="position: absolute; top: 0; bottom: 0; left: 0; right: 0;"></div>
<script>document.write("<script type='text/javascript' src='../../../dist/mirador.min.js?v=" + Date.now() + "'><\/script>");</script>
<script type="text/javascript">
<script type="module">
import Mirador from '../../../src/index.js';
var miradorInstance = Mirador.viewer({
id: 'mirador',
windows: [
Expand Down
4 changes: 2 additions & 2 deletions __tests__/integration/mirador/contentsearch.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
</head>
<body>
<div id="mirador" style="position: absolute; top: 0; bottom: 0; left: 0; right: 0;"></div>
<script>document.write("<script type='text/javascript' src='../../../dist/mirador.min.js?v=" + Date.now() + "'><\/script>");</script>
<script type="text/javascript">
<script type="module">
import Mirador from '../../../src/index.js';
var miradorInstance = Mirador.viewer({
id: 'mirador',
windows: [{
Expand Down
4 changes: 2 additions & 2 deletions __tests__/integration/mirador/embedding.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ <h1>This is the first instance</h1>
<div id="instanceOne"></div>
<h1>And this is the second instance</h1>
<div id="instanceTwo"></div>
<script>document.write("<script type='text/javascript' src='../../../dist/mirador.min.js?v=" + Date.now() + "'><\/script>");</script>
<script type="text/javascript">
<script type="module">
import Mirador from '../../../src/index.js';
var miradorInstanceOne = Mirador.viewer({
id: 'instanceOne',
windows: [{
Expand Down
92 changes: 48 additions & 44 deletions __tests__/integration/mirador/index.html
Original file line number Diff line number Diff line change
@@ -1,46 +1,50 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="theme-color" content="#000000">
<title>Mirador</title>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500">
</head>
<body>
<div id="mirador" style="position: absolute; top: 0; bottom: 0; left: 0; right: 0;"></div>
<script>document.write("<script type='text/javascript' src='../../../dist/mirador.min.js?v=" + Date.now() + "'><\/script>");</script>
<script type="text/javascript">
var miradorInstance = Mirador.viewer({
id: 'mirador',
theme: {
transitions: window.location.port === '4488' ? { create: () => 'none' } : {},
},
windows: [{
manifestId: 'https://iiif.harvardartmuseums.org/manifests/object/299843',
canvasId: 'https://iiif.harvardartmuseums.org/manifests/object/299843/canvas/canvas-47174892',
thumbnailNavigationPosition: 'far-bottom',
},
{
manifestId: 'https://iiif.bodleian.ox.ac.uk/iiif/manifest/e32a277e-91e2-4a6d-8ba6-cc4bad230410.json',
}],
catalog: [
{ manifestId: 'https://iiif.bodleian.ox.ac.uk/iiif/manifest/e32a277e-91e2-4a6d-8ba6-cc4bad230410.json' },
{ manifestId: 'https://iiif.harvardartmuseums.org/manifests/object/299843' },
{ manifestId: "https://media.nga.gov/public/manifests/nga_highlights.json", provider: "National Gallery of Art"},
{ manifestId: "https://data.ucd.ie/api/img/manifests/ucdlib:33064", provider: "Irish Architectural Archive"},
{ 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/api/presentation/3/96571949-03d6-478e-ab44-a2d5ad68f935%252F00000001%252Fostalo01%252F00000071/manifest", provider: "Библиотека 'Милутин Бојић'"},
]
});
</script>
</body>
</html>

<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="theme-color" content="#000000">
<title>Mirador</title>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500">
</head>

<body>
<div id="mirador" style="position: absolute; top: 0; bottom: 0; left: 0; right: 0;"></div>

<script type="module">
import Mirador from '../../../src/index.js';
var miradorInstance = Mirador.viewer({
id: 'mirador',
theme: {
transitions: window.location.port === '4488' ? { create: () => 'none' } : {},
},
windows: [{
manifestId: 'https://iiif.harvardartmuseums.org/manifests/object/299843',
canvasId: 'https://iiif.harvardartmuseums.org/manifests/object/299843/canvas/canvas-47174892',
thumbnailNavigationPosition: 'far-bottom',
},
{
manifestId: 'https://iiif.bodleian.ox.ac.uk/iiif/manifest/e32a277e-91e2-4a6d-8ba6-cc4bad230410.json',
}],
catalog: [
{ manifestId: 'https://iiif.bodleian.ox.ac.uk/iiif/manifest/e32a277e-91e2-4a6d-8ba6-cc4bad230410.json' },
{ manifestId: 'https://iiif.harvardartmuseums.org/manifests/object/299843' },
{ manifestId: "https://media.nga.gov/public/manifests/nga_highlights.json", provider: "National Gallery of Art" },
{ manifestId: "https://data.ucd.ie/api/img/manifests/ucdlib:33064", provider: "Irish Architectural Archive" },
{ 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/api/presentation/3/96571949-03d6-478e-ab44-a2d5ad68f935%252F00000001%252Fostalo01%252F00000071/manifest", provider: "Библиотека 'Милутин Бојић'" },
]
});
</script>
</body>

</html>
4 changes: 2 additions & 2 deletions __tests__/integration/mirador/layers.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
</head>
<body>
<div id="mirador" style="position: absolute; top: 0; bottom: 0; left: 0; right: 0;"></div>
<script>document.write("<script type='text/javascript' src='../../../dist/mirador.min.js?v=" + Date.now() + "'><\/script>");</script>
<script type="text/javascript">
<script type="module">
import Mirador from '../../../src/index.js';
var miradorInstance = Mirador.viewer({
id: 'mirador',
windows: [{
Expand Down
4 changes: 2 additions & 2 deletions __tests__/integration/mirador/level0.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
</head>
<body>
<div id="mirador" style="position: absolute; top: 0; bottom: 0; left: 0; right: 0;"></div>
<script>document.write("<script type='text/javascript' src='../../../dist/mirador.min.js?v=" + Date.now() + "'><\/script>");</script>
<script type="text/javascript">
<script type="module">
import Mirador from '../../../src/index.js';
var miradorInstance = Mirador.viewer({
id: 'mirador',
windows: [
Expand Down
4 changes: 2 additions & 2 deletions __tests__/integration/mirador/minimalist.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
</head>
<body>
<div id="mirador" style="position: absolute; top: 0; bottom: 0; left: 0; right: 0;"></div>
<script>document.write("<script type='text/javascript' src='../../../dist/mirador.min.js?v=" + Date.now() + "'><\/script>");</script>
<script type="text/javascript">
<script type="module">
import Mirador from '../../../src/index.js';
var miradorInstance = Mirador.viewer({
id: 'mirador',
theme: {
Expand Down
105 changes: 15 additions & 90 deletions __tests__/integration/mirador/plugins/add.html
Original file line number Diff line number Diff line change
@@ -1,95 +1,20 @@
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="theme-color" content="#000000">
<title>Mirador</title>
</head>
<body>
<div id="mirador" style="position: absolute; top: 0; bottom: 0; left: 0; right: 0;"></div>
<script src="../../../../node_modules/react/umd/react.development.js"></script>
<script src="../../../../node_modules/react-dom/umd/react-dom.development.js"></script>
<script>document.write("<script type='text/javascript' src='../../../../dist/mirador.min.js?v=" + Date.now() + "'><\/script>");</script>
<script src="https://unpkg.com/babel-standalone@6/babel.min.js"></script>
<script type="text/babel">

const config = { id: 'mirador', windows: [{manifestId: 'https://purl.stanford.edu/hg676jb4964/iiif/manifest'}] };
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="theme-color" content="#000000">
<title>Mirador</title>
</head>

<body>
<div id="mirador" style="position: absolute; top: 0; bottom: 0; left: 0; right: 0;"></div>
<script type="module">
import Mirador from '../../../../src/index.js';
import settings from './mirador_configs/add.js';
const miradorInstance = Mirador.viewer(settings.config, settings.plugins);
</script>
</body>

const AddPluginComponentA = (props) => (
<div id="add-plugin-component-a">
Plugin A
</div>
);

const AddPluginComponentB = (props) => (
<div id="add-plugin-component-b">
Plugin B
</div>
);

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

const CustomIcon = () => (
<svg className="umbrella" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32" aria-labelledby="title">
<title id="title">Umbrella Icon</title>
<path d="M27 14h5c0-1.105-1.119-2-2.5-2s-2.5 0.895-2.5 2v0zM27 14c0-1.105-1.119-2-2.5-2s-2.5 0.895-2.5 2c0-1.105-1.119-2-2.5-2s-2.5 0.895-2.5 2v0 14c0 1.112-0.895 2-2 2-1.112 0-2-0.896-2-2.001v-1.494c0-0.291 0.224-0.505 0.5-0.505 0.268 0 0.5 0.226 0.5 0.505v1.505c0 0.547 0.444 0.991 1 0.991 0.552 0 1-0.451 1-0.991v-14.009c0-1.105-1.119-2-2.5-2s-2.5 0.895-2.5 2c0-1.105-1.119-2-2.5-2s-2.5 0.895-2.5 2c0-1.105-1.119-2-2.5-2s-2.5 0.895-2.5 2c0-5.415 6.671-9.825 15-9.995v-1.506c0-0.283 0.224-0.499 0.5-0.499 0.268 0 0.5 0.224 0.5 0.499v1.506c8.329 0.17 15 4.58 15 9.995h-5z"/>
</svg>
);

const WrapPluginComponent = (plugin) => {
return (
<div id='wrapped-plugin-with-adds'>
<plugin.TargetComponent menuIcon={<CustomIcon/>} {...plugin.targetProps} {...plugin} />
</div>
)
}

const AddPluginComponentE = (props) => (
<div id="add-plugin-component-e">
<input value="hello world"/>
</div>
);

const addPluginA = {
target: 'WorkspaceControlPanelButtons',
mode: 'add',
config: {
foo: 'bar',
},
component: <AddPluginComponentA />,
};

const addPluginB = {
target: 'WorkspaceControlPanelButtons',
mode: 'add',
component: AddPluginComponentB,
};

const addPluginC = {
target: 'WindowTopBarPluginMenu',
mode: 'add',
component: AddPluginComponentC,
};

const wrapPluginD = {
target: 'WindowTopBarPluginMenu',
mode: 'wrap',
component: WrapPluginComponent,
};

const addPluginE = {
target: 'WindowTopBarPluginArea',
mode: 'add',
component: AddPluginComponentE,
};

const miradorInstance = Mirador.viewer(config, [[addPluginA, addPluginB], addPluginC, wrapPluginD, addPluginE]);

</script>
</body>
</html>
17 changes: 0 additions & 17 deletions __tests__/integration/mirador/plugins/add.test.js

This file was deleted.

45 changes: 0 additions & 45 deletions __tests__/integration/mirador/plugins/companionWindow.html

This file was deleted.

16 changes: 0 additions & 16 deletions __tests__/integration/mirador/plugins/companionWindow.test.js

This file was deleted.

Loading
Loading