diff --git a/CHANGELOG.md b/CHANGELOG.md index 9473961..f99ae57 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) ## [Unreleased] +### Added + +- Added `canvasId` as parameter of `handleCanvasLabel` + ## [0.2.0](https://github.com/dbmdz/mirador-canvasnavigation/releases/tag/0.2.0) - 2024-01-26 ### Added diff --git a/README.md b/README.md index 542dcbc..14b0ed1 100644 --- a/README.md +++ b/README.md @@ -65,6 +65,7 @@ The available settings are: Receives this information about the current window: ``` { + canvasId: ..., canvasLabel: ..., currentCanvasIndex: ..., manifestId: ..., diff --git a/src/components/WindowCanvasNavigationControls.jsx b/src/components/WindowCanvasNavigationControls.jsx index d1967b3..6d237ab 100644 --- a/src/components/WindowCanvasNavigationControls.jsx +++ b/src/components/WindowCanvasNavigationControls.jsx @@ -112,6 +112,7 @@ const useStyles = makeStyles((theme) => ({ })); const WindowCanvasNavigationControls = ({ + canvasId, canvasLabel, config: { handleCanvasLabel = (lbl) => lbl }, currentCanvasIndex, @@ -141,6 +142,7 @@ const WindowCanvasNavigationControls = ({ setPendingCanvasIdx(undefined); }; const canvasLbl = handleCanvasLabel({ + canvasId, canvasLabel, currentCanvasIndex, manifestId, @@ -245,6 +247,7 @@ const WindowCanvasNavigationControls = ({ }; WindowCanvasNavigationControls.propTypes = { + canvasId: PropTypes.string.isRequired, canvasLabel: PropTypes.string.isRequired, config: PropTypes.shape({ handleCanvasLabel: PropTypes.func, diff --git a/src/index.js b/src/index.js index 1d2eb56..baee55e 100644 --- a/src/index.js +++ b/src/index.js @@ -45,6 +45,7 @@ export default [ const canvases = getCanvases(state, { windowId }); const canvasId = (getCurrentCanvas(state, { windowId }) || {}).id; return { + canvasId, canvasLabel: getCanvasLabel(state, { canvasId, windowId,