# Islandora Mirador Annotations Standalone Drupal add-on for `islandora_mirador` that adds persistent Mirador 4 annotations using Mirador Annotation Editor (MAE). ## Features - Leaves the base `islandora_mirador` module untouched. - Drupal-backed persistent Web Annotations. - Existing MAE per-canvas annotation editor/sidebar. - **All annotations** sidebar for multi-page manifests. - All-annotations results are grouped by canvas/page label and searchable. - Clicking an annotation in the all-annotations panel jumps Mirador to that canvas. - A single Drupal query loads annotations for the complete manifest; it does not make one Drupal request per page. ## Architecture This module alters the base viewer library dependency so the viewer loads this module's annotated Mirador bundle. The bundle contains Mirador, the normal Islandora image-tools/text-overlay/download plugins, MAE, a Drupal persistence adapter, and the All Annotations companion-window plugin. MAE's incompatible `annotationSagaPlugin` is excluded and its canvas-loading behavior is replaced locally. ## Install ```bash drush en islandora_mirador_annotations -y drush cr ``` Grant `view mirador annotations` to roles that may see annotations and `manage mirador annotations` to roles that may create/edit/delete them. ## Build assets ```bash cd build npm install npm run build ``` Vite writes: ```text dist/main.js dist/main.css ``` Both compiled files should be committed to the module repository so Composer users do not need Node/npm/Vite. ## Endpoints Current-canvas AnnotationPage: ```text GET /islandora-mirador/annotations?canvas= ``` Manifest-wide read endpoint used by the All Annotations panel: ```text POST /islandora-mirador/annotations/manifest Content-Type: application/json {"canvasIds":["https://.../canvas/1","https://.../canvas/2"]} ``` Annotation writes use POST/PATCH/DELETE on `/islandora-mirador/annotations` and are protected by Drupal permissions and `X-CSRF-Token`. ## All annotations click-to-focus Selecting an entry in the **All annotations** panel switches to its canvas, selects the Mirador annotation so its target is highlighted, and, when the annotation contains an `xywh` FragmentSelector, zooms OpenSeadragon to that region with a small amount of padding. Both pixel and percent `xywh` selectors are supported. ### 0.2.5 annotation targeting The All Annotations panel uses the Web Annotation `target.source` as the authoritative canvas when it differs from the persistence row's canvas id. It also zooms to MAE `SvgSelector` geometry when an `xywh` FragmentSelector is not available.