# Islandora Mirador Annotations Standalone Drupal add-on for `islandora_mirador` that adds persistent Mirador 4 annotations using Mirador Annotation Editor (MAE). ## Architecture The base `islandora_mirador` module is not patched. This module: 1. Alters the base viewer library dependency so the viewer loads this module's annotated Mirador bundle. 2. Builds that bundle from the same Mirador 4 plugins used by Islandora plus MAE. 3. Excludes MAE's currently incompatible `annotationSagaPlugin` and replaces only its annotation-loading behavior. 4. Adds a Drupal-backed MAE adapter. 5. Stores each Web Annotation as JSON in `islandora_mirador_annotation`. 6. Exposes an IIIF `AnnotationPage` at `/islandora-mirador/annotations?canvas=...`. 7. Protects POST/PATCH/DELETE with Drupal permissions and `X-CSRF-Token`. ## Install Place this directory next to `islandora_mirador`, then enable it: ```bash drush en islandora_mirador_annotations -y drush cr ``` Grant permissions as appropriate. For example, to let anonymous and authenticated users see annotations, grant `view mirador annotations` to those roles. Grant `manage mirador annotations` only to roles that may create/edit/delete annotations. The module automatically sets MAE to read-only when the current user does not have `manage mirador annotations`. ## Build `dist/main.js` The build project is retained under `build/`. ```bash cd build npm install npm run build ``` Vite writes the bundle to `../dist/main.js`. The bundle intentionally contains Mirador itself, the Islandora image-tools/text-overlay/download plugins, and MAE in one dependency graph. This avoids loading a second React/MUI runtime beside the base Mirador bundle. ## Base module No changes to `islandora_mirador` are required. When this module is disabled, the base viewer returns to its normal `islandora_mirador/mirador` dependency after a cache rebuild. ## Endpoint GET: ```text /islandora-mirador/annotations?canvas= ``` returns: ```json { "id": "...", "type": "AnnotationPage", "items": [] } ``` MAE writes through the same endpoint using POST, PATCH, and DELETE.