dbf-mirador 4.3.0-testing3 → 4.3.0-testing4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -2,6 +2,19 @@
2
2
 
3
3
  We forked the original Mirador project to create a version that is compatible with the DBF Map project. This version of Mirador is designed to work seamlessly with the DBF Map platform, providing users with an enhanced experience for viewing and interacting with digital content. More detail about the original Mirador project can be found [here](https://github.com/ProjectMirador/mirador). This readme will cover only minimal information about the original Mirador project and will focus on the changes made to support the DBF Map project.
4
4
 
5
+ We provided a ready to use component called `MapViewer` See below for more details.
6
+
7
+ <!-- TOC -->
8
+ * [DBF Map Mirador](#dbf-map-mirador)
9
+ * [Running Mirador locally for development](#running-mirador-locally-for-development)
10
+ * [Install Mirador inside your project](#install-mirador-inside-your-project-)
11
+ * [`MapViewer` component](#mapviewer-component)
12
+ * [Mirador](#mirador)
13
+ * [Running the tests](#running-the-tests)
14
+ * [Linting the project](#linting-the-project)
15
+ <!-- TOC -->
16
+
17
+
5
18
  ## Running Mirador locally for development
6
19
 
7
20
  Mirador local development requires [nodejs](https://nodejs.org/en/download/) to be installed.
@@ -11,12 +24,9 @@ git clone git@github.com:AlMadar-Digital/map-mirador.git
11
24
  cd map-mirador
12
25
  npm install
13
26
 
27
+ npm start
14
28
  ```
15
- Then run the following command to start a local development server:
16
29
 
17
- ```sh
18
- $ npm start
19
- ```
20
30
 
21
31
  Then navigate to [http://127.0.0.1:4444/](http://127.0.0.1:4444/)
22
32
 
@@ -28,21 +38,33 @@ Then navigate to [http://127.0.0.1:4444/](http://127.0.0.1:4444/)
28
38
  $ npm install dbf-mirador
29
39
  ```
30
40
 
31
- ### Mirador
41
+ ### `MapViewer` component
32
42
 
33
- Check the demo folder TODO
43
+ For consumers that just want to render a manifest as a map - without learning Mirador's own
44
+ config/plugin API - `MapViewer` is a React component that wraps `Mirador.viewer()` with a
45
+ preset config (annotation sidebar open by default, window chrome hidden, single-window
46
+ layout). The only required prop is the manifest URL:
34
47
 
35
- ### Instantiating Mirador
48
+ Here the manifestId correspond to the manifest endpoint from the map object provided by Strapi. This endpoint provides the map data as a IIIF manifest.
49
+ You can use the following code snippet to render a map in your React application.
36
50
 
37
- ```javascript
38
- var miradorInstance = Mirador.viewer({
39
- id: 'mirador' // id selector where Mirador should be instantiated
40
- });
51
+ ```jsx
52
+ import { MapViewer } from 'dbf-mirador';
41
53
 
42
- > miradorInstance
43
- { actions, store }
54
+ function App() {
55
+ return <MapViewer manifestId="https://files.tetras-libre.fr/dev/dbf/mapnile.json" />;
56
+ }
44
57
  ```
45
58
 
59
+ Run `npm start` and open `localhost:4444/demo/map-viewer.html` to see it live.
60
+
61
+ ### Mirador
62
+
63
+ Check the `demo` folder for runnable examples, including `demo/index.html` (raw
64
+ `Mirador.viewer()` usage), `demo/map-viewer.html` (the `MapViewer` component below) and
65
+ `demo/map-editor.html` (the map preset plus `dbf-mirador-annotation-editor`, so POIs and
66
+ journeys can be created/edited against browser-local storage with no backend).
67
+
46
68
 
47
69
  ## Running the tests
48
70
  We use Vitest to run our test suite.