Closed BeebBenjamin closed 1 year ago
Critical because we need to demo this in December using our own Mirador.
This is ready for testing on a dev branch.
Just checking this on my mirador plugin build. I think https://github.com/bodleian/archiox-mirador-plugin/blob/refactor-into-plugin/src/index.js#L1 should be export archioxMiradorPlugin from './plugins/archiox-mirador-plugin';
(e.g. https://github.com/ProjectMirador/mirador-image-tools/blob/master/src/index.js)
I have changed this, but didn't realise it enforced style like that.
Yeah, you can't have hypens in js variable names - the parser thinks it's the subtraction operator
I think there may be an issue with my webpack configuration. I've got past a few errors building the code: had to add "module": "src/index.js",
to your package.json so webpack could find it, and then started getting loader errors:
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
Firstly on the index.js, which I got past after changing it to:
import _archioxMiradorPlugin from './plugins/archioxMiradorPlugin';
export { _archioxMiradorPlugin as archioxMiradorPlugin };
But now it's giving the same error for this line: https://github.com/bodleian/archiox-mirador-plugin/blob/master/src/plugins/archiox-mirador-plugin/light-normals.js#L10
Any suggestions of changes I should make to my webpack config?
OK it should work with archiox now from branch: https://gitlab.bodleian.ox.ac.uk/digital.bodleian/2.0/mirador_plugins_build/-/tree/archiox-working-as-plugin
All you need to do is change the config in the index.html file to the following:
const config = {
id: 'viewer',
windows: [{
// enable and show the image tools plugin controls
imageToolsEnabled: true,
imageToolsOpen: true,
// open a specific manifest (optional)
manifestId: 'https://gist.githubusercontent.com/BeebBenjamin/ceb7c61c952d47b8dad5849f0d5f7f98/raw/c22e9eeef0fd7b9dc3d10d3c356eaab97f6e9f36/rawl_copperplates_g21.json',
// open a specific canvas (optional)
//canvasId: 'https://iiif.bodleian.ox.ac.uk/iiif/canvas/1dc21f24-43be-4b2e-b03b-feb278af1795.json'
}],
// requests: {
// // Manipulate IIIF HTTP requests (info.json, IIIF presentation manifests, annotations, etc) to add an Accept header so we use our v3 manifests
// preprocessors: [
// (url, options) => ({...options,
// headers: {
// ...options.headers,
// Accept: 'application/ld+json;profile="http://iiif.io/api/presentation/3/context.json"'
// }
// })
// ],
// },
theme: {
palette: {
primary: {
main: '#1967d2',
},
},
},
};
I can't get the plugin to build/run correctly - have added an issue in the plugin build repo with more details.
I'm also not sure that https://github.com/bodleian/archiox-mirador-plugin/blob/master/src/index.js makes sense for a plugin
That is the master branch, we haven't merged the changes in yet.
Oops, wrong branch, sorry. I was testing on the qa branch for the build/run, though
Structure of the plugin needs changing so that it can be actually used as a plugin i.e. downloaded from a repo and installed into a Mirador 3 instance. At the moment everything including Mirador 3 is bundled into one repository.