From 7ee770e01da94e232c87e9e9fdb464210933319a Mon Sep 17 00:00:00 2001 From: Fabian Stoehr Date: Mon, 8 Jan 2024 15:21:57 +0100 Subject: [PATCH 001/131] chore: remove unused paramater of maximizeWindow action --- src/state/actions/window.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/state/actions/window.js b/src/state/actions/window.js index e4f840bbbf..e7ed508e11 100644 --- a/src/state/actions/window.js +++ b/src/state/actions/window.js @@ -112,7 +112,7 @@ export function updateWindow(id, payload) { * @param {String} windowId * @memberof ActionCreators */ -export function maximizeWindow(windowId, layout) { +export function maximizeWindow(windowId) { return { type: ActionTypes.MAXIMIZE_WINDOW, windowId }; } From f0c6ff1ff1f1fcd4ae6321bb7abf0ae4b4c51e4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gerd=20M=C3=BCller?= Date: Thu, 6 Jun 2024 17:47:47 +0200 Subject: [PATCH 002/131] Fix Japanese Translation --- src/locales/ja/translation.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/locales/ja/translation.json b/src/locales/ja/translation.json index 296ba2420a..c5fc2630c7 100644 --- a/src/locales/ja/translation.json +++ b/src/locales/ja/translation.json @@ -3,8 +3,8 @@ "aboutMirador": "Project Miradorについて", "aboutThisItem": "この資料について", "addedFromUrl": "(URLで追加)", - "addManifestUrl": "資料のURL", - "addManifestUrlHelp": "IIIF資料のURL", + "addManifestUrl": "資料のIIIFマニフェストURI", + "addManifestUrlHelp": "追加したいIIIF資料のURIを上記に入力してください", "addResource": "資料の追加", "annotationCanvasLabel_1/1": "アイテム: [{{label}}]", "annotationCanvasLabel_1/2": "左: [{{label}}]", From 714282c7b0af354d1d418c213a575626889f1a66 Mon Sep 17 00:00:00 2001 From: Fabian Stoehr Date: Wed, 26 Jun 2024 13:27:56 +0200 Subject: [PATCH 003/131] fix: preservation of viewport doesnt work --- src/components/OpenSeadragonViewer.js | 6 +++++- src/state/actions/canvas.js | 3 +++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/components/OpenSeadragonViewer.js b/src/components/OpenSeadragonViewer.js index 120aba5151..9d93a1b6a9 100644 --- a/src/components/OpenSeadragonViewer.js +++ b/src/components/OpenSeadragonViewer.js @@ -118,7 +118,11 @@ export class OpenSeadragonViewer extends Component { ) { viewer.close(); const canvasesChanged = !(isEqual(canvasWorld.canvasIds, prevProps.canvasWorld.canvasIds)); - this.addAllImageSources((canvasesChanged || !viewerConfig)); + if (canvasesChanged && viewer.preserveViewport) { + this.addAllImageSources(false); + } else { + this.addAllImageSources((canvasesChanged || !viewerConfig)); + } } else if (!isEqual(canvasWorld.layers, prevProps.canvasWorld.layers)) { this.refreshTileProperties(); } else if (viewerConfig && !this.osdUpdating) { diff --git a/src/state/actions/canvas.js b/src/state/actions/canvas.js index 45dd9a4349..6ce6ceba5f 100644 --- a/src/state/actions/canvas.js +++ b/src/state/actions/canvas.js @@ -3,6 +3,7 @@ import { getNextCanvasGrouping, getPreviousCanvasGrouping, getCanvasGrouping, + getConfig, } from '../selectors'; /** @@ -15,6 +16,7 @@ import { export function setCanvas(windowId, canvasId, newGroup = undefined, options = {}) { return ((dispatch, getState) => { const state = getState(); + const { preserveViewport } = getConfig(state).osdConfig; let visibleCanvases = newGroup; if (!visibleCanvases) { @@ -25,6 +27,7 @@ export function setCanvas(windowId, canvasId, newGroup = undefined, options = {} dispatch({ ...options, canvasId, + preserveViewport, type: ActionTypes.SET_CANVAS, visibleCanvases, windowId, From 50de431791f9b41a9d4e5a7c56c1e0d1f1bbd3d4 Mon Sep 17 00:00:00 2001 From: Fabian Stoehr Date: Wed, 26 Jun 2024 15:48:05 +0200 Subject: [PATCH 004/131] test: mock getConfig for canvas test --- __tests__/src/actions/canvas.test.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/__tests__/src/actions/canvas.test.js b/__tests__/src/actions/canvas.test.js index fead977eed..389475e657 100644 --- a/__tests__/src/actions/canvas.test.js +++ b/__tests__/src/actions/canvas.test.js @@ -9,6 +9,10 @@ const mockStore = configureMockStore(middlewares); jest.mock('../../../src/state/selectors', () => ({ getCanvasGrouping: (state, { canvasId }) => [{ id: canvasId }], + getConfig: jest.fn((state) => { + const osdConfig = { osdConfig: { preserveViewport: true } }; + return osdConfig; + }), getNextCanvasGrouping: () => [{ id: 'canvasIndex-2' }], getPreviousCanvasGrouping: () => [{ id: 'canvasIndex-0' }], })); @@ -24,6 +28,7 @@ describe('canvas actions', () => { const id = 'abc123'; const expectedAction = { canvasId: 'a', + preserveViewport: true, type: ActionTypes.SET_CANVAS, visibleCanvases: ['a'], windowId: id, @@ -42,6 +47,7 @@ describe('canvas actions', () => { const id = 'abc123'; const expectedAction = { canvasId: 'canvasIndex-0', + preserveViewport: true, type: ActionTypes.SET_CANVAS, visibleCanvases: ['canvasIndex-0'], windowId: id, @@ -60,6 +66,7 @@ describe('canvas actions', () => { const id = 'abc123'; const expectedAction = { canvasId: 'canvasIndex-2', + preserveViewport: true, type: ActionTypes.SET_CANVAS, visibleCanvases: ['canvasIndex-2'], windowId: id, From f6b9ba79f5f60421737fa4e18f082741426f837d Mon Sep 17 00:00:00 2001 From: Fabian Stoehr Date: Tue, 9 Jul 2024 08:32:50 +0200 Subject: [PATCH 005/131] add comments --- src/components/OpenSeadragonViewer.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/components/OpenSeadragonViewer.js b/src/components/OpenSeadragonViewer.js index 9d93a1b6a9..d7fa4d10e6 100644 --- a/src/components/OpenSeadragonViewer.js +++ b/src/components/OpenSeadragonViewer.js @@ -119,8 +119,10 @@ export class OpenSeadragonViewer extends Component { viewer.close(); const canvasesChanged = !(isEqual(canvasWorld.canvasIds, prevProps.canvasWorld.canvasIds)); if (canvasesChanged && viewer.preserveViewport) { + // Do not reset the zoom after add this.addAllImageSources(false); } else { + // Reset the zoom if the canvas has changed or if there is no viewerConfig this.addAllImageSources((canvasesChanged || !viewerConfig)); } } else if (!isEqual(canvasWorld.layers, prevProps.canvasWorld.layers)) { From 891005093cb46522816bc036a77a2258423d2367 Mon Sep 17 00:00:00 2001 From: veesalu <160580986+veesalu@users.noreply.github.com> Date: Thu, 25 Jul 2024 20:52:45 +0300 Subject: [PATCH 006/131] Update translation.json Removed accidental comma from line 114. --- src/locales/et/translation.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/locales/et/translation.json b/src/locales/et/translation.json index 2742a79511..68cc843f4d 100755 --- a/src/locales/et/translation.json +++ b/src/locales/et/translation.json @@ -111,7 +111,7 @@ "previewWindowTitle": "{{title}}", "previousCanvas": "Eelmine lõuend", "related": "Seotud", - "resource": "Teos,", + "resource": "Teos", "retry": "Proovi uuesti", "right": "Parem", "rights": "Kasutuslitsents", From 52561eaf5ae7f79528b543a856d619c91e00c267 Mon Sep 17 00:00:00 2001 From: Hrvoje Date: Wed, 28 Aug 2024 14:11:27 +0200 Subject: [PATCH 007/131] Create translation.json --- src/locales/hr/translation.json | 165 ++++++++++++++++++++++++++++++++ 1 file changed, 165 insertions(+) create mode 100644 src/locales/hr/translation.json diff --git a/src/locales/hr/translation.json b/src/locales/hr/translation.json new file mode 100644 index 0000000000..8b2bc085f7 --- /dev/null +++ b/src/locales/hr/translation.json @@ -0,0 +1,165 @@ +{ + "translation": { + "aboutMirador": "About Project Mirador", + "aboutThisItem": "About this item", + "addedFromUrl": "(Added from URL)", + "addManifestUrl": "Resource location", + "addManifestUrlHelp": "The URL of a IIIF resource", + "addResource": "Add resource", + "annotationCanvasLabel_1/1": "Item: [{{label}}]", + "annotationCanvasLabel_1/2": "Left: [{{label}}]", + "annotationCanvasLabel_2/2": "Right: [{{label}}]", + "annotations": "Annotations", + "attribution": "Attribution", + "attributionTitle": "Rights", + "authenticationFailed": "Authentication failed.", + "authenticationRequired": "Authentication required for full access", + "backToResults": "Back to results", + "book": "Book", + "bottom": "Bottom", + "cancel": "Cancel", + "canvasIndex": "Index", + "changeTheme": "Change theme", + "clearSearch": "clear", + "close": "Close", + "closeAddResourceForm": "Close form", + "closeAddResourceMenu": "Close resource list", + "closeCompanionWindow": "Close panel", + "closeWindow": "Close window", + "collapseSection": "Collapse \"{{section}}\" section", + "collapseSidePanel": "Collapse sidebar", + "collection": "Collection", + "continue": "Continue", + "copy": "Copy", + "currentItem": "Current item", + "currentItem_1/1": "Current item", + "currentItem_1/2": "Left", + "currentItem_2/2": "Right", + "dark": "Dark theme", + "digitizedView": "Digitized view", + "dismiss": "Dismiss", + "displayNoAnnotations": "Highlight none", + "downloadExport": "Export workspace", + "downloadExportWorkspace": "Export workspace", + "elastic": "Elastic", + "elasticDescription": "Move and size windows freely in an unlimited workspace. Windows can overlap.", + "emptyResourceList": "Your resource list is empty", + "error": "Error", + "errorDialogConfirm": "OK", + "errorDialogTitle": "An error occurred", + "exitFullScreen": "Exit full screen", + "expandSection": "Expand \"{{section}}\" section", + "expandSidePanel": "Expand sidebar", + "exportCopied": "The workspace configuration was copied to your clipboard", + "fetchManifest": "Add", + "fullScreen": "Full Screen", + "gallery": "Gallery", + "hideZoomControls": "Hide zoom controls", + "highlightAllAnnotations": "Highlight all", + "iiif_homepage": "About this resource", + "iiif_manifest": "IIIF manifest", + "iiif_related": "Related", + "iiif_renderings": "Alternate formats", + "iiif_seeAlso": "See also", + "import": "Import", + "importWorkspace": "Import workspace", + "importWorkspaceHint": "Paste a Mirador 3 configuration to be imported", + "item": "Item: {{label}}", + "itemList": "Item list", + "jsError": "Technical details", + "jsStack": "{{ stack }}", + "language": "Language", + "layer_hide": "Hide layer", + "layer_move": "Move layer", + "layer_moveToTop": "Move layer to top", + "layer_opacity": "Layer opacity", + "layer_show": "Show layer", + "layers": "Layers", + "light": "Light theme", + "links": "Links", + "listAllOpenWindows": "Jump to window", + "login": "Log in", + "logout": "Log out", + "manifestError": "The resource cannot be added:", + "maximizeWindow": "Maximize window", + "minimizeWindow": "Minimize window", + "mirador": "Mirador", + "miradorResources": "Mirador resources", + "miradorViewer": "Mirador viewer", + "more": "more...", + "moreResults": "More results", + "mosaic": "Mosaic", + "mosaicDescription": "Move and size windows in relation to each other, within the visible frame.", + "moveCompanionWindowToBottom": "Move to bottom", + "moveCompanionWindowToRight": "Move to right", + "multipartCollection": "Multipart Collection", + "nextCanvas": "Next item", + "noItemSelected": "No item selected", + "numItems_one": "{{number}} item", + "numItems_other": "{{number}} items", + "off": "Off", + "openCompanionWindow_annotations": "Annotations", + "openCompanionWindow_attribution": "Rights", + "openCompanionWindow_canvas": "Index", + "openCompanionWindow_info": "Information", + "openCompanionWindow_layers": "Layers", + "openCompanionWindow_search": "Search", + "openInCompanionWindow": "Open in separate panel", + "openWindows": "Current open windows", + "pagination": "{{current}} of {{total}}", + "position": "Position", + "previewWindowTitle": "{{title}}", + "previousCanvas": "Previous item", + "related": "Related", + "resource": "Resource", + "retry": "Retry", + "right": "Right", + "rights": "License", + "scroll": "Scroll", + "searchInputLabel": "search terms", + "searchNextResult": "Next result", + "searchNoResults": "No results found", + "searchPreviousResult": "Previous result", + "searchResultsRemaining": "{{numLeft}} remaining", + "searchSubmitAria": "Submit search", + "searchTitle": "Search", + "selectWorkspaceMenu": "Select workspace type", + "showCollection": "Show collection", + "showingNumAnnotations_one": "Showing {{number}} annotation", + "showingNumAnnotations_other": "Showing {{number}} annotations", + "showZoomControls": "Show zoom controls", + "sidebarPanelsNavigation": "Sidebar panels navigation", + "single": "Single", + "startHere": "Start Here", + "suggestSearch": "Search this document for \"{{ query }}\"", + "tableOfContentsList": "Table of contents", + "theme": "Theme", + "thumbnailList": "Thumbnail list", + "thumbnailNavigation": "Thumbnails", + "thumbnails": "Thumbnails", + "toggleWindowSideBar": "Toggle sidebar", + "totalCollections_one": "{{count}} collection", + "totalCollections_other": "{{count}} collections", + "totalManifests_one": "{{count}} manifest", + "totalManifests_other": "{{count}} manifests", + "tryAgain": "Try again", + "untitled": "[Untitled]", + "view": "View", + "viewWorkspaceConfiguration": "View workspace configuration", + "welcome": "Welcome to Mirador", + "window": "Window: {{label}}", + "windowMenu": "Window views & thumbnail display", + "windowNavigation": "Window navigation", + "windowPluginButtons": "Options", + "windowPluginMenu": "Window options", + "workspace": "Workspace", + "workspaceFullScreen": "Full screen", + "workspaceMenu": "Workspace settings", + "workspaceNavigation": "Workspace navigation", + "workspaceOptions": "Workspace options", + "workspaceSelectionTitle": "Select a workspace type", + "zoomIn": "Zoom in", + "zoomOut": "Zoom out", + "zoomReset": "Reset zoom" + } +} From 3850165d08211789780fa1371a2c23c2005232d9 Mon Sep 17 00:00:00 2001 From: Hrvoje Date: Wed, 28 Aug 2024 14:13:15 +0200 Subject: [PATCH 008/131] Update settings.js --- src/config/settings.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/config/settings.js b/src/config/settings.js index cfcf232db8..488be21e6e 100644 --- a/src/config/settings.js +++ b/src/config/settings.js @@ -421,6 +421,7 @@ export default { et: 'Eesti', fa: 'فارسی', fr: 'Français', + hr: 'Hrvatski', ja: '日本語', kr: '한국어', lt: 'Lietuvių', From 0bdf6869c7fe19c399cd20f1f2b2e9413c5a48f3 Mon Sep 17 00:00:00 2001 From: Hrvoje Date: Wed, 28 Aug 2024 14:13:47 +0200 Subject: [PATCH 009/131] Update i18n.js --- src/i18n.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/i18n.js b/src/i18n.js index 5706ac76ab..fb4531a24d 100644 --- a/src/i18n.js +++ b/src/i18n.js @@ -8,6 +8,7 @@ import fa from './locales/fa/translation.json'; import zhCn from './locales/zhCn/translation.json'; import zhTw from './locales/zhTw/translation.json'; import fr from './locales/fr/translation.json'; +import hr from './locales/hr/translation.json'; import ja from './locales/ja/translation.json'; import kr from './locales/kr/translation.json'; import nl from './locales/nl/translation.json'; @@ -33,6 +34,7 @@ function createI18nInstance() { et, fa, fr, + hr, it, ja, kr, From 883051aa681bcf577a22273c2fcfb09a01659dde Mon Sep 17 00:00:00 2001 From: Hrvoje Date: Wed, 28 Aug 2024 14:25:22 +0200 Subject: [PATCH 010/131] Update translation.json --- src/locales/hr/translation.json | 324 ++++++++++++++++---------------- 1 file changed, 161 insertions(+), 163 deletions(-) diff --git a/src/locales/hr/translation.json b/src/locales/hr/translation.json index 8b2bc085f7..4cdeab745f 100644 --- a/src/locales/hr/translation.json +++ b/src/locales/hr/translation.json @@ -1,165 +1,163 @@ { - "translation": { - "aboutMirador": "About Project Mirador", - "aboutThisItem": "About this item", - "addedFromUrl": "(Added from URL)", - "addManifestUrl": "Resource location", - "addManifestUrlHelp": "The URL of a IIIF resource", - "addResource": "Add resource", - "annotationCanvasLabel_1/1": "Item: [{{label}}]", - "annotationCanvasLabel_1/2": "Left: [{{label}}]", - "annotationCanvasLabel_2/2": "Right: [{{label}}]", - "annotations": "Annotations", - "attribution": "Attribution", - "attributionTitle": "Rights", - "authenticationFailed": "Authentication failed.", - "authenticationRequired": "Authentication required for full access", - "backToResults": "Back to results", - "book": "Book", - "bottom": "Bottom", - "cancel": "Cancel", - "canvasIndex": "Index", - "changeTheme": "Change theme", - "clearSearch": "clear", - "close": "Close", - "closeAddResourceForm": "Close form", - "closeAddResourceMenu": "Close resource list", - "closeCompanionWindow": "Close panel", - "closeWindow": "Close window", - "collapseSection": "Collapse \"{{section}}\" section", - "collapseSidePanel": "Collapse sidebar", - "collection": "Collection", - "continue": "Continue", - "copy": "Copy", - "currentItem": "Current item", - "currentItem_1/1": "Current item", - "currentItem_1/2": "Left", - "currentItem_2/2": "Right", - "dark": "Dark theme", - "digitizedView": "Digitized view", - "dismiss": "Dismiss", - "displayNoAnnotations": "Highlight none", - "downloadExport": "Export workspace", - "downloadExportWorkspace": "Export workspace", - "elastic": "Elastic", - "elasticDescription": "Move and size windows freely in an unlimited workspace. Windows can overlap.", - "emptyResourceList": "Your resource list is empty", - "error": "Error", - "errorDialogConfirm": "OK", - "errorDialogTitle": "An error occurred", - "exitFullScreen": "Exit full screen", - "expandSection": "Expand \"{{section}}\" section", - "expandSidePanel": "Expand sidebar", - "exportCopied": "The workspace configuration was copied to your clipboard", - "fetchManifest": "Add", - "fullScreen": "Full Screen", - "gallery": "Gallery", - "hideZoomControls": "Hide zoom controls", - "highlightAllAnnotations": "Highlight all", - "iiif_homepage": "About this resource", - "iiif_manifest": "IIIF manifest", - "iiif_related": "Related", - "iiif_renderings": "Alternate formats", - "iiif_seeAlso": "See also", - "import": "Import", - "importWorkspace": "Import workspace", - "importWorkspaceHint": "Paste a Mirador 3 configuration to be imported", - "item": "Item: {{label}}", - "itemList": "Item list", - "jsError": "Technical details", - "jsStack": "{{ stack }}", - "language": "Language", - "layer_hide": "Hide layer", - "layer_move": "Move layer", - "layer_moveToTop": "Move layer to top", - "layer_opacity": "Layer opacity", - "layer_show": "Show layer", - "layers": "Layers", - "light": "Light theme", - "links": "Links", - "listAllOpenWindows": "Jump to window", - "login": "Log in", - "logout": "Log out", - "manifestError": "The resource cannot be added:", - "maximizeWindow": "Maximize window", - "minimizeWindow": "Minimize window", - "mirador": "Mirador", - "miradorResources": "Mirador resources", - "miradorViewer": "Mirador viewer", - "more": "more...", - "moreResults": "More results", - "mosaic": "Mosaic", - "mosaicDescription": "Move and size windows in relation to each other, within the visible frame.", - "moveCompanionWindowToBottom": "Move to bottom", - "moveCompanionWindowToRight": "Move to right", - "multipartCollection": "Multipart Collection", - "nextCanvas": "Next item", - "noItemSelected": "No item selected", - "numItems_one": "{{number}} item", - "numItems_other": "{{number}} items", - "off": "Off", - "openCompanionWindow_annotations": "Annotations", - "openCompanionWindow_attribution": "Rights", - "openCompanionWindow_canvas": "Index", - "openCompanionWindow_info": "Information", - "openCompanionWindow_layers": "Layers", - "openCompanionWindow_search": "Search", - "openInCompanionWindow": "Open in separate panel", - "openWindows": "Current open windows", - "pagination": "{{current}} of {{total}}", - "position": "Position", - "previewWindowTitle": "{{title}}", - "previousCanvas": "Previous item", - "related": "Related", - "resource": "Resource", - "retry": "Retry", - "right": "Right", - "rights": "License", - "scroll": "Scroll", - "searchInputLabel": "search terms", - "searchNextResult": "Next result", - "searchNoResults": "No results found", - "searchPreviousResult": "Previous result", - "searchResultsRemaining": "{{numLeft}} remaining", - "searchSubmitAria": "Submit search", - "searchTitle": "Search", - "selectWorkspaceMenu": "Select workspace type", - "showCollection": "Show collection", - "showingNumAnnotations_one": "Showing {{number}} annotation", - "showingNumAnnotations_other": "Showing {{number}} annotations", - "showZoomControls": "Show zoom controls", - "sidebarPanelsNavigation": "Sidebar panels navigation", - "single": "Single", - "startHere": "Start Here", - "suggestSearch": "Search this document for \"{{ query }}\"", - "tableOfContentsList": "Table of contents", - "theme": "Theme", - "thumbnailList": "Thumbnail list", - "thumbnailNavigation": "Thumbnails", - "thumbnails": "Thumbnails", - "toggleWindowSideBar": "Toggle sidebar", - "totalCollections_one": "{{count}} collection", - "totalCollections_other": "{{count}} collections", - "totalManifests_one": "{{count}} manifest", - "totalManifests_other": "{{count}} manifests", - "tryAgain": "Try again", - "untitled": "[Untitled]", - "view": "View", - "viewWorkspaceConfiguration": "View workspace configuration", - "welcome": "Welcome to Mirador", - "window": "Window: {{label}}", - "windowMenu": "Window views & thumbnail display", - "windowNavigation": "Window navigation", - "windowPluginButtons": "Options", - "windowPluginMenu": "Window options", - "workspace": "Workspace", - "workspaceFullScreen": "Full screen", - "workspaceMenu": "Workspace settings", - "workspaceNavigation": "Workspace navigation", - "workspaceOptions": "Workspace options", - "workspaceSelectionTitle": "Select a workspace type", - "zoomIn": "Zoom in", - "zoomOut": "Zoom out", - "zoomReset": "Reset zoom" - } + "translation.aboutMirador": "O Projektu Mirador", + "translation.aboutThisItem": "O ovom zapisu", + "translation.addedFromUrl": "(Dodano s URL-a)", + "translation.addManifestUrl": "Lokacija resursa", + "translation.addManifestUrlHelp": "URL IIIF resursa", + "translation.addResource": "Dodaj resurs", + "translation.annotationCanvasLabel_1/1": "Stavka: [{{label}}]", + "translation.annotationCanvasLabel_1/2": "Lijevo: [{{label}}]", + "translation.annotationCanvasLabel_2/2": "Desno: [{{label}}]", + "translation.annotations": "Anotacije", + "translation.attribution": "Pripisivanje", + "translation.attributionTitle": "Prava", + "translation.authenticationFailed": "Autentifikacija nije uspjela", + "translation.authenticationRequired": "Potrebna je autentifikacija za potpuni pristup", + "translation.backToResults": "Povratak na rezultate", + "translation.book": "Knjiga", + "translation.bottom": "Dno", + "translation.cancel": "Otkaži", + "translation.canvasIndex": "Indeks", + "translation.changeTheme": "Promijeni temu", + "translation.clearSearch": "očisti", + "translation.close": "Zatvori", + "translation.closeAddResourceForm": "Zatvori obrazac", + "translation.closeAddResourceMenu": "Zatvori popis resursa", + "translation.closeCompanionWindow": "Zatvori ploču", + "translation.closeWindow": "Zatvori prozor", + "translation.collapseSection": "Sažmi \"{{section}}\" odjeljak", + "translation.collapseSidePanel": "Sklopi bočnu traku", + "translation.collection": "Kolekcija", + "translation.continue": "Nastavi", + "translation.copy": "Kopiraj", + "translation.currentItem": "Trenutna stavka", + "translation.currentItem_1/1": "Trenutna stavka", + "translation.currentItem_1/2": "Lijevo", + "translation.currentItem_2/2": "Desno", + "translation.dark": "Tamna tema", + "translation.digitizedView": "Digitalizirani prikaz", + "translation.dismiss": "Odbaci", + "translation.displayNoAnnotations": "Istaknite ništa", + "translation.downloadExport": "Izvezi radni prostor", + "translation.downloadExportWorkspace": "Izvezi radni prostor", + "translation.elastic": "Elastičan", + "translation.elasticDescription": "Premještajte i mijenjajte veličinu prozora slobodno u neograničenom radnom prostoru. Prozori se mogu preklapati.", + "translation.emptyResourceList": "Vaš popis resursa je prazan", + "translation.error": "Greška", + "translation.errorDialogConfirm": "U redu", + "translation.errorDialogTitle": "Došlo je do greške", + "translation.exitFullScreen": "Izađi iz punog zaslona", + "translation.expandSection": "Proširi odjeljak \"{{section}}\"", + "translation.expandSidePanel": "Proširi bočnu traku", + "translation.exportCopied": "Konfiguracija radnog prostora kopirana je u vaš međuspremnik", + "translation.fetchManifest": "Dodaj", + "translation.fullScreen": "Cijeli ekran", + "translation.gallery": "Galerija", + "translation.hideZoomControls": "Sakrij kontrole zuma", + "translation.highlightAllAnnotations": "Istakni sve", + "translation.iiif_homepage": "O ovom resursu", + "translation.iiif_manifest": "IIIF manifest", + "translation.iiif_related": "Srodno", + "translation.iiif_renderings": "Alternativni formati", + "translation.iiif_seeAlso": "Vidi također", + "translation.import": "Uvoz", + "translation.importWorkspace": "Uvezi radni prostor", + "translation.importWorkspaceHint": "Zalijepite konfiguraciju Mirador 3 koju treba uvesti", + "translation.item": "Stavka: {{label}}", + "translation.itemList": "Popis stavki", + "translation.jsError": "Tehnički detalji", + "translation.jsStack": "{{ stack }}", + "translation.language": "Jezik", + "translation.layer_hide": "Sakrij sloj", + "translation.layer_move": "Premjesti sloj", + "translation.layer_moveToTop": "Premjesti sloj na vrh", + "translation.layer_opacity": "Prozirnost sloja", + "translation.layer_show": "Prikaži sloj", + "translation.layers": "Slojevi", + "translation.light": "Svijetla tema", + "translation.links": "Poveznice", + "translation.listAllOpenWindows": "Skoči do prozora", + "translation.login": "Prijavi se", + "translation.logout": "Odjavi se", + "translation.manifestError": "Resurs se ne može dodati", + "translation.maximizeWindow": "Maksimiziraj prozor", + "translation.minimizeWindow": "Minimiziraj prozor", + "translation.mirador": "Mirador", + "translation.miradorResources": "Mirador resursi", + "translation.miradorViewer": "Preglednik Mirador", + "translation.more": "još...", + "translation.moreResults": "Više rezultata", + "translation.mosaic": "Mozaik", + "translation.mosaicDescription": "Pomičite i mijenjajte veličinu prozora u odnosu jedan prema drugom, unutar vidljivog okvira.", + "translation.moveCompanionWindowToBottom": "Pomakni se na dno", + "translation.moveCompanionWindowToRight": "Pomakni se udesno", + "translation.multipartCollection": "Višedijelna zbirka", + "translation.nextCanvas": "Sljedeća stavka", + "translation.noItemSelected": "Nijedna stavka nije odabrana", + "translation.numItems_one": "{{number}} predmet", + "translation.numItems_other": "{{number}} artikala", + "translation.off": "Isključeno", + "translation.openCompanionWindow_annotations": "Bilješke", + "translation.openCompanionWindow_attribution": "Prava", + "translation.openCompanionWindow_canvas": "Indeks", + "translation.openCompanionWindow_info": "Informacija", + "translation.openCompanionWindow_layers": "Slojevi", + "translation.openCompanionWindow_search": "Pretraživanje", + "translation.openInCompanionWindow": "Otvori u zasebnom panelu", + "translation.openWindows": "Trenutno otvoreni prozori", + "translation.pagination": "{{current}} od {{total}}", + "translation.position": "Pozicija", + "translation.previewWindowTitle": "{{title}}", + "translation.previousCanvas": "Prethodna stavka", + "translation.related": "Srodno", + "translation.resource": "Resurs", + "translation.retry": "Pokušaj ponovno", + "translation.right": "Desno", + "translation.rights": "Licenca", + "translation.scroll": "Pomakni", + "translation.searchInputLabel": "pojmovima pretraživanja", + "translation.searchNextResult": "Sljedeći rezultat", + "translation.searchNoResults": "Nema rezultata", + "translation.searchPreviousResult": "Prethodni rezultat", + "translation.searchResultsRemaining": "Preostalo je {{numLeft}}", + "translation.searchSubmitAria": "Podnesi pretragu", + "translation.searchTitle": "Pretraživanje", + "translation.selectWorkspaceMenu": "Odaberite vrstu radnog prostora", + "translation.showCollection": "Prikaži kolekciju", + "translation.showingNumAnnotations_one": "Prikazivanje {{number}} bilješke", + "translation.showingNumAnnotations_other": "Prikazivanje {{number}} bilješki", + "translation.showZoomControls": "Prikaži kontrole zumiranja", + "translation.sidebarPanelsNavigation": "Bočne ploče navigacija", + "translation.single": "Jedan", + "translation.startHere": "Počnite ovdje", + "translation.suggestSearch": "Pretraži ovaj dokument za \"{{ query }}\"", + "translation.tableOfContentsList": "Sadržaj", + "translation.theme": "Tema", + "translation.thumbnailList": "Popis sličica", + "translation.thumbnailNavigation": "Sličice", + "translation.thumbnails": "Sličice", + "translation.toggleWindowSideBar": "Prebaci bočnu traku", + "translation.totalCollections_one": "{{count}} kolekcija", + "translation.totalCollections_other": "{{count}} kolekcija", + "translation.totalManifests_one": "{{count}} manifest", + "translation.totalManifests_other": "{{count}} manifesta", + "translation.tryAgain": "Pokušaj ponovno", + "translation.untitled": "[Nenaslovljeno]", + "translation.view": "Pogled", + "translation.viewWorkspaceConfiguration": "Pogledaj konfiguraciju radnog prostora", + "translation.welcome": "Dobrodošli u Mirador", + "translation.window": "Prozor: {{label}}", + "translation.windowMenu": "Prikazi prozora i prikaz sličica", + "translation.windowNavigation": "Navigacija prozorom", + "translation.windowPluginButtons": "Opcije", + "translation.windowPluginMenu": "Opcije prozora", + "translation.workspace": "Radni prostor", + "translation.workspaceFullScreen": "Puni zaslon", + "translation.workspaceMenu": "Postavke radnog prostora", + "translation.workspaceNavigation": "Navigacija radnog prostora", + "translation.workspaceOptions": "Opcije radnog prostora", + "translation.workspaceSelectionTitle": "Odaberite vrstu radnog prostora", + "translation.zoomIn": "Povećaj", + "translation.zoomOut": "Umanji prikaz", + "translation.zoomReset": "Poništi zumiranje" } From 5269ce696e7f7d23c30b313fa6cb7329888c7e89 Mon Sep 17 00:00:00 2001 From: marlo-longley Date: Tue, 15 Oct 2024 11:38:20 -0500 Subject: [PATCH 011/131] Pin to ubuntu-22 to avoid CI failure --- .github/workflows/node.js.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index bc23b2fac7..5842dfe25c 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -11,7 +11,9 @@ on: jobs: build: - runs-on: ubuntu-latest + # Pin to ubuntu-22 until a solution is found for this issue: + # https://chromium.googlesource.com/chromium/src/+/main/docs/security/apparmor-userns-restrictions.md + runs-on: ubuntu-22.04 strategy: matrix: node-version: [18.x, 20.x] From 78d18e6395d25b7c02f9baeb52b86bb02d3d1621 Mon Sep 17 00:00:00 2001 From: Chris Beer Date: Mon, 28 Oct 2024 14:41:51 -0700 Subject: [PATCH 012/131] Update dependencies --- package.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 2955f10253..63bba22e81 100644 --- a/package.json +++ b/package.json @@ -36,7 +36,7 @@ "@emotion/cache": "^11.11.0", "@emotion/react": "^11.10.6", "@emotion/styled": "^11.10.6", - "@hello-pangea/dnd": "^16.0.1", + "@hello-pangea/dnd": "^16.0.1 || ^17.0.0", "@mui/icons-material": "^5.11.16", "@mui/lab": "^5.0.0-alpha.134", "@mui/material": "^5.13.5", @@ -102,7 +102,7 @@ "babel-plugin-lodash": "^3.3.4", "babel-plugin-macros": "^3.0.1", "babel-plugin-transform-react-remove-prop-types": "^0.4.24", - "bundlewatch": "^0.3.3", + "bundlewatch": "^0.4.0", "canvas": "^2.11.0", "chalk": "^4.1.0", "core-js": "^3.21.1", @@ -122,9 +122,9 @@ "jest": "^29.3.1", "jest-environment-jsdom": "^29.4.3", "jest-fetch-mock": "^3.0.0", - "jest-puppeteer": "^9.0.2", - "jsdom": "^23.0.0", - "puppeteer": "^21.0.0", + "jest-puppeteer": "^10.1.0", + "jsdom": "^25.0.0", + "puppeteer": "^23.0.0", "react": "^18.0.0", "react-dnd-test-backend": "^16.0.1", "react-dom": "^18.0.0", From e6ffeeccc3e85bc1b9cd13580f3ab00dc61679e8 Mon Sep 17 00:00:00 2001 From: Chris Beer Date: Mon, 28 Oct 2024 14:48:06 -0700 Subject: [PATCH 013/131] Reformat hr locale to match linter-expected format. --- src/locales/hr/translation.json | 324 ++++++++++++++++---------------- 1 file changed, 163 insertions(+), 161 deletions(-) diff --git a/src/locales/hr/translation.json b/src/locales/hr/translation.json index 4cdeab745f..adc5d668ba 100644 --- a/src/locales/hr/translation.json +++ b/src/locales/hr/translation.json @@ -1,163 +1,165 @@ { - "translation.aboutMirador": "O Projektu Mirador", - "translation.aboutThisItem": "O ovom zapisu", - "translation.addedFromUrl": "(Dodano s URL-a)", - "translation.addManifestUrl": "Lokacija resursa", - "translation.addManifestUrlHelp": "URL IIIF resursa", - "translation.addResource": "Dodaj resurs", - "translation.annotationCanvasLabel_1/1": "Stavka: [{{label}}]", - "translation.annotationCanvasLabel_1/2": "Lijevo: [{{label}}]", - "translation.annotationCanvasLabel_2/2": "Desno: [{{label}}]", - "translation.annotations": "Anotacije", - "translation.attribution": "Pripisivanje", - "translation.attributionTitle": "Prava", - "translation.authenticationFailed": "Autentifikacija nije uspjela", - "translation.authenticationRequired": "Potrebna je autentifikacija za potpuni pristup", - "translation.backToResults": "Povratak na rezultate", - "translation.book": "Knjiga", - "translation.bottom": "Dno", - "translation.cancel": "Otkaži", - "translation.canvasIndex": "Indeks", - "translation.changeTheme": "Promijeni temu", - "translation.clearSearch": "očisti", - "translation.close": "Zatvori", - "translation.closeAddResourceForm": "Zatvori obrazac", - "translation.closeAddResourceMenu": "Zatvori popis resursa", - "translation.closeCompanionWindow": "Zatvori ploču", - "translation.closeWindow": "Zatvori prozor", - "translation.collapseSection": "Sažmi \"{{section}}\" odjeljak", - "translation.collapseSidePanel": "Sklopi bočnu traku", - "translation.collection": "Kolekcija", - "translation.continue": "Nastavi", - "translation.copy": "Kopiraj", - "translation.currentItem": "Trenutna stavka", - "translation.currentItem_1/1": "Trenutna stavka", - "translation.currentItem_1/2": "Lijevo", - "translation.currentItem_2/2": "Desno", - "translation.dark": "Tamna tema", - "translation.digitizedView": "Digitalizirani prikaz", - "translation.dismiss": "Odbaci", - "translation.displayNoAnnotations": "Istaknite ništa", - "translation.downloadExport": "Izvezi radni prostor", - "translation.downloadExportWorkspace": "Izvezi radni prostor", - "translation.elastic": "Elastičan", - "translation.elasticDescription": "Premještajte i mijenjajte veličinu prozora slobodno u neograničenom radnom prostoru. Prozori se mogu preklapati.", - "translation.emptyResourceList": "Vaš popis resursa je prazan", - "translation.error": "Greška", - "translation.errorDialogConfirm": "U redu", - "translation.errorDialogTitle": "Došlo je do greške", - "translation.exitFullScreen": "Izađi iz punog zaslona", - "translation.expandSection": "Proširi odjeljak \"{{section}}\"", - "translation.expandSidePanel": "Proširi bočnu traku", - "translation.exportCopied": "Konfiguracija radnog prostora kopirana je u vaš međuspremnik", - "translation.fetchManifest": "Dodaj", - "translation.fullScreen": "Cijeli ekran", - "translation.gallery": "Galerija", - "translation.hideZoomControls": "Sakrij kontrole zuma", - "translation.highlightAllAnnotations": "Istakni sve", - "translation.iiif_homepage": "O ovom resursu", - "translation.iiif_manifest": "IIIF manifest", - "translation.iiif_related": "Srodno", - "translation.iiif_renderings": "Alternativni formati", - "translation.iiif_seeAlso": "Vidi također", - "translation.import": "Uvoz", - "translation.importWorkspace": "Uvezi radni prostor", - "translation.importWorkspaceHint": "Zalijepite konfiguraciju Mirador 3 koju treba uvesti", - "translation.item": "Stavka: {{label}}", - "translation.itemList": "Popis stavki", - "translation.jsError": "Tehnički detalji", - "translation.jsStack": "{{ stack }}", - "translation.language": "Jezik", - "translation.layer_hide": "Sakrij sloj", - "translation.layer_move": "Premjesti sloj", - "translation.layer_moveToTop": "Premjesti sloj na vrh", - "translation.layer_opacity": "Prozirnost sloja", - "translation.layer_show": "Prikaži sloj", - "translation.layers": "Slojevi", - "translation.light": "Svijetla tema", - "translation.links": "Poveznice", - "translation.listAllOpenWindows": "Skoči do prozora", - "translation.login": "Prijavi se", - "translation.logout": "Odjavi se", - "translation.manifestError": "Resurs se ne može dodati", - "translation.maximizeWindow": "Maksimiziraj prozor", - "translation.minimizeWindow": "Minimiziraj prozor", - "translation.mirador": "Mirador", - "translation.miradorResources": "Mirador resursi", - "translation.miradorViewer": "Preglednik Mirador", - "translation.more": "još...", - "translation.moreResults": "Više rezultata", - "translation.mosaic": "Mozaik", - "translation.mosaicDescription": "Pomičite i mijenjajte veličinu prozora u odnosu jedan prema drugom, unutar vidljivog okvira.", - "translation.moveCompanionWindowToBottom": "Pomakni se na dno", - "translation.moveCompanionWindowToRight": "Pomakni se udesno", - "translation.multipartCollection": "Višedijelna zbirka", - "translation.nextCanvas": "Sljedeća stavka", - "translation.noItemSelected": "Nijedna stavka nije odabrana", - "translation.numItems_one": "{{number}} predmet", - "translation.numItems_other": "{{number}} artikala", - "translation.off": "Isključeno", - "translation.openCompanionWindow_annotations": "Bilješke", - "translation.openCompanionWindow_attribution": "Prava", - "translation.openCompanionWindow_canvas": "Indeks", - "translation.openCompanionWindow_info": "Informacija", - "translation.openCompanionWindow_layers": "Slojevi", - "translation.openCompanionWindow_search": "Pretraživanje", - "translation.openInCompanionWindow": "Otvori u zasebnom panelu", - "translation.openWindows": "Trenutno otvoreni prozori", - "translation.pagination": "{{current}} od {{total}}", - "translation.position": "Pozicija", - "translation.previewWindowTitle": "{{title}}", - "translation.previousCanvas": "Prethodna stavka", - "translation.related": "Srodno", - "translation.resource": "Resurs", - "translation.retry": "Pokušaj ponovno", - "translation.right": "Desno", - "translation.rights": "Licenca", - "translation.scroll": "Pomakni", - "translation.searchInputLabel": "pojmovima pretraživanja", - "translation.searchNextResult": "Sljedeći rezultat", - "translation.searchNoResults": "Nema rezultata", - "translation.searchPreviousResult": "Prethodni rezultat", - "translation.searchResultsRemaining": "Preostalo je {{numLeft}}", - "translation.searchSubmitAria": "Podnesi pretragu", - "translation.searchTitle": "Pretraživanje", - "translation.selectWorkspaceMenu": "Odaberite vrstu radnog prostora", - "translation.showCollection": "Prikaži kolekciju", - "translation.showingNumAnnotations_one": "Prikazivanje {{number}} bilješke", - "translation.showingNumAnnotations_other": "Prikazivanje {{number}} bilješki", - "translation.showZoomControls": "Prikaži kontrole zumiranja", - "translation.sidebarPanelsNavigation": "Bočne ploče navigacija", - "translation.single": "Jedan", - "translation.startHere": "Počnite ovdje", - "translation.suggestSearch": "Pretraži ovaj dokument za \"{{ query }}\"", - "translation.tableOfContentsList": "Sadržaj", - "translation.theme": "Tema", - "translation.thumbnailList": "Popis sličica", - "translation.thumbnailNavigation": "Sličice", - "translation.thumbnails": "Sličice", - "translation.toggleWindowSideBar": "Prebaci bočnu traku", - "translation.totalCollections_one": "{{count}} kolekcija", - "translation.totalCollections_other": "{{count}} kolekcija", - "translation.totalManifests_one": "{{count}} manifest", - "translation.totalManifests_other": "{{count}} manifesta", - "translation.tryAgain": "Pokušaj ponovno", - "translation.untitled": "[Nenaslovljeno]", - "translation.view": "Pogled", - "translation.viewWorkspaceConfiguration": "Pogledaj konfiguraciju radnog prostora", - "translation.welcome": "Dobrodošli u Mirador", - "translation.window": "Prozor: {{label}}", - "translation.windowMenu": "Prikazi prozora i prikaz sličica", - "translation.windowNavigation": "Navigacija prozorom", - "translation.windowPluginButtons": "Opcije", - "translation.windowPluginMenu": "Opcije prozora", - "translation.workspace": "Radni prostor", - "translation.workspaceFullScreen": "Puni zaslon", - "translation.workspaceMenu": "Postavke radnog prostora", - "translation.workspaceNavigation": "Navigacija radnog prostora", - "translation.workspaceOptions": "Opcije radnog prostora", - "translation.workspaceSelectionTitle": "Odaberite vrstu radnog prostora", - "translation.zoomIn": "Povećaj", - "translation.zoomOut": "Umanji prikaz", - "translation.zoomReset": "Poništi zumiranje" + "translation": { + "aboutMirador": "O Projektu Mirador", + "aboutThisItem": "O ovom zapisu", + "addedFromUrl": "(Dodano s URL-a)", + "addManifestUrl": "Lokacija resursa", + "addManifestUrlHelp": "URL IIIF resursa", + "addResource": "Dodaj resurs", + "annotationCanvasLabel_1/1": "Stavka: [{{label}}]", + "annotationCanvasLabel_1/2": "Lijevo: [{{label}}]", + "annotationCanvasLabel_2/2": "Desno: [{{label}}]", + "annotations": "Anotacije", + "attribution": "Pripisivanje", + "attributionTitle": "Prava", + "authenticationFailed": "Autentifikacija nije uspjela", + "authenticationRequired": "Potrebna je autentifikacija za potpuni pristup", + "backToResults": "Povratak na rezultate", + "book": "Knjiga", + "bottom": "Dno", + "cancel": "Otkaži", + "canvasIndex": "Indeks", + "changeTheme": "Promijeni temu", + "clearSearch": "očisti", + "close": "Zatvori", + "closeAddResourceForm": "Zatvori obrazac", + "closeAddResourceMenu": "Zatvori popis resursa", + "closeCompanionWindow": "Zatvori ploču", + "closeWindow": "Zatvori prozor", + "collapseSection": "Sažmi \"{{section}}\" odjeljak", + "collapseSidePanel": "Sklopi bočnu traku", + "collection": "Kolekcija", + "continue": "Nastavi", + "copy": "Kopiraj", + "currentItem": "Trenutna stavka", + "currentItem_1/1": "Trenutna stavka", + "currentItem_1/2": "Lijevo", + "currentItem_2/2": "Desno", + "dark": "Tamna tema", + "digitizedView": "Digitalizirani prikaz", + "dismiss": "Odbaci", + "displayNoAnnotations": "Istaknite ništa", + "downloadExport": "Izvezi radni prostor", + "downloadExportWorkspace": "Izvezi radni prostor", + "elastic": "Elastičan", + "elasticDescription": "Premještajte i mijenjajte veličinu prozora slobodno u neograničenom radnom prostoru. Prozori se mogu preklapati.", + "emptyResourceList": "Vaš popis resursa je prazan", + "error": "Greška", + "errorDialogConfirm": "U redu", + "errorDialogTitle": "Došlo je do greške", + "exitFullScreen": "Izađi iz punog zaslona", + "expandSection": "Proširi odjeljak \"{{section}}\"", + "expandSidePanel": "Proširi bočnu traku", + "exportCopied": "Konfiguracija radnog prostora kopirana je u vaš međuspremnik", + "fetchManifest": "Dodaj", + "fullScreen": "Cijeli ekran", + "gallery": "Galerija", + "hideZoomControls": "Sakrij kontrole zuma", + "highlightAllAnnotations": "Istakni sve", + "iiif_homepage": "O ovom resursu", + "iiif_manifest": "IIIF manifest", + "iiif_related": "Srodno", + "iiif_renderings": "Alternativni formati", + "iiif_seeAlso": "Vidi također", + "import": "Uvoz", + "importWorkspace": "Uvezi radni prostor", + "importWorkspaceHint": "Zalijepite konfiguraciju Mirador 3 koju treba uvesti", + "item": "Stavka: {{label}}", + "itemList": "Popis stavki", + "jsError": "Tehnički detalji", + "jsStack": "{{ stack }}", + "language": "Jezik", + "layer_hide": "Sakrij sloj", + "layer_move": "Premjesti sloj", + "layer_moveToTop": "Premjesti sloj na vrh", + "layer_opacity": "Prozirnost sloja", + "layer_show": "Prikaži sloj", + "layers": "Slojevi", + "light": "Svijetla tema", + "links": "Poveznice", + "listAllOpenWindows": "Skoči do prozora", + "login": "Prijavi se", + "logout": "Odjavi se", + "manifestError": "Resurs se ne može dodati", + "maximizeWindow": "Maksimiziraj prozor", + "minimizeWindow": "Minimiziraj prozor", + "mirador": "Mirador", + "miradorResources": "Mirador resursi", + "miradorViewer": "Preglednik Mirador", + "more": "još...", + "moreResults": "Više rezultata", + "mosaic": "Mozaik", + "mosaicDescription": "Pomičite i mijenjajte veličinu prozora u odnosu jedan prema drugom, unutar vidljivog okvira.", + "moveCompanionWindowToBottom": "Pomakni se na dno", + "moveCompanionWindowToRight": "Pomakni se udesno", + "multipartCollection": "Višedijelna zbirka", + "nextCanvas": "Sljedeća stavka", + "noItemSelected": "Nijedna stavka nije odabrana", + "numItems_one": "{{number}} predmet", + "numItems_other": "{{number}} artikala", + "off": "Isključeno", + "openCompanionWindow_annotations": "Bilješke", + "openCompanionWindow_attribution": "Prava", + "openCompanionWindow_canvas": "Indeks", + "openCompanionWindow_info": "Informacija", + "openCompanionWindow_layers": "Slojevi", + "openCompanionWindow_search": "Pretraživanje", + "openInCompanionWindow": "Otvori u zasebnom panelu", + "openWindows": "Trenutno otvoreni prozori", + "pagination": "{{current}} od {{total}}", + "position": "Pozicija", + "previewWindowTitle": "{{title}}", + "previousCanvas": "Prethodna stavka", + "related": "Srodno", + "resource": "Resurs", + "retry": "Pokušaj ponovno", + "right": "Desno", + "rights": "Licenca", + "scroll": "Pomakni", + "searchInputLabel": "pojmovima pretraživanja", + "searchNextResult": "Sljedeći rezultat", + "searchNoResults": "Nema rezultata", + "searchPreviousResult": "Prethodni rezultat", + "searchResultsRemaining": "Preostalo je {{numLeft}}", + "searchSubmitAria": "Podnesi pretragu", + "searchTitle": "Pretraživanje", + "selectWorkspaceMenu": "Odaberite vrstu radnog prostora", + "showCollection": "Prikaži kolekciju", + "showingNumAnnotations_one": "Prikazivanje {{number}} bilješke", + "showingNumAnnotations_other": "Prikazivanje {{number}} bilješki", + "showZoomControls": "Prikaži kontrole zumiranja", + "sidebarPanelsNavigation": "Bočne ploče navigacija", + "single": "Jedan", + "startHere": "Počnite ovdje", + "suggestSearch": "Pretraži ovaj dokument za \"{{ query }}\"", + "tableOfContentsList": "Sadržaj", + "theme": "Tema", + "thumbnailList": "Popis sličica", + "thumbnailNavigation": "Sličice", + "thumbnails": "Sličice", + "toggleWindowSideBar": "Prebaci bočnu traku", + "totalCollections_one": "{{count}} kolekcija", + "totalCollections_other": "{{count}} kolekcija", + "totalManifests_one": "{{count}} manifest", + "totalManifests_other": "{{count}} manifesta", + "tryAgain": "Pokušaj ponovno", + "untitled": "[Nenaslovljeno]", + "view": "Pogled", + "viewWorkspaceConfiguration": "Pogledaj konfiguraciju radnog prostora", + "welcome": "Dobrodošli u Mirador", + "window": "Prozor: {{label}}", + "windowMenu": "Prikazi prozora i prikaz sličica", + "windowNavigation": "Navigacija prozorom", + "windowPluginButtons": "Opcije", + "windowPluginMenu": "Opcije prozora", + "workspace": "Radni prostor", + "workspaceFullScreen": "Puni zaslon", + "workspaceMenu": "Postavke radnog prostora", + "workspaceNavigation": "Navigacija radnog prostora", + "workspaceOptions": "Opcije radnog prostora", + "workspaceSelectionTitle": "Odaberite vrstu radnog prostora", + "zoomIn": "Povećaj", + "zoomOut": "Umanji prikaz", + "zoomReset": "Poništi zumiranje" + } } From 5afa7173d671ea0a86274138bbbae5a18dee67ed Mon Sep 17 00:00:00 2001 From: Justin Coyne Date: Mon, 28 Oct 2024 22:10:09 -0500 Subject: [PATCH 014/131] Avoid using deprecated method waitForTimeout --- __tests__/integration/mirador/companion_windows.test.js | 1 - __tests__/integration/mirador/invalid-api-response.test.js | 1 - __tests__/integration/mirador/language_switching.test.js | 1 - __tests__/integration/mirador/plugins/add.test.js | 1 - .../integration/mirador/plugins/companionWindow.test.js | 6 ++---- __tests__/integration/mirador/plugins/priority.test.js | 1 - __tests__/integration/mirador/plugins/state.test.js | 1 - __tests__/integration/mirador/plugins/validate.test.js | 1 - __tests__/integration/mirador/plugins/wrap.test.js | 1 - __tests__/integration/mirador/thumbnail-navigation.test.js | 1 - __tests__/integration/mirador/window_actions.test.js | 2 -- 11 files changed, 2 insertions(+), 15 deletions(-) diff --git a/__tests__/integration/mirador/companion_windows.test.js b/__tests__/integration/mirador/companion_windows.test.js index 848a5f167c..1f52a14b8a 100644 --- a/__tests__/integration/mirador/companion_windows.test.js +++ b/__tests__/integration/mirador/companion_windows.test.js @@ -6,7 +6,6 @@ describe('Companion Windows', () => { await expect(page).toFill('#manifestURL', 'http://127.0.0.1:4488/__tests__/fixtures/version-2/001.json'); await expect(page).toClick('#fetchBtn'); await expect(page).toClick('[data-manifestid="http://127.0.0.1:4488/__tests__/fixtures/version-2/001.json"] button'); - await page.waitForTimeout(300); await expect(page).toMatchElement('.mirador-window'); }); diff --git a/__tests__/integration/mirador/invalid-api-response.test.js b/__tests__/integration/mirador/invalid-api-response.test.js index a2f191d2a1..c67a2c86f7 100644 --- a/__tests__/integration/mirador/invalid-api-response.test.js +++ b/__tests__/integration/mirador/invalid-api-response.test.js @@ -9,7 +9,6 @@ describe('Mirador Invalid API Response Handler Test', () => { await page.evaluate(() => { document.querySelector('.mirador-add-resource-button').click(); }); - await page.waitForTimeout(50); await expect(page).toFill('#manifestURL', uri); await expect(page).toClick('#fetchBtn'); diff --git a/__tests__/integration/mirador/language_switching.test.js b/__tests__/integration/mirador/language_switching.test.js index 58ceb88f9a..b8178fd6af 100644 --- a/__tests__/integration/mirador/language_switching.test.js +++ b/__tests__/integration/mirador/language_switching.test.js @@ -16,7 +16,6 @@ describe('Language Switching', () => { await expect(page).toMatchElement('[aria-label="Start Here"]'); await expect(page).not.toMatchElement('[aria-label="Hier starten"]'); await expect(page).toClick('li', { text: 'Deutsch' }); - await page.waitForTimeout(1000); await expect(page).not.toMatchElement('[aria-label="Start Here"]'); await expect(page).toMatchElement('[aria-label="Hier starten"]'); }); diff --git a/__tests__/integration/mirador/plugins/add.test.js b/__tests__/integration/mirador/plugins/add.test.js index 878f81403c..e9917d39ba 100644 --- a/__tests__/integration/mirador/plugins/add.test.js +++ b/__tests__/integration/mirador/plugins/add.test.js @@ -2,7 +2,6 @@ describe('add two plugins to ', () => { beforeAll(async () => { await page.goto('http://127.0.0.1:4488/__tests__/integration/mirador/plugins/add.html'); await expect(page).toMatchElement('.mirador-viewer'); - await page.waitForTimeout(1000); }); it('all add plugins will be added to ', async () => { diff --git a/__tests__/integration/mirador/plugins/companionWindow.test.js b/__tests__/integration/mirador/plugins/companionWindow.test.js index 71ad618bc9..5be299765a 100644 --- a/__tests__/integration/mirador/plugins/companionWindow.test.js +++ b/__tests__/integration/mirador/plugins/companionWindow.test.js @@ -2,17 +2,15 @@ describe('add plugins for companion windows', () => { beforeAll(async () => { await page.goto('http://127.0.0.1:4488/__tests__/integration/mirador/plugins/companionWindow.html'); await expect(page).toMatchElement('.mirador-viewer'); - await page.waitForTimeout(1000); }); it('added a plugin to the window sidebar and companion window', async () => { await expect(page).toClick('button[aria-label="Toggle sidebar"]'); - await page.waitForTimeout(1000); await expect(page).toMatchElement('.mirador-companion-window-left.mirador-window-sidebar-info-panel'); await expect(page).toMatchElement('#add-plugin-companion-window-button'); await expect(page).toClick('#add-plugin-companion-window-button'); - await expect(page).toMatchElement('#add-plugin-companion-window'); - }); + await expect(page).toMatchElement('#add-plugin-companion-window', { timeout: 20000 }); + }, 20000); }); diff --git a/__tests__/integration/mirador/plugins/priority.test.js b/__tests__/integration/mirador/plugins/priority.test.js index 6dfece29f8..5b99a0c3be 100644 --- a/__tests__/integration/mirador/plugins/priority.test.js +++ b/__tests__/integration/mirador/plugins/priority.test.js @@ -2,7 +2,6 @@ describe('try to apply 2 add plugins and 2 wrap plugins to { await page.goto('http://127.0.0.1:4488/__tests__/integration/mirador/plugins/priority.html'); await expect(page).toMatchElement('.mirador-viewer'); - await page.waitForTimeout(1000); }); it('only apply the first wrap plugin', async () => { diff --git a/__tests__/integration/mirador/plugins/state.test.js b/__tests__/integration/mirador/plugins/state.test.js index 4631ecef12..03bd44ce45 100644 --- a/__tests__/integration/mirador/plugins/state.test.js +++ b/__tests__/integration/mirador/plugins/state.test.js @@ -4,7 +4,6 @@ describe('how plugins relate to state', () => { beforeAll(async () => { await page.goto('http://127.0.0.1:4488/__tests__/integration/mirador/plugins/state.html'); await expect(page).toMatchElement('.mirador-viewer'); - await page.waitForTimeout(1000); }); it('plugin can read from state', async () => { diff --git a/__tests__/integration/mirador/plugins/validate.test.js b/__tests__/integration/mirador/plugins/validate.test.js index d62a7c261c..74f08624ec 100644 --- a/__tests__/integration/mirador/plugins/validate.test.js +++ b/__tests__/integration/mirador/plugins/validate.test.js @@ -2,7 +2,6 @@ describe('pass valid and invalid plugins to ', () beforeAll(async () => { await page.goto('http://127.0.0.1:4488/__tests__/integration/mirador/plugins/validate.html'); await expect(page).toMatchElement('.mirador-viewer'); - await page.waitForTimeout(1000); }); it('valid plugins will be applied ', async () => { diff --git a/__tests__/integration/mirador/plugins/wrap.test.js b/__tests__/integration/mirador/plugins/wrap.test.js index 2e77a1842b..b3944187ca 100644 --- a/__tests__/integration/mirador/plugins/wrap.test.js +++ b/__tests__/integration/mirador/plugins/wrap.test.js @@ -2,7 +2,6 @@ describe('wrap by a plugin', () => { beforeAll(async () => { await page.goto('http://127.0.0.1:4488/__tests__/integration/mirador/plugins/wrap.html'); await expect(page).toMatchElement('.mirador-viewer'); - await page.waitForTimeout(1000); }); it('wraps ', async () => { diff --git a/__tests__/integration/mirador/thumbnail-navigation.test.js b/__tests__/integration/mirador/thumbnail-navigation.test.js index 82502cbd53..ad6f76bb2f 100644 --- a/__tests__/integration/mirador/thumbnail-navigation.test.js +++ b/__tests__/integration/mirador/thumbnail-navigation.test.js @@ -13,7 +13,6 @@ describe('Thumbnail navigation', () => { miradorInstance.store.getState().windows )); expect(Object.values(windows)[0].canvasId).toBe('https://iiif.harvardartmuseums.org/manifests/object/299843/canvas/canvas-47174892'); // test harness in index.html starts at 2 - await page.waitForTimeout(1000); await expect(page).toClick('.mirador-thumbnail-nav-canvas-1 img'); await expect(page).toMatchElement('.mirador-thumbnail-nav-canvas-1.mirador-current-canvas-grouping', { timeout: 1500 }); windows = await page.evaluate(() => ( diff --git a/__tests__/integration/mirador/window_actions.test.js b/__tests__/integration/mirador/window_actions.test.js index 8dd54ffba9..447832866a 100644 --- a/__tests__/integration/mirador/window_actions.test.js +++ b/__tests__/integration/mirador/window_actions.test.js @@ -12,12 +12,10 @@ describe('Window actions', () => { await expect(page).toClick('[data-manifestid="http://127.0.0.1:4488/__tests__/fixtures/version-2/sn904cj3429.json"] button'); await expect(page).toMatchElement('.mirador-window'); - await page.waitForTimeout(1000); await expect(page).toClick('.mirador-window-close'); const numWindows = await page.evaluate(page => ( document.querySelectorAll('.mirador-window').length )); // only default configed windows found - await page.waitForTimeout(1000); await expect(numWindows).toBe(0); }); }); From 0fdf5442dd0c2d5b815ac6fd9cbf0d3d3d37076c Mon Sep 17 00:00:00 2001 From: Chris Beer Date: Tue, 29 Oct 2024 09:33:01 -0700 Subject: [PATCH 015/131] Skip companion window plugin test that's acting wonky. --- __tests__/integration/mirador/plugins/companionWindow.test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/__tests__/integration/mirador/plugins/companionWindow.test.js b/__tests__/integration/mirador/plugins/companionWindow.test.js index 5be299765a..bef694dcd6 100644 --- a/__tests__/integration/mirador/plugins/companionWindow.test.js +++ b/__tests__/integration/mirador/plugins/companionWindow.test.js @@ -4,7 +4,7 @@ describe('add plugins for companion windows', () => { await expect(page).toMatchElement('.mirador-viewer'); }); - it('added a plugin to the window sidebar and companion window', async () => { + it.skip('added a plugin to the window sidebar and companion window', async () => { await expect(page).toClick('button[aria-label="Toggle sidebar"]'); await expect(page).toMatchElement('.mirador-companion-window-left.mirador-window-sidebar-info-panel'); From 437153fb7866e43d151b1161f2268b234ce6b4a1 Mon Sep 17 00:00:00 2001 From: Chris Beer Date: Tue, 29 Oct 2024 10:15:28 -0700 Subject: [PATCH 016/131] Stop testing the mui5 branch now that it's merged --- .github/workflows/node.js.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 5842dfe25c..2aa4d00a64 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -7,7 +7,7 @@ on: push: branches: [ master ] pull_request: - branches: [ master, mui5 ] + branches: [ master ] jobs: build: From dfd1bbfca02182591980e758cee736b8d9ee23e2 Mon Sep 17 00:00:00 2001 From: Chris Beer Date: Tue, 29 Oct 2024 10:16:26 -0700 Subject: [PATCH 017/131] Bump CI action versions. --- .github/workflows/node.js.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 5842dfe25c..07a6ec6bb5 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -19,12 +19,12 @@ jobs: node-version: [18.x, 20.x] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} - run: npm install - run: npm test - name: Upload coverage to Codecov - uses: codecov/codecov-action@v3 + uses: codecov/codecov-action@v4 From f4515baf6a092488924d9cba41f88d0967cd5839 Mon Sep 17 00:00:00 2001 From: Chris Beer Date: Tue, 29 Oct 2024 09:17:11 -0700 Subject: [PATCH 018/131] Update react-i18next --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 63bba22e81..a4f10d7983 100644 --- a/package.json +++ b/package.json @@ -61,7 +61,7 @@ "react-dnd-multi-backend": "^8.0.0", "react-dnd-touch-backend": "^16.0.0", "react-full-screen": "^1.1.1", - "react-i18next": "^11.7.0 || ^12.0.0 || ^13.0.0", + "react-i18next": "^13.0.0 || ^14.0.0 || ^15.0.0", "react-image": "^4.0.1", "react-intersection-observer": "^9.0.0", "react-mosaic-component": "^6.0.0", From 0ea18326503e3e38337872c1df80920c133010ed Mon Sep 17 00:00:00 2001 From: Chris Beer Date: Tue, 29 Oct 2024 09:21:06 -0700 Subject: [PATCH 019/131] Update testing-library dependencies --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 63bba22e81..2922682005 100644 --- a/package.json +++ b/package.json @@ -91,9 +91,9 @@ "@babel/preset-env": "^7.16.11", "@babel/preset-react": "^7.16.7", "@pmmmwh/react-refresh-webpack-plugin": "^0.5.4", - "@testing-library/dom": "^9.2.0", + "@testing-library/dom": "^10.4.0", "@testing-library/jest-dom": "^6.1.5", - "@testing-library/react": "^14.1.2", + "@testing-library/react": "^16.0.1", "@testing-library/user-event": "^14.4.3", "@typescript-eslint/eslint-plugin": "^6.14.0", "@typescript-eslint/parser": "^6.14.0", From 1215b40434bb6a92d83e949f4dcb219a82a72345 Mon Sep 17 00:00:00 2001 From: Justin Coyne Date: Mon, 28 Oct 2024 21:38:33 -0500 Subject: [PATCH 020/131] Remove babel proposal plugins Modern browsers have this built in --- babel.config.js | 14 -------------- package.json | 15 ++++++--------- 2 files changed, 6 insertions(+), 23 deletions(-) diff --git a/babel.config.js b/babel.config.js index eb0b0f586e..94f006cfcf 100644 --- a/babel.config.js +++ b/babel.config.js @@ -47,20 +47,6 @@ module.exports = function (api) { const plugins = [ 'babel-plugin-macros', '@babel/plugin-transform-destructuring', - [ - '@babel/plugin-proposal-class-properties', - { - loose: true, - }, - ], - ['@babel/plugin-proposal-private-property-in-object', { loose: true }], - ['@babel/plugin-proposal-private-methods', { loose: true }], - [ - '@babel/plugin-proposal-object-rest-spread', - { - useBuiltIns: true, - }, - ], [ '@babel/plugin-transform-runtime', { diff --git a/package.json b/package.json index a4f10d7983..c3c0ccb61a 100644 --- a/package.json +++ b/package.json @@ -81,15 +81,12 @@ "uuid": "^8.1.0 || ^9.0.0" }, "devDependencies": { - "@babel/cli": "^7.17.6", - "@babel/core": "^7.17.7", - "@babel/plugin-proposal-class-properties": "^7.16.7", - "@babel/plugin-proposal-object-rest-spread": "^7.17.3", - "@babel/plugin-proposal-private-property-in-object": "^7.21.11", - "@babel/plugin-transform-regenerator": "^7.16.7", - "@babel/plugin-transform-runtime": "^7.17.0", - "@babel/preset-env": "^7.16.11", - "@babel/preset-react": "^7.16.7", + "@babel/cli": "^7.22.10", + "@babel/core": "^7.22.10", + "@babel/plugin-transform-regenerator": "^7.22.10", + "@babel/plugin-transform-runtime": "^7.22.10", + "@babel/preset-env": "^7.22.10", + "@babel/preset-react": "^7.22.10", "@pmmmwh/react-refresh-webpack-plugin": "^0.5.4", "@testing-library/dom": "^9.2.0", "@testing-library/jest-dom": "^6.1.5", From bd11b94de5c401f625662a9e84c1c2ebedce3b4c Mon Sep 17 00:00:00 2001 From: Justin Coyne Date: Tue, 29 Oct 2024 15:45:09 -0500 Subject: [PATCH 021/131] Simplify the parameters passed to the button --- src/components/MiradorMenuButton.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/components/MiradorMenuButton.js b/src/components/MiradorMenuButton.js index e1def5a7b8..bb723913c1 100644 --- a/src/components/MiradorMenuButton.js +++ b/src/components/MiradorMenuButton.js @@ -4,9 +4,9 @@ import Badge from '@mui/material/Badge'; import IconButton from '@mui/material/IconButton'; import Tooltip from '@mui/material/Tooltip'; -const Root = styled(IconButton, { name: 'MiradorMenuButton', slot: 'root' })(({ ownerState, theme }) => ({ +const Root = styled(IconButton, { name: 'MiradorMenuButton', slot: 'root' })(({ selected, theme }) => ({ fill: 'currentcolor', - ...(ownerState.selected && { + ...(selected && { backgroundColor: theme.palette.action.selected, }), })); @@ -23,6 +23,7 @@ export function MiradorMenuButton(props) { children, container, dispatch, + selected, BadgeProps, TooltipProps, sx, @@ -31,7 +32,7 @@ export function MiradorMenuButton(props) { const button = ( Date: Tue, 29 Oct 2024 16:22:18 -0500 Subject: [PATCH 022/131] Convert CompanionWindow to functional component --- src/components/CompanionWindow.js | 231 +++++++++++++++--------------- 1 file changed, 112 insertions(+), 119 deletions(-) diff --git a/src/components/CompanionWindow.js b/src/components/CompanionWindow.js index 8a31ce2fb1..3b0d04e28d 100644 --- a/src/components/CompanionWindow.js +++ b/src/components/CompanionWindow.js @@ -1,4 +1,4 @@ -import { Children, cloneElement, Component } from 'react'; +import { Children, cloneElement } from 'react'; import PropTypes from 'prop-types'; import { styled } from '@mui/material/styles'; import CloseIcon from '@mui/icons-material/CloseSharp'; @@ -23,17 +23,17 @@ const StyledCloseButton = styled(MiradorMenuButton, { name: 'CompanionWindow', s /** * CompanionWindow */ -export class CompanionWindow extends Component { +export function CompanionWindow(props) { /** */ - openInNewStyle() { - const { direction } = this.props; + const openInNewStyle = () => { + const { direction } = props; if (direction === 'rtl') return { transform: 'scale(-1, 1)' }; return {}; - } + }; /** */ - resizeHandles() { - const { direction, position } = this.props; + const resizeHandles = () => { + const { direction, position } = props; const positions = { ltr: { default: 'left', @@ -69,126 +69,119 @@ export class CompanionWindow extends Component { } return base; - } + }; + const { + ariaLabel, classes, paperClassName, onCloseClick, updateCompanionWindow, isDisplayed, + position, t, title, children, titleControls, size, + defaultSidebarPanelWidth, defaultSidebarPanelHeight, innerRef, + } = props; - /** - * render - * @return - */ - render() { - const { - ariaLabel, classes, paperClassName, onCloseClick, updateCompanionWindow, isDisplayed, - position, t, title, children, titleControls, size, - defaultSidebarPanelWidth, defaultSidebarPanelHeight, innerRef, - } = this.props; + const isBottom = (position === 'bottom' || position === 'far-bottom'); - const isBottom = (position === 'bottom' || position === 'far-bottom'); - - const childrenWithAdditionalProps = Children.map(children, (child) => { - if (!child) return null; - return cloneElement( - child, - { - parentactions: { - closeCompanionWindow: onCloseClick, - }, + const childrenWithAdditionalProps = Children.map(children, (child) => { + if (!child) return null; + return cloneElement( + child, + { + parentactions: { + closeCompanionWindow: onCloseClick, }, - ); - }); + }, + ); + }); - return ( - + - - - {title} - { - position === 'left' - ? updateCompanionWindow - && ( - { updateCompanionWindow({ position: 'right' }); }} - > - - - ) - : ( - <> - { - updateCompanionWindow && ( - { updateCompanionWindow({ position: position === 'bottom' ? 'right' : 'bottom' }); }} - > - - - ) - } - - - - - ) - } - { - titleControls && ( - + {title} + { + position === 'left' + ? updateCompanionWindow + && ( + { updateCompanionWindow({ position: 'right' }); }} > - {titleControls} - + + ) - } - - - {childrenWithAdditionalProps} - - - - ); - } + : ( + <> + { + updateCompanionWindow && ( + { updateCompanionWindow({ position: position === 'bottom' ? 'right' : 'bottom' }); }} + > + + + ) + } + + + + + ) + } + { + titleControls && ( + + {titleControls} + + ) + } + + + {childrenWithAdditionalProps} + + + + ); } CompanionWindow.propTypes = { @@ -224,7 +217,7 @@ CompanionWindow.defaultProps = { defaultSidebarPanelWidth: 235, innerRef: undefined, isDisplayed: false, - onCloseClick: () => {}, + onCloseClick: () => { }, paperClassName: '', position: null, size: {}, From 19c2694a37fc11be971e4677b110e0294eeebf13 Mon Sep 17 00:00:00 2001 From: marlo-longley Date: Tue, 29 Oct 2024 16:22:46 -0500 Subject: [PATCH 023/131] Remove react-sizeme and repalce with our own HOC --- __tests__/src/extend/withSize.test.js | 50 +++++++++++++++++++ package.json | 1 - setupJest.js | 10 ++-- src/containers/CompanionWindow.js | 4 +- .../WindowCanvasNavigationControls.js | 2 +- src/extend/withSize.js | 47 +++++++++++++++++ 6 files changed, 107 insertions(+), 7 deletions(-) create mode 100644 __tests__/src/extend/withSize.test.js create mode 100644 src/extend/withSize.js diff --git a/__tests__/src/extend/withSize.test.js b/__tests__/src/extend/withSize.test.js new file mode 100644 index 0000000000..ece8055b56 --- /dev/null +++ b/__tests__/src/extend/withSize.test.js @@ -0,0 +1,50 @@ +import { render, screen } from '@testing-library/react'; +import PropTypes from 'prop-types'; +import { withSize } from '../../../src/extend/withSize'; + +/** Mock ResizeObserver */ +class ResizeObserver { + /** */ + constructor(callback) { + this.callback = callback; + } + + /** */ + observe(element) { + // Fake a resize event + setTimeout(() => { + this.callback([{ contentRect: { height: 300, width: 400 } }]); + }, 0); + } + + /** */ + disconnect() { jest.fn(); } // eslint-disable-line +} + +// Replace the global ResizeObserver with the mock +global.ResizeObserver = ResizeObserver; + +/** */ +const TestComponent = ({ size }) => ( +
+ {size.width} + {size.height} +
+); + +TestComponent.propTypes = { + size: PropTypes.shape({ + height: PropTypes.number, + width: PropTypes.number, + }).isRequired, +}; + +const WrappedTestComponent = withSize()(TestComponent); + +test('it should render with size', async () => { + render(); + + // Assert that the updated size is reflected + expect(await screen.findByText(/400/)).toBeInTheDocument(); + expect(await screen.findByText(/300/)).toBeInTheDocument(); +}); diff --git a/package.json b/package.json index 7eff0528f0..49006731e7 100644 --- a/package.json +++ b/package.json @@ -68,7 +68,6 @@ "react-redux": "^8.0.0 || ^9.0.0", "react-resize-observer": "^1.1.1", "react-rnd": "^10.1", - "react-sizeme": "^2.6.7 || ^3.0.0", "react-virtualized-auto-sizer": "^1.0.2", "react-window": "^1.8.5", "redux": "^5.0.0", diff --git a/setupJest.js b/setupJest.js index d5a0664075..af9f272bcf 100644 --- a/setupJest.js +++ b/setupJest.js @@ -1,18 +1,22 @@ /* eslint-disable import/no-extraneous-dependencies */ import fetchMock from 'jest-fetch-mock'; -import sizeMe from 'react-sizeme'; import i18next from 'i18next'; import { setupIntersectionMocking } from 'react-intersection-observer/test-utils'; import en from './src/locales/en/translation.json'; jest.setTimeout(10000); -sizeMe.noPlaceholders = true; - const { TextEncoder } = require('util'); global.TextEncoder = TextEncoder; +// Mock the browser's native ResizeObserver +global.ResizeObserver = jest.fn().mockImplementation(() => ({ + disconnect: jest.fn(), + observe: jest.fn(), + unobserve: jest.fn(), +})); + // Setup Jest to mock fetch fetchMock.enableMocks(); diff --git a/src/containers/CompanionWindow.js b/src/containers/CompanionWindow.js index 64a1806440..4747d9c166 100644 --- a/src/containers/CompanionWindow.js +++ b/src/containers/CompanionWindow.js @@ -1,7 +1,7 @@ import { compose } from 'redux'; import { connect } from 'react-redux'; import { withTranslation } from 'react-i18next'; -import { withSize } from 'react-sizeme'; +import { withSize } from '../extend/withSize'; import { withPlugins } from '../extend/withPlugins'; import { withRef } from '../extend/withRef'; import * as actions from '../state/actions'; @@ -46,8 +46,8 @@ const mapDispatchToProps = (dispatch, { windowId, id }) => ({ const enhance = compose( withRef(), - withTranslation(), withSize(), + withTranslation(), connect(mapStateToProps, mapDispatchToProps), withPlugins('CompanionWindow'), ); diff --git a/src/containers/WindowCanvasNavigationControls.js b/src/containers/WindowCanvasNavigationControls.js index ca5088f34b..91b62e584c 100644 --- a/src/containers/WindowCanvasNavigationControls.js +++ b/src/containers/WindowCanvasNavigationControls.js @@ -1,6 +1,6 @@ import { connect } from 'react-redux'; import { compose } from 'redux'; -import { withSize } from 'react-sizeme'; +import { withSize } from '../extend/withSize'; import { withPlugins } from '../extend/withPlugins'; import { getShowZoomControlsConfig, getWorkspace } from '../state/selectors'; import { WindowCanvasNavigationControls } from '../components/WindowCanvasNavigationControls'; diff --git a/src/extend/withSize.js b/src/extend/withSize.js new file mode 100644 index 0000000000..14f2d136e9 --- /dev/null +++ b/src/extend/withSize.js @@ -0,0 +1,47 @@ +/** This file was written to replace https://github.com/ctrlplusb/react-sizeme + * when its dependencies went out of date and is very much inspired by its code. + */ + +import { useEffect, useRef, useState } from 'react'; + +/** */ +export function withSize() { + return function WrapComponent(WrappedComponent) { + /** */ + const SizeAwareComponent = (props) => { + const [size, setSize] = useState({ height: undefined, width: undefined }); + const elementRef = useRef(null); + const observerRef = useRef(null); + + useEffect(() => { + /** */ + const handleResize = (entries) => { + for (const entry of entries) { + const { width, height } = entry.contentRect; + setSize({ height, width }); + } + }; + + observerRef.current = new ResizeObserver(handleResize); + + if (elementRef.current) { + observerRef.current.observe(elementRef.current); + } + + return () => { + if (observerRef.current) { + observerRef.current.disconnect(); + } + }; + }, []); + + return ( +
+ +
+ ); + }; + + return SizeAwareComponent; + }; +} From 599572b4fdc9171df37d13e65e68669c1d6ff920 Mon Sep 17 00:00:00 2001 From: Chris Beer Date: Wed, 30 Oct 2024 07:56:27 -0700 Subject: [PATCH 024/131] Update webpack-dev-server --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index aca9e491d0..d135a17d74 100644 --- a/package.json +++ b/package.json @@ -130,7 +130,7 @@ "terser-webpack-plugin": "^5.3.1", "webpack": "^5.70.0", "webpack-cli": "^5.0.0", - "webpack-dev-server": "^4.7.4" + "webpack-dev-server": "^5.1.0" }, "peerDependencies": { "react": "^18.0.0", From 5587a23d759f87dc23cd38e712a20801c7eefa2e Mon Sep 17 00:00:00 2001 From: Justin Coyne Date: Wed, 30 Oct 2024 09:57:55 -0500 Subject: [PATCH 025/131] Use act() to ensure all promises are resolved This clears a warning for not using act() --- .../SidebarIndexTableOfContents.test.js | 41 ++++++++++++++----- 1 file changed, 30 insertions(+), 11 deletions(-) diff --git a/__tests__/src/components/SidebarIndexTableOfContents.test.js b/__tests__/src/components/SidebarIndexTableOfContents.test.js index af3f9885db..d365de40a6 100644 --- a/__tests__/src/components/SidebarIndexTableOfContents.test.js +++ b/__tests__/src/components/SidebarIndexTableOfContents.test.js @@ -1,7 +1,7 @@ import { render, screen, waitFor } from 'test-utils'; import userEvent from '@testing-library/user-event'; import { Utils } from 'manifesto.js'; - +import { act } from '@testing-library/react'; import { SidebarIndexTableOfContents } from '../../../src/components/SidebarIndexTableOfContents'; import ConnectedSidebarIndexTableOfContents from '../../../src/containers/SidebarIndexTableOfContents'; import manifestVersion2 from '../../fixtures/version-2/structures.json'; @@ -139,11 +139,14 @@ describe('SidebarIndexTableOfContents', () => { const { store } = createInteractiveWrapper({}); const root = screen.getByRole('treeitem'); - - root.focus(); + act(() => { + root.focus(); + }); await user.keyboard('{ArrowRight}'); + expect(screen.getAllByRole('treeitem')).toHaveLength(5); await user.keyboard('{ArrowLeft}'); + await waitFor(() => { expect(screen.getByRole('treeitem')).toBeInTheDocument(); }); @@ -157,7 +160,9 @@ describe('SidebarIndexTableOfContents', () => { const { store } = createInteractiveWrapper({}); const root = screen.getByRole('treeitem'); - root.focus(); + act(() => { + root.focus(); + }); await user.keyboard('{Enter}'); expect(screen.getAllByRole('treeitem')).toHaveLength(5); await user.keyboard('{ArrowLeft}'); @@ -176,12 +181,16 @@ describe('SidebarIndexTableOfContents', () => { const { store } = createInteractiveWrapper({}); const root = screen.getByRole('treeitem'); - root.focus(); + act(() => { + root.focus(); + }); await user.keyboard('{Enter}'); const leafNode = screen.getAllByRole('treeitem')[1]; - leafNode.focus(); + act(() => { + leafNode.focus(); + }); await user.keyboard('{Enter}'); expect(store.getState().windows.a.canvasId).toEqual('http://foo.test/1/canvas/c2'); @@ -197,7 +206,9 @@ describe('SidebarIndexTableOfContents', () => { }); const leafNode = screen.getAllByRole('treeitem')[3]; - leafNode.focus(); + act(() => { + leafNode.focus(); + }); await user.keyboard('{Enter}'); expect(setCanvas).toHaveBeenLastCalledWith('a', 'http://foo.test/1/canvas/c11'); @@ -211,21 +222,29 @@ describe('SidebarIndexTableOfContents', () => { }); const root = screen.getByRole('treeitem'); - root.focus(); + act(() => { + root.focus(); + }); await user.keyboard('{Enter}'); const leafNode1 = screen.getAllByRole('treeitem')[2]; - leafNode1.focus(); + act(() => { + leafNode1.focus(); + }); await user.keyboard('{Enter}'); expect(store.getState().windows.a.canvasId).toEqual('http://foo.test/1/canvas/c7'); const leafNode2 = screen.getAllByRole('treeitem')[3]; - leafNode2.focus(); + act(() => { + leafNode2.focus(); + }); await user.keyboard('{Enter}'); expect(store.getState().windows.a.canvasId).toEqual('http://foo.test/1/canvas/c9'); const leafNode3 = screen.getAllByRole('treeitem')[4]; - leafNode3.focus(); + act(() => { + leafNode3.focus(); + }); await user.keyboard('{Enter}'); expect(store.getState().windows.a.canvasId).toEqual('http://foo.test/1/canvas/c10'); }); From c16e8055977a2e0a6c4f0a55c817b7f0b9f1878e Mon Sep 17 00:00:00 2001 From: Chris Beer Date: Wed, 30 Oct 2024 08:14:05 -0700 Subject: [PATCH 026/131] Extend uuid version support. --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index aca9e491d0..2dd916e5da 100644 --- a/package.json +++ b/package.json @@ -77,7 +77,7 @@ "stylis": "^4.3.0", "stylis-plugin-rtl": "^2.1.1", "url": "^0.11.0", - "uuid": "^8.1.0 || ^9.0.0" + "uuid": "^8.1.0 || ^9.0.0 || ^10.0.0 || ^11.0.0" }, "devDependencies": { "@babel/cli": "^7.22.10", From c7872bfa02e34eec0aec23267e180bf004d39d1e Mon Sep 17 00:00:00 2001 From: Lutz Helm Date: Thu, 15 Aug 2024 16:06:08 +0200 Subject: [PATCH 027/131] Include OpenSeadragon v5 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index d135a17d74..6198ff9303 100644 --- a/package.json +++ b/package.json @@ -51,7 +51,7 @@ "lodash": "^4.17.11", "manifesto.js": "^4.2.0", "normalize-url": "^4.5.0", - "openseadragon": "^2.4.2 || ^3.0.0 || 4.0.x || ^4.1.1", + "openseadragon": "^2.4.2 || ^3.0.0 || 4.0.x || ^4.1.1 || ^5.0.0", "prop-types": "^15.6.2", "rdndmb-html5-to-touch": "^8.0.0", "re-reselect": "^5.0.0", From 9091f04d8b4a8938c3801e5ba6b39e343c5db5ff Mon Sep 17 00:00:00 2001 From: Chris Beer Date: Wed, 30 Oct 2024 09:13:21 -0700 Subject: [PATCH 028/131] Update test stubbing to work with OSD 5.x --- __tests__/src/components/OpenSeadragonViewer.test.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/__tests__/src/components/OpenSeadragonViewer.test.js b/__tests__/src/components/OpenSeadragonViewer.test.js index 464c1d4aa9..b6f08fddac 100644 --- a/__tests__/src/components/OpenSeadragonViewer.test.js +++ b/__tests__/src/components/OpenSeadragonViewer.test.js @@ -172,9 +172,9 @@ describe('OpenSeadragonViewer', () => { }); it('calls addNonTileSource for every nonTiledImage and then zoomsToWorld', async () => { - const { component, rerender, viewer } = createWrapper({ nonTiledImages: [] }); + const { component, rerender, viewer } = createWrapper({ infoResponses: [], nonTiledImages: [] }); - const mockAddNonTiledImage = jest.spyOn(viewer, 'addSimpleImage'); + const mockAddNonTiledImage = jest.spyOn(viewer, 'addSimpleImage').mockImplementation(() => true); const mockFitBounds = jest.spyOn(viewer.viewport, 'fitBounds'); rerender(cloneElement(component, { From 3362d855a9e1ac637970b9cc2420443dad0b7f65 Mon Sep 17 00:00:00 2001 From: marlo-longley Date: Tue, 29 Oct 2024 17:31:26 -0500 Subject: [PATCH 029/131] Stop using defaultProps in MosaicRenderPreview component --- src/components/MosaicRenderPreview.js | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/src/components/MosaicRenderPreview.js b/src/components/MosaicRenderPreview.js index 201a650a32..a0ae3ea0c9 100644 --- a/src/components/MosaicRenderPreview.js +++ b/src/components/MosaicRenderPreview.js @@ -2,25 +2,24 @@ import PropTypes from 'prop-types'; import MinimalWindow from '../containers/MinimalWindow'; /** - * MosaicRenderPreview is used to for the preview when dragging a mosaic window/tile -*/ -export function MosaicRenderPreview(props) { - const { - t, title, windowId, - } = props; - + * MosaicRenderPreview is used for the preview when dragging a mosaic window/tile + */ +export function MosaicRenderPreview({ + t = k => k, + title = '', + windowId = '', +}) { return ( - + ); } MosaicRenderPreview.propTypes = { t: PropTypes.func, title: PropTypes.string, - windowId: PropTypes.string.isRequired, // eslint-disable-line react/no-unused-prop-types -}; - -MosaicRenderPreview.defaultProps = { - t: k => k, - title: '', + windowId: PropTypes.string.isRequired, }; From db13611b4cd35352328b2bcf8dace6b15723f4d1 Mon Sep 17 00:00:00 2001 From: marlo-longley Date: Wed, 30 Oct 2024 11:49:20 -0500 Subject: [PATCH 030/131] Disable react/require-default-props eslint rule --- .eslintrc | 1 + 1 file changed, 1 insertion(+) diff --git a/.eslintrc b/.eslintrc index 596e1115f2..6d549eac24 100644 --- a/.eslintrc +++ b/.eslintrc @@ -44,6 +44,7 @@ }], "react/jsx-uses-react": "off", "react/react-in-jsx-scope": "off", + "react/require-default-props": "off", "react-hooks/exhaustive-deps": "error", "testing-library/render-result-naming-convention": "off", "testing-library/no-render-in-lifecycle": [ From 9c423bb00ad77511e9f0050299257f5cc4247f8a Mon Sep 17 00:00:00 2001 From: Justin Coyne Date: Wed, 30 Oct 2024 17:24:35 -0500 Subject: [PATCH 031/131] Remove unmaintined airbnb and flowtype eslint plugins These prevent upgrading to eslint 9 --- .eslintrc | 2 +- package.json | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/.eslintrc b/.eslintrc index 6d549eac24..48cc6a0638 100644 --- a/.eslintrc +++ b/.eslintrc @@ -2,7 +2,7 @@ "env": { "jest/globals": true }, - "extends": ["airbnb","react-app", "plugin:jest-dom/recommended", "plugin:testing-library/react"], + "extends": ["react-app", "plugin:jest-dom/recommended", "plugin:testing-library/react"], "globals": { "page": true, "document": true diff --git a/package.json b/package.json index b2ef3d72b2..3252bebbfb 100644 --- a/package.json +++ b/package.json @@ -103,9 +103,7 @@ "chalk": "^4.1.0", "core-js": "^3.21.1", "eslint": "^8.11.0", - "eslint-config-airbnb": "^19.0.4", "eslint-config-react-app": "^7.0.0", - "eslint-plugin-flowtype": "^8.0.3", "eslint-plugin-import": "^2.25.4", "eslint-plugin-jest": "^27.1.5", "eslint-plugin-jest-dom": "^5.1.0", From 7f2e2fc6f90bcd91486ff8c3e41442636ea87f26 Mon Sep 17 00:00:00 2001 From: Justin Coyne Date: Wed, 30 Oct 2024 17:27:20 -0500 Subject: [PATCH 032/131] Revert "Remove unmaintined airbnb and flowtype eslint plugins" This reverts commit 9c423bb00ad77511e9f0050299257f5cc4247f8a. --- .eslintrc | 2 +- package.json | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.eslintrc b/.eslintrc index 48cc6a0638..6d549eac24 100644 --- a/.eslintrc +++ b/.eslintrc @@ -2,7 +2,7 @@ "env": { "jest/globals": true }, - "extends": ["react-app", "plugin:jest-dom/recommended", "plugin:testing-library/react"], + "extends": ["airbnb","react-app", "plugin:jest-dom/recommended", "plugin:testing-library/react"], "globals": { "page": true, "document": true diff --git a/package.json b/package.json index 3252bebbfb..b2ef3d72b2 100644 --- a/package.json +++ b/package.json @@ -103,7 +103,9 @@ "chalk": "^4.1.0", "core-js": "^3.21.1", "eslint": "^8.11.0", + "eslint-config-airbnb": "^19.0.4", "eslint-config-react-app": "^7.0.0", + "eslint-plugin-flowtype": "^8.0.3", "eslint-plugin-import": "^2.25.4", "eslint-plugin-jest": "^27.1.5", "eslint-plugin-jest-dom": "^5.1.0", From 3e61c3223c81827cfda09e85550b43190fddfa52 Mon Sep 17 00:00:00 2001 From: Justin Coyne Date: Thu, 31 Oct 2024 08:46:17 -0500 Subject: [PATCH 033/131] Fix warnings about usage of i18n ``` Caution: `i18n` also has a named export `createInstance`. Check if you meant to write `import {createInstance} from 'i18next'` instead ``` --- __tests__/src/components/CanvasAnnotations.test.js | 4 ++-- __tests__/src/components/ErrorContent.test.js | 6 +++--- __tests__/src/components/SearchPanel.test.js | 4 ++-- .../src/components/WindowSideBarAnnotationsPanel.test.js | 4 ++-- __tests__/src/components/WindowSideBarButtons.test.js | 4 ++-- src/i18n.js | 4 ++-- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/__tests__/src/components/CanvasAnnotations.test.js b/__tests__/src/components/CanvasAnnotations.test.js index eef2ad78f7..d5eb9fc354 100644 --- a/__tests__/src/components/CanvasAnnotations.test.js +++ b/__tests__/src/components/CanvasAnnotations.test.js @@ -1,6 +1,6 @@ import { render, screen } from 'test-utils'; import userEvent from '@testing-library/user-event'; -import i18next from 'i18next'; +import { t } from 'i18next'; import { CanvasAnnotations } from '../../../src/components/CanvasAnnotations'; import { ScrollTo } from '../../../src/components/ScrollTo'; @@ -15,7 +15,7 @@ function createWrapper(props) { index={0} label="A Canvas Label" selectAnnotation={() => {}} - t={i18next.t} + t={t} totalSize={1} windowId="abc" {...props} diff --git a/__tests__/src/components/ErrorContent.test.js b/__tests__/src/components/ErrorContent.test.js index 8662d26cb7..f87af1cfbe 100644 --- a/__tests__/src/components/ErrorContent.test.js +++ b/__tests__/src/components/ErrorContent.test.js @@ -1,4 +1,4 @@ -import i18next from 'i18next'; +import { t } from 'i18next'; import { render, screen } from 'test-utils'; import { ErrorContent } from '../../../src/components/ErrorContent'; @@ -11,7 +11,7 @@ describe('ErrorContent', () => { windowId="xyz" manifestId="foo" classes={{}} - t={i18next.t} + t={t} />, { preloadedState: { @@ -42,7 +42,7 @@ describe('ErrorContent', () => { manifestId="foo" showJsError={false} classes={{}} - t={i18next.t} + t={t} />, { preloadedState: { diff --git a/__tests__/src/components/SearchPanel.test.js b/__tests__/src/components/SearchPanel.test.js index cd7b50ee01..f69d82fa95 100644 --- a/__tests__/src/components/SearchPanel.test.js +++ b/__tests__/src/components/SearchPanel.test.js @@ -1,6 +1,6 @@ import { render, screen } from 'test-utils'; import userEvent from '@testing-library/user-event'; -import i18next from 'i18next'; +import { t } from 'i18next'; import { SearchPanel } from '../../../src/components/SearchPanel'; @@ -68,7 +68,7 @@ describe('SearchPanel', () => { const user = userEvent.setup(); const fetchSearch = jest.fn(); createWrapper({ - fetchSearch, query: '', suggestedSearches: ['abc'], t: i18next.t, + fetchSearch, query: '', suggestedSearches: ['abc'], t, }); expect(screen.getByRole('button', { name: 'Search this document for "abc"' })).toBeInTheDocument(); diff --git a/__tests__/src/components/WindowSideBarAnnotationsPanel.test.js b/__tests__/src/components/WindowSideBarAnnotationsPanel.test.js index 6faa978d6d..6aa4b1f564 100644 --- a/__tests__/src/components/WindowSideBarAnnotationsPanel.test.js +++ b/__tests__/src/components/WindowSideBarAnnotationsPanel.test.js @@ -1,5 +1,5 @@ import { render, screen } from 'test-utils'; -import i18next from 'i18next'; +import { t } from 'i18next'; import CanvasAnnotations from '../../../src/containers/CanvasAnnotations'; import { WindowSideBarAnnotationsPanel } from '../../../src/components/WindowSideBarAnnotationsPanel'; @@ -11,7 +11,7 @@ function createWrapper(props, state) { annotationCount={4} classes={{}} id="xyz" - t={i18next.t} + t={t} windowId="abc" {...props} />, diff --git a/__tests__/src/components/WindowSideBarButtons.test.js b/__tests__/src/components/WindowSideBarButtons.test.js index e2b03bf31f..919733154d 100644 --- a/__tests__/src/components/WindowSideBarButtons.test.js +++ b/__tests__/src/components/WindowSideBarButtons.test.js @@ -1,6 +1,6 @@ import { render, screen } from 'test-utils'; import userEvent from '@testing-library/user-event'; -import i18next from 'i18next'; +import { t } from 'i18next'; import { WindowSideBarButtons } from '../../../src/components/WindowSideBarButtons'; /** create wrapper */ @@ -8,7 +8,7 @@ function createWrapper(props) { return render( {}} - t={i18next.t} + t={t} {...props} panels={{ annotations: true, diff --git a/src/i18n.js b/src/i18n.js index fb4531a24d..3f6d0f4f2f 100644 --- a/src/i18n.js +++ b/src/i18n.js @@ -1,4 +1,4 @@ -import i18n from 'i18next'; +import { createInstance } from 'i18next'; import { initReactI18next } from 'react-i18next'; import ar from './locales/ar/translation.json'; import de from './locales/de/translation.json'; @@ -50,7 +50,7 @@ function createI18nInstance() { 'zh-TW': zhTw, }; - const instance = i18n.createInstance(); + const instance = createInstance(); instance.use(initReactI18next).init({ fallbackLng: 'en', interpolation: { From 1d193902c505a88ffbaebea7125ba436bae353c9 Mon Sep 17 00:00:00 2001 From: Chris Beer Date: Wed, 6 Nov 2024 08:57:42 -0800 Subject: [PATCH 034/131] Remove canvas. --- package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/package.json b/package.json index b2ef3d72b2..d6e9fe0cff 100644 --- a/package.json +++ b/package.json @@ -99,7 +99,6 @@ "babel-plugin-macros": "^3.0.1", "babel-plugin-transform-react-remove-prop-types": "^0.4.24", "bundlewatch": "^0.4.0", - "canvas": "^2.11.0", "chalk": "^4.1.0", "core-js": "^3.21.1", "eslint": "^8.11.0", From ae92d5630ea2bca9fd13519f7c0b231eb5b4a6ac Mon Sep 17 00:00:00 2001 From: Chris Beer Date: Wed, 6 Nov 2024 09:11:38 -0800 Subject: [PATCH 035/131] Skip two tests that seem to require canvas. --- __tests__/src/components/AttributionPanel.test.js | 3 ++- __tests__/src/components/OpenSeadragonViewer.test.js | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/__tests__/src/components/AttributionPanel.test.js b/__tests__/src/components/AttributionPanel.test.js index f67927d823..21e55cf083 100644 --- a/__tests__/src/components/AttributionPanel.test.js +++ b/__tests__/src/components/AttributionPanel.test.js @@ -44,7 +44,8 @@ describe('AttributionPanel', () => { expect(screen.queryByText('rights')).not.toBeInTheDocument(); }); - it('renders the manifest logo', async () => { + // Requires canvas to handle img loading. + it.skip('renders the manifest logo', async () => { const manifestLogo = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mMMDQmtBwADgwF/Op8FmAAAAABJRU5ErkJggg=='; const { container } = createWrapper({ manifestLogo }); diff --git a/__tests__/src/components/OpenSeadragonViewer.test.js b/__tests__/src/components/OpenSeadragonViewer.test.js index b6f08fddac..14ebba6153 100644 --- a/__tests__/src/components/OpenSeadragonViewer.test.js +++ b/__tests__/src/components/OpenSeadragonViewer.test.js @@ -274,7 +274,8 @@ describe('OpenSeadragonViewer', () => { }); describe('componentDidUpdate', () => { - it('calls the OSD viewport panTo and zoomTo with the component state and forces a redraw', () => { + // Requires canvas to handle canvas-y stuff. + it.skip('calls the OSD viewport panTo and zoomTo with the component state and forces a redraw', () => { const { component, rerender, viewer } = createWrapper({}); rerender(cloneElement(component, { From 9ada1735456050f50b7f88d9eb9386efbca92550 Mon Sep 17 00:00:00 2001 From: Justin Coyne Date: Tue, 29 Oct 2024 15:41:10 -0500 Subject: [PATCH 036/131] Use ES6 default arguments to avoid deprecated defaultProps on function components (and update the eslint rules accordingly.) --- .eslintrc | 4 +++- src/components/BackgroundPluginArea.js | 8 ++------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/.eslintrc b/.eslintrc index 6d549eac24..02a0b7d930 100644 --- a/.eslintrc +++ b/.eslintrc @@ -44,7 +44,9 @@ }], "react/jsx-uses-react": "off", "react/react-in-jsx-scope": "off", - "react/require-default-props": "off", + "react/require-default-props": [2, { + "functions": "defaultArguments" + }], "react-hooks/exhaustive-deps": "error", "testing-library/render-result-naming-convention": "off", "testing-library/no-render-in-lifecycle": [ diff --git a/src/components/BackgroundPluginArea.js b/src/components/BackgroundPluginArea.js index c59c745e6a..90b8b9c537 100644 --- a/src/components/BackgroundPluginArea.js +++ b/src/components/BackgroundPluginArea.js @@ -3,16 +3,12 @@ import ns from '../config/css-ns'; import { PluginHook } from './PluginHook'; /** invisible area where background plugins can add to */ -export const BackgroundPluginArea = props => ( +export const BackgroundPluginArea = ({ PluginComponents = [], ...props }) => (
- +
); BackgroundPluginArea.propTypes = { PluginComponents: PropTypes.array, // eslint-disable-line react/forbid-prop-types }; - -BackgroundPluginArea.defaultProps = { - PluginComponents: [], -}; From c0409cec6379f3255094fc2178f5f746854ed1dc Mon Sep 17 00:00:00 2001 From: Chris Beer Date: Wed, 6 Nov 2024 10:14:45 -0800 Subject: [PATCH 037/131] Use ES6 destructuring on the other functional components. --- .../components/ThumbnailNavigation.test.js | 2 +- src/components/AudioViewer.js | 12 +---- src/components/CompanionWindow.js | 46 +++++-------------- src/components/IIIFIFrameCommunication.js | 24 +++++----- src/components/IIIFThumbnail.js | 10 +--- src/components/MiradorMenuButton.js | 37 ++++++--------- src/components/MosaicRenderPreview.js | 2 +- .../ScrollIndicatedDialogContent.js | 8 +--- src/extend/PluginProvider.js | 8 +--- 9 files changed, 44 insertions(+), 105 deletions(-) diff --git a/__tests__/src/components/ThumbnailNavigation.test.js b/__tests__/src/components/ThumbnailNavigation.test.js index bf7c89ae4d..0cb5607614 100644 --- a/__tests__/src/components/ThumbnailNavigation.test.js +++ b/__tests__/src/components/ThumbnailNavigation.test.js @@ -28,7 +28,7 @@ function Subject({ fixture = manifestJson, ...props }) { } Subject.propTypes = { - fixture: PropTypes.object.isRequired, // eslint-disable-line react/forbid-prop-types + fixture: PropTypes.object, // eslint-disable-line react/forbid-prop-types }; jest.mock( diff --git a/src/components/AudioViewer.js b/src/components/AudioViewer.js index 9ceb07d788..710b5aaedd 100644 --- a/src/components/AudioViewer.js +++ b/src/components/AudioViewer.js @@ -13,12 +13,8 @@ const StyledAudio = styled('audio')({ }); /** */ -export function AudioViewer(props) { +export function AudioViewer({ audioOptions = {}, audioResources = [], captions = [] }) { /* eslint-disable jsx-a11y/media-has-caption */ - /** */ - const { - captions, audioOptions, audioResources, - } = props; return ( @@ -44,9 +40,3 @@ AudioViewer.propTypes = { audioResources: PropTypes.arrayOf(PropTypes.object), // eslint-disable-line react/forbid-prop-types captions: PropTypes.arrayOf(PropTypes.object), // eslint-disable-line react/forbid-prop-types }; - -AudioViewer.defaultProps = { - audioOptions: {}, - audioResources: [], - captions: [], -}; diff --git a/src/components/CompanionWindow.js b/src/components/CompanionWindow.js index 3b0d04e28d..26b9fd7498 100644 --- a/src/components/CompanionWindow.js +++ b/src/components/CompanionWindow.js @@ -23,17 +23,18 @@ const StyledCloseButton = styled(MiradorMenuButton, { name: 'CompanionWindow', s /** * CompanionWindow */ -export function CompanionWindow(props) { +export function CompanionWindow(props) { // eslint-disable-line react/require-default-props + const { + ariaLabel = undefined, classes = {}, direction, paperClassName = '', onCloseClick = () => {}, updateCompanionWindow = undefined, isDisplayed = false, + position = null, t = key => key, title = null, children = undefined, titleControls = null, size = {}, + defaultSidebarPanelWidth = 235, defaultSidebarPanelHeight = 201, innerRef = undefined, + } = props; + /** */ - const openInNewStyle = () => { - const { direction } = props; - if (direction === 'rtl') return { transform: 'scale(-1, 1)' }; - return {}; - }; + const openInNewStyle = direction === 'rtl' ? { transform: 'scale(-1, 1)' } : {}; /** */ - const resizeHandles = () => { - const { direction, position } = props; + const resizeHandles = (() => { const positions = { ltr: { default: 'left', @@ -69,12 +70,7 @@ export function CompanionWindow(props) { } return base; - }; - const { - ariaLabel, classes, paperClassName, onCloseClick, updateCompanionWindow, isDisplayed, - position, t, title, children, titleControls, size, - defaultSidebarPanelWidth, defaultSidebarPanelHeight, innerRef, - } = props; + })(); const isBottom = (position === 'bottom' || position === 'far-bottom'); @@ -111,7 +107,7 @@ export function CompanionWindow(props) { width: isBottom ? 'auto' : defaultSidebarPanelWidth, }} disableDragging - enableResizing={resizeHandles()} + enableResizing={resizeHandles} minHeight={50} minWidth={position === 'left' ? 235 : 100} > @@ -130,7 +126,7 @@ export function CompanionWindow(props) { aria-label={t('openInCompanionWindow')} onClick={() => { updateCompanionWindow({ position: 'right' }); }} > - + ) : ( @@ -208,21 +204,3 @@ CompanionWindow.propTypes = { titleControls: PropTypes.node, updateCompanionWindow: PropTypes.func, }; - -CompanionWindow.defaultProps = { - ariaLabel: undefined, - children: undefined, - classes: {}, - defaultSidebarPanelHeight: 201, - defaultSidebarPanelWidth: 235, - innerRef: undefined, - isDisplayed: false, - onCloseClick: () => { }, - paperClassName: '', - position: null, - size: {}, - t: key => key, - title: null, - titleControls: null, - updateCompanionWindow: undefined, -}; diff --git a/src/components/IIIFIFrameCommunication.js b/src/components/IIIFIFrameCommunication.js index c26ef42dad..37b8211188 100644 --- a/src/components/IIIFIFrameCommunication.js +++ b/src/components/IIIFIFrameCommunication.js @@ -1,10 +1,20 @@ import { useEffect } from 'react'; import PropTypes from 'prop-types'; +const IIIFIFrameCommunicationDefaultProps = { + 'aria-hidden': true, + frameBorder: 0, + height: 1, + name: undefined, + scrolling: undefined, + style: { visibility: 'hidden' }, + width: 1, +}; + /** * Handle IIIF Auth token validation using iframe message events */ -export function IIIFIFrameCommunication({ handleReceiveMessage, ...props }) { +export function IIIFIFrameCommunication({ handleReceiveMessage = undefined, ...props }) { // Attaches the 'message' event listener to the window. useEffect(() => { if (!handleReceiveMessage) return undefined; @@ -19,6 +29,7 @@ export function IIIFIFrameCommunication({ handleReceiveMessage, ...props }) { // iframe "title" attribute is passed in via props for accessibility // eslint-disable-next-line jsx-a11y/iframe-has-title