dbf-mirador 4.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +203 -0
- package/README.md +133 -0
- package/dist/CommentSharp-B0J_-jEq.js +325 -0
- package/dist/CommentSharp-B0J_-jEq.js.map +1 -0
- package/dist/FailedImageContext-aQXnWSHN.js +318 -0
- package/dist/FailedImageContext-aQXnWSHN.js.map +1 -0
- package/dist/PluginHook-CFw_6P5c.js +54 -0
- package/dist/PluginHook-CFw_6P5c.js.map +1 -0
- package/dist/WindowCanvasNavigationControls-CUX723BQ.js +242 -0
- package/dist/WindowCanvasNavigationControls-CUX723BQ.js.map +1 -0
- package/dist/action-types-DjIbTE-A.js +74 -0
- package/dist/action-types-DjIbTE-A.js.map +1 -0
- package/dist/canvas-C8oHvXFN.js +41 -0
- package/dist/canvas-C8oHvXFN.js.map +1 -0
- package/dist/canvases-gRqhr-IH.js +3154 -0
- package/dist/canvases-gRqhr-IH.js.map +1 -0
- package/dist/createSvgIcon-Cwt8YPfm.js +2 -0
- package/dist/getters-COus7Mvg.js +2066 -0
- package/dist/getters-COus7Mvg.js.map +1 -0
- package/dist/index.module-CbBRf_R8.js +403 -0
- package/dist/index.module-CbBRf_R8.js.map +1 -0
- package/dist/mirador.es.js +39600 -0
- package/dist/mirador.es.js.map +1 -0
- package/dist/mirador.min.js +334 -0
- package/dist/mirador.min.js.map +1 -0
- package/dist/react-error-boundary.esm-B_pT-oCS.js +67 -0
- package/dist/react-error-boundary.esm-B_pT-oCS.js.map +1 -0
- package/dist/visuallyHidden-DmYvwNdU.js +98 -0
- package/dist/visuallyHidden-DmYvwNdU.js.map +1 -0
- package/dist/window-zelwU7wz.js +138 -0
- package/dist/window-zelwU7wz.js.map +1 -0
- package/package.json +138 -0
- package/src/components/AccessTokenSender.jsx +34 -0
- package/src/components/AnnotationSettings.jsx +31 -0
- package/src/components/AnnotationsOverlay.jsx +328 -0
- package/src/components/App.jsx +34 -0
- package/src/components/AppProviders.jsx +129 -0
- package/src/components/AttributionPanel.jsx +78 -0
- package/src/components/AudioViewer.jsx +39 -0
- package/src/components/BackgroundPluginArea.jsx +9 -0
- package/src/components/Branding.jsx +33 -0
- package/src/components/CanvasAnnotations.jsx +125 -0
- package/src/components/CanvasInfo.jsx +46 -0
- package/src/components/CanvasLayers.jsx +367 -0
- package/src/components/ChangeThemeDialog.jsx +65 -0
- package/src/components/CollapsibleSection.jsx +53 -0
- package/src/components/CollectionDialog.jsx +236 -0
- package/src/components/CollectionInfo.jsx +48 -0
- package/src/components/CompanionArea.jsx +140 -0
- package/src/components/CompanionWindow.jsx +228 -0
- package/src/components/CompanionWindowFactory.jsx +38 -0
- package/src/components/CompanionWindowSection.jsx +11 -0
- package/src/components/CustomPanel.jsx +22 -0
- package/src/components/ErrorContent.jsx +65 -0
- package/src/components/ErrorDialog.jsx +47 -0
- package/src/components/FullScreenButton.jsx +47 -0
- package/src/components/GalleryView.jsx +36 -0
- package/src/components/GalleryViewThumbnail.jsx +160 -0
- package/src/components/IIIFAuthentication.jsx +144 -0
- package/src/components/IIIFDropTarget.jsx +168 -0
- package/src/components/IIIFIFrameCommunication.jsx +45 -0
- package/src/components/IIIFResourceLabel.jsx +26 -0
- package/src/components/IIIFThumbnail.jsx +214 -0
- package/src/components/ImageFailureMessage.jsx +42 -0
- package/src/components/LabelValueMetadata.jsx +46 -0
- package/src/components/LanguageSettings.jsx +46 -0
- package/src/components/LayersPanel.jsx +24 -0
- package/src/components/LocalePicker.jsx +56 -0
- package/src/components/ManifestForm.jsx +79 -0
- package/src/components/ManifestInfo.jsx +67 -0
- package/src/components/ManifestListItem.jsx +209 -0
- package/src/components/ManifestListItemError.jsx +53 -0
- package/src/components/ManifestRelatedLinks.jsx +154 -0
- package/src/components/MinimalWindow.jsx +104 -0
- package/src/components/MiradorMenuButton.jsx +71 -0
- package/src/components/MosaicRenderPreview.jsx +16 -0
- package/src/components/NestedMenu.jsx +42 -0
- package/src/components/NewBrowserWindow.jsx +34 -0
- package/src/components/OpenSeadragonComponent.jsx +258 -0
- package/src/components/OpenSeadragonTileSource.jsx +105 -0
- package/src/components/OpenSeadragonViewer.jsx +161 -0
- package/src/components/PluginHook.jsx +27 -0
- package/src/components/PrimaryWindow.jsx +115 -0
- package/src/components/SanitizedHtml.jsx +37 -0
- package/src/components/ScrollIndicatedDialogContent.jsx +60 -0
- package/src/components/ScrollTo.jsx +61 -0
- package/src/components/SearchHit.jsx +220 -0
- package/src/components/SearchPanel.jsx +80 -0
- package/src/components/SearchPanelControls.jsx +174 -0
- package/src/components/SearchPanelNavigation.jsx +84 -0
- package/src/components/SearchResults.jsx +138 -0
- package/src/components/SelectCollection.jsx +44 -0
- package/src/components/SidebarIndexItem.jsx +11 -0
- package/src/components/SidebarIndexList.jsx +73 -0
- package/src/components/SidebarIndexTableOfContents.jsx +170 -0
- package/src/components/SidebarIndexThumbnail.jsx +22 -0
- package/src/components/TextViewer.jsx +37 -0
- package/src/components/ThumbnailCanvasGrouping.jsx +122 -0
- package/src/components/ThumbnailNavigation.jsx +231 -0
- package/src/components/VideoViewer.jsx +35 -0
- package/src/components/ViewerInfo.jsx +55 -0
- package/src/components/ViewerNavigation.jsx +72 -0
- package/src/components/Window.jsx +150 -0
- package/src/components/WindowAuthenticationBar.jsx +176 -0
- package/src/components/WindowCanvasNavigationControls.jsx +91 -0
- package/src/components/WindowList.jsx +71 -0
- package/src/components/WindowListButton.jsx +57 -0
- package/src/components/WindowSideBar.jsx +48 -0
- package/src/components/WindowSideBarAnnotationsPanel.jsx +51 -0
- package/src/components/WindowSideBarButtons.jsx +151 -0
- package/src/components/WindowSideBarCanvasPanel.jsx +165 -0
- package/src/components/WindowSideBarCollectionPanel.jsx +179 -0
- package/src/components/WindowSideBarInfoPanel.jsx +67 -0
- package/src/components/WindowThumbnailSettings.jsx +130 -0
- package/src/components/WindowTopBar.jsx +125 -0
- package/src/components/WindowTopBarPluginArea.jsx +8 -0
- package/src/components/WindowTopBarPluginMenu.jsx +78 -0
- package/src/components/WindowTopBarTitle.jsx +73 -0
- package/src/components/WindowTopMenu.jsx +81 -0
- package/src/components/WindowTopMenuButton.jsx +49 -0
- package/src/components/WindowViewSettings.jsx +95 -0
- package/src/components/WindowViewer.jsx +26 -0
- package/src/components/Workspace.jsx +124 -0
- package/src/components/WorkspaceAdd.jsx +221 -0
- package/src/components/WorkspaceAddButton.jsx +73 -0
- package/src/components/WorkspaceArea.jsx +66 -0
- package/src/components/WorkspaceControlPanel.jsx +85 -0
- package/src/components/WorkspaceControlPanelButtons.jsx +20 -0
- package/src/components/WorkspaceDialog.jsx +11 -0
- package/src/components/WorkspaceElastic.jsx +88 -0
- package/src/components/WorkspaceElasticWindow.jsx +79 -0
- package/src/components/WorkspaceExport.jsx +99 -0
- package/src/components/WorkspaceImport.jsx +89 -0
- package/src/components/WorkspaceMenu.jsx +126 -0
- package/src/components/WorkspaceMenuButton.jsx +42 -0
- package/src/components/WorkspaceMosaic.jsx +149 -0
- package/src/components/WorkspaceOptionsButton.jsx +35 -0
- package/src/components/WorkspaceOptionsMenu.jsx +112 -0
- package/src/components/WorkspaceSelectionDialog.jsx +165 -0
- package/src/components/ZoomControls.jsx +57 -0
- package/src/components/icons/BookViewIcon.jsx +14 -0
- package/src/components/icons/CanvasIndexIcon.jsx +14 -0
- package/src/components/icons/GalleryViewIcon.jsx +17 -0
- package/src/components/icons/MiradorIcon.jsx +14 -0
- package/src/components/icons/RestoreZoomIcon.jsx +15 -0
- package/src/components/icons/ThumbnailNavigationBottomIcon.jsx +15 -0
- package/src/components/icons/ThumbnailNavigationRightIcon.jsx +16 -0
- package/src/components/icons/WindowMaxIcon.jsx +15 -0
- package/src/components/icons/WindowMinIcon.jsx +15 -0
- package/src/components/icons/WindowOptionsIcon.jsx +16 -0
- package/src/components/icons/WorkspaceTypeElasticIcon.jsx +157 -0
- package/src/components/icons/WorkspaceTypeMosaicIcon.jsx +162 -0
- package/src/components/icons/index.js +27 -0
- package/src/components/index.js +108 -0
- package/src/config/css-ns.js +10 -0
- package/src/config/index.js +2 -0
- package/src/config/settings.js +607 -0
- package/src/containers/AnnotationSettings.js +27 -0
- package/src/containers/AnnotationsOverlay.js +51 -0
- package/src/containers/AppProviders.js +20 -0
- package/src/containers/AttributionPanel.js +20 -0
- package/src/containers/AudioViewer.js +16 -0
- package/src/containers/BackgroundPluginArea.js +4 -0
- package/src/containers/Branding.js +4 -0
- package/src/containers/CanvasAnnotations.js +32 -0
- package/src/containers/CanvasInfo.js +20 -0
- package/src/containers/CanvasLayers.js +25 -0
- package/src/containers/ChangeThemeDialog.js +29 -0
- package/src/containers/CollapsibleSection.js +3 -0
- package/src/containers/CollectionDialog.js +48 -0
- package/src/containers/CollectionInfo.js +29 -0
- package/src/containers/CompanionArea.js +22 -0
- package/src/containers/CompanionWindow.js +40 -0
- package/src/containers/CompanionWindowFactory.js +23 -0
- package/src/containers/CustomPanel.js +13 -0
- package/src/containers/ErrorContent.js +20 -0
- package/src/containers/ErrorDialog.js +28 -0
- package/src/containers/FullScreenButton.js +22 -0
- package/src/containers/GalleryView.js +23 -0
- package/src/containers/GalleryViewThumbnail.js +51 -0
- package/src/containers/IIIFAuthentication.js +86 -0
- package/src/containers/IIIFThumbnail.js +17 -0
- package/src/containers/LabelValueMetadata.js +14 -0
- package/src/containers/LanguageSettings.js +26 -0
- package/src/containers/LayersPanel.js +16 -0
- package/src/containers/LocalePicker.js +3 -0
- package/src/containers/ManifestForm.js +16 -0
- package/src/containers/ManifestInfo.js +29 -0
- package/src/containers/ManifestListItem.js +52 -0
- package/src/containers/ManifestListItemError.js +15 -0
- package/src/containers/ManifestRelatedLinks.js +28 -0
- package/src/containers/MinimalWindow.js +25 -0
- package/src/containers/MiradorMenuButton.js +7 -0
- package/src/containers/MosaicRenderPreview.js +14 -0
- package/src/containers/OpenSeadragonViewer.js +59 -0
- package/src/containers/PrimaryWindow.js +27 -0
- package/src/containers/SanitizedHtml.js +3 -0
- package/src/containers/ScrollIndicatedDialogContent.js +3 -0
- package/src/containers/SearchHit.js +71 -0
- package/src/containers/SearchPanel.js +23 -0
- package/src/containers/SearchPanelControls.js +36 -0
- package/src/containers/SearchPanelNavigation.js +39 -0
- package/src/containers/SearchResults.js +38 -0
- package/src/containers/SelectCollection.js +24 -0
- package/src/containers/SidebarIndexItem.js +8 -0
- package/src/containers/SidebarIndexList.js +28 -0
- package/src/containers/SidebarIndexTableOfContents.js +31 -0
- package/src/containers/SidebarIndexThumbnail.js +18 -0
- package/src/containers/TextViewer.js +19 -0
- package/src/containers/ThumbnailCanvasGrouping.js +29 -0
- package/src/containers/ThumbnailNavigation.js +48 -0
- package/src/containers/VideoViewer.js +16 -0
- package/src/containers/ViewerInfo.js +30 -0
- package/src/containers/ViewerNavigation.js +31 -0
- package/src/containers/Window.js +45 -0
- package/src/containers/WindowAuthenticationBar.js +7 -0
- package/src/containers/WindowCanvasNavigationControls.js +15 -0
- package/src/containers/WindowList.js +30 -0
- package/src/containers/WindowListButton.js +15 -0
- package/src/containers/WindowSideBar.js +20 -0
- package/src/containers/WindowSideBarAnnotationsPanel.js +23 -0
- package/src/containers/WindowSideBarButtons.js +75 -0
- package/src/containers/WindowSideBarCanvasPanel.js +50 -0
- package/src/containers/WindowSideBarCollectionPanel.js +48 -0
- package/src/containers/WindowSideBarInfoPanel.js +35 -0
- package/src/containers/WindowThumbnailSettings.js +31 -0
- package/src/containers/WindowTopBar.js +39 -0
- package/src/containers/WindowTopBarPluginArea.js +8 -0
- package/src/containers/WindowTopBarPluginMenu.js +7 -0
- package/src/containers/WindowTopBarTitle.js +17 -0
- package/src/containers/WindowTopMenu.js +28 -0
- package/src/containers/WindowTopMenuButton.js +7 -0
- package/src/containers/WindowViewSettings.js +30 -0
- package/src/containers/WindowViewer.js +10 -0
- package/src/containers/Workspace.js +36 -0
- package/src/containers/WorkspaceAdd.js +27 -0
- package/src/containers/WorkspaceAddButton.js +30 -0
- package/src/containers/WorkspaceArea.js +21 -0
- package/src/containers/WorkspaceControlPanel.js +10 -0
- package/src/containers/WorkspaceControlPanelButtons.js +7 -0
- package/src/containers/WorkspaceElastic.js +41 -0
- package/src/containers/WorkspaceElasticWindow.js +36 -0
- package/src/containers/WorkspaceExport.js +18 -0
- package/src/containers/WorkspaceImport.js +19 -0
- package/src/containers/WorkspaceMenu.js +30 -0
- package/src/containers/WorkspaceMenuButton.js +10 -0
- package/src/containers/WorkspaceMosaic.js +32 -0
- package/src/containers/WorkspaceOptionsButton.js +7 -0
- package/src/containers/WorkspaceOptionsMenu.js +3 -0
- package/src/containers/WorkspaceSelectionDialog.js +26 -0
- package/src/containers/ZoomControls.js +26 -0
- package/src/containers/index.js +94 -0
- package/src/contexts/FailedImageContext.js +8 -0
- package/src/contexts/FailedImageProvider.jsx +34 -0
- package/src/contexts/FullScreenContext.js +5 -0
- package/src/contexts/LocaleContext.js +5 -0
- package/src/contexts/OpenSeadragonViewerContext.js +5 -0
- package/src/contexts/WorkspaceContext.js +5 -0
- package/src/contexts/index.js +4 -0
- package/src/extend/PluginContext.js +5 -0
- package/src/extend/PluginProvider.jsx +22 -0
- package/src/extend/index.js +9 -0
- package/src/extend/pluginMapping.js +44 -0
- package/src/extend/pluginPreprocessing.js +45 -0
- package/src/extend/pluginValidation.js +58 -0
- package/src/extend/usePlugins.js +13 -0
- package/src/extend/withPlugins.jsx +46 -0
- package/src/hooks/index.js +4 -0
- package/src/hooks/useCanvasWorldService.js +10 -0
- package/src/hooks/useThumbnailService.js +8 -0
- package/src/i18n.js +71 -0
- package/src/index.js +18 -0
- package/src/init.js +20 -0
- package/src/lib/AnnotationFactory.js +23 -0
- package/src/lib/AnnotationItem.js +123 -0
- package/src/lib/AnnotationList.js +31 -0
- package/src/lib/AnnotationPage.js +41 -0
- package/src/lib/AnnotationResource.js +122 -0
- package/src/lib/CanvasAnnotationDisplay.js +148 -0
- package/src/lib/CanvasGroupings.js +55 -0
- package/src/lib/CanvasWorld.js +214 -0
- package/src/lib/CompanionWindowRegistry.js +23 -0
- package/src/lib/FullScreenHandle.jsx +76 -0
- package/src/lib/MiradorCanvas.js +211 -0
- package/src/lib/MiradorManifest.js +44 -0
- package/src/lib/MiradorViewer.jsx +53 -0
- package/src/lib/MosaicLayout.js +77 -0
- package/src/lib/OpenSeadragonCanvasOverlay.js +114 -0
- package/src/lib/ThumbnailFactory.js +310 -0
- package/src/lib/TruncatedHit.js +34 -0
- package/src/lib/asArray.js +11 -0
- package/src/lib/htmlRules.js +28 -0
- package/src/lib/iiif.js +12 -0
- package/src/lib/index.js +23 -0
- package/src/lib/readImageMetadata.js +21 -0
- package/src/lib/svgShapesToPath.js +49 -0
- package/src/locales/README.md +60 -0
- package/src/locales/ar/translation.json +141 -0
- package/src/locales/bg/translation.json +164 -0
- package/src/locales/de/translation.json +169 -0
- package/src/locales/en/translation.json +170 -0
- package/src/locales/et/translation.json +164 -0
- package/src/locales/fa/translation.json +164 -0
- package/src/locales/fr/translation.json +158 -0
- package/src/locales/hr/translation.json +164 -0
- package/src/locales/hu/translation.json +166 -0
- package/src/locales/it/translation.json +162 -0
- package/src/locales/ja/translation.json +156 -0
- package/src/locales/kr/translation.json +162 -0
- package/src/locales/lt/translation.json +153 -0
- package/src/locales/nbNo/translation.json +162 -0
- package/src/locales/nl/translation.json +139 -0
- package/src/locales/pl/translation.json +162 -0
- package/src/locales/ptBr/translation.json +133 -0
- package/src/locales/sr/translation.json +155 -0
- package/src/locales/sv/translation.json +157 -0
- package/src/locales/ta/translation.json +167 -0
- package/src/locales/vi/translation.json +156 -0
- package/src/locales/zhCn/translation.json +163 -0
- package/src/locales/zhTw/translation.json +163 -0
- package/src/plugins/OSDReferences.js +15 -0
- package/src/plugins/index.js +1 -0
- package/src/state/actions/action-types.js +76 -0
- package/src/state/actions/annotation.js +123 -0
- package/src/state/actions/auth.js +109 -0
- package/src/state/actions/canvas.js +65 -0
- package/src/state/actions/catalog.js +22 -0
- package/src/state/actions/companionWindow.js +107 -0
- package/src/state/actions/config.js +49 -0
- package/src/state/actions/elasticLayout.js +10 -0
- package/src/state/actions/errors.js +22 -0
- package/src/state/actions/index.js +19 -0
- package/src/state/actions/infoResponse.js +90 -0
- package/src/state/actions/layers.js +14 -0
- package/src/state/actions/manifest.js +65 -0
- package/src/state/actions/search.js +97 -0
- package/src/state/actions/window.js +209 -0
- package/src/state/actions/workspace.js +84 -0
- package/src/state/createPluggableStore.js +24 -0
- package/src/state/createStore.js +33 -0
- package/src/state/index.js +21 -0
- package/src/state/reducers/accessTokens.js +59 -0
- package/src/state/reducers/annotations.js +48 -0
- package/src/state/reducers/auth.js +43 -0
- package/src/state/reducers/catalog.js +30 -0
- package/src/state/reducers/companionWindows.js +49 -0
- package/src/state/reducers/config.js +39 -0
- package/src/state/reducers/elasticLayout.js +29 -0
- package/src/state/reducers/errors.js +51 -0
- package/src/state/reducers/index.js +15 -0
- package/src/state/reducers/infoResponses.js +61 -0
- package/src/state/reducers/layers.js +23 -0
- package/src/state/reducers/manifests.js +52 -0
- package/src/state/reducers/rootReducer.js +44 -0
- package/src/state/reducers/search.js +145 -0
- package/src/state/reducers/utils.js +45 -0
- package/src/state/reducers/viewers.js +42 -0
- package/src/state/reducers/windows.js +185 -0
- package/src/state/reducers/workspace.js +111 -0
- package/src/state/sagas/annotations.js +48 -0
- package/src/state/sagas/app.js +56 -0
- package/src/state/sagas/auth.js +151 -0
- package/src/state/sagas/iiif.js +233 -0
- package/src/state/sagas/index.js +30 -0
- package/src/state/sagas/windows.js +293 -0
- package/src/state/selectors/annotations.js +138 -0
- package/src/state/selectors/auth.js +100 -0
- package/src/state/selectors/canvases.js +260 -0
- package/src/state/selectors/companionWindows.js +182 -0
- package/src/state/selectors/config.js +100 -0
- package/src/state/selectors/getters.js +90 -0
- package/src/state/selectors/index.js +17 -0
- package/src/state/selectors/layers.js +79 -0
- package/src/state/selectors/manifests.js +433 -0
- package/src/state/selectors/ranges.js +147 -0
- package/src/state/selectors/searches.js +249 -0
- package/src/state/selectors/sequences.js +134 -0
- package/src/state/selectors/thumbnails.js +28 -0
- package/src/state/selectors/utils.js +18 -0
- package/src/state/selectors/viewer.js +19 -0
- package/src/state/selectors/windows.js +98 -0
- package/src/state/selectors/workspace.js +52 -0
- package/src/state/selectors/wrappers.js +15 -0
- package/src/styles/react-mosaic-component.js +288 -0
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { Component as e, createContext as t, createElement as n } from "react";
|
|
2
|
+
//#region ../node_modules/react-error-boundary/dist/react-error-boundary.esm.js
|
|
3
|
+
var r = t(null), i = {
|
|
4
|
+
didCatch: !1,
|
|
5
|
+
error: null
|
|
6
|
+
}, a = class extends e {
|
|
7
|
+
constructor(e) {
|
|
8
|
+
super(e), this.resetErrorBoundary = this.resetErrorBoundary.bind(this), this.state = i;
|
|
9
|
+
}
|
|
10
|
+
static getDerivedStateFromError(e) {
|
|
11
|
+
return {
|
|
12
|
+
didCatch: !0,
|
|
13
|
+
error: e
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
resetErrorBoundary() {
|
|
17
|
+
let { error: e } = this.state;
|
|
18
|
+
if (e !== null) {
|
|
19
|
+
var t, n, r = [...arguments];
|
|
20
|
+
(t = (n = this.props).onReset) == null || t.call(n, {
|
|
21
|
+
args: r,
|
|
22
|
+
reason: "imperative-api"
|
|
23
|
+
}), this.setState(i);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
componentDidCatch(e, t) {
|
|
27
|
+
var n, r;
|
|
28
|
+
(n = (r = this.props).onError) == null || n.call(r, e, t);
|
|
29
|
+
}
|
|
30
|
+
componentDidUpdate(e, t) {
|
|
31
|
+
let { didCatch: n } = this.state, { resetKeys: r } = this.props;
|
|
32
|
+
if (n && t.error !== null && o(e.resetKeys, r)) {
|
|
33
|
+
var a, s;
|
|
34
|
+
(a = (s = this.props).onReset) == null || a.call(s, {
|
|
35
|
+
next: r,
|
|
36
|
+
prev: e.resetKeys,
|
|
37
|
+
reason: "keys"
|
|
38
|
+
}), this.setState(i);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
render() {
|
|
42
|
+
let { children: e, fallbackRender: t, FallbackComponent: i, fallback: a } = this.props, { didCatch: o, error: s } = this.state, c = e;
|
|
43
|
+
if (o) {
|
|
44
|
+
let e = {
|
|
45
|
+
error: s,
|
|
46
|
+
resetErrorBoundary: this.resetErrorBoundary
|
|
47
|
+
};
|
|
48
|
+
if (typeof t == "function") c = t(e);
|
|
49
|
+
else if (i) c = n(i, e);
|
|
50
|
+
else if (a !== void 0) c = a;
|
|
51
|
+
else throw s;
|
|
52
|
+
}
|
|
53
|
+
return n(r.Provider, { value: {
|
|
54
|
+
didCatch: o,
|
|
55
|
+
error: s,
|
|
56
|
+
resetErrorBoundary: this.resetErrorBoundary
|
|
57
|
+
} }, c);
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
function o() {
|
|
61
|
+
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [], t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : [];
|
|
62
|
+
return e.length !== t.length || e.some((e, n) => !Object.is(e, t[n]));
|
|
63
|
+
}
|
|
64
|
+
//#endregion
|
|
65
|
+
export { a as t };
|
|
66
|
+
|
|
67
|
+
//# sourceMappingURL=react-error-boundary.esm-B_pT-oCS.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"react-error-boundary.esm-B_pT-oCS.js","names":[],"sources":["../../node_modules/react-error-boundary/dist/react-error-boundary.esm.js"],"sourcesContent":["'use client';\nimport { createContext, Component, createElement, useContext, useState, useMemo, forwardRef } from 'react';\n\nconst ErrorBoundaryContext = createContext(null);\n\nconst initialState = {\n didCatch: false,\n error: null\n};\nclass ErrorBoundary extends Component {\n constructor(props) {\n super(props);\n this.resetErrorBoundary = this.resetErrorBoundary.bind(this);\n this.state = initialState;\n }\n static getDerivedStateFromError(error) {\n return {\n didCatch: true,\n error\n };\n }\n resetErrorBoundary() {\n const {\n error\n } = this.state;\n if (error !== null) {\n var _this$props$onReset, _this$props;\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n (_this$props$onReset = (_this$props = this.props).onReset) === null || _this$props$onReset === void 0 ? void 0 : _this$props$onReset.call(_this$props, {\n args,\n reason: \"imperative-api\"\n });\n this.setState(initialState);\n }\n }\n componentDidCatch(error, info) {\n var _this$props$onError, _this$props2;\n (_this$props$onError = (_this$props2 = this.props).onError) === null || _this$props$onError === void 0 ? void 0 : _this$props$onError.call(_this$props2, error, info);\n }\n componentDidUpdate(prevProps, prevState) {\n const {\n didCatch\n } = this.state;\n const {\n resetKeys\n } = this.props;\n\n // There's an edge case where if the thing that triggered the error happens to *also* be in the resetKeys array,\n // we'd end up resetting the error boundary immediately.\n // This would likely trigger a second error to be thrown.\n // So we make sure that we don't check the resetKeys on the first call of cDU after the error is set.\n\n if (didCatch && prevState.error !== null && hasArrayChanged(prevProps.resetKeys, resetKeys)) {\n var _this$props$onReset2, _this$props3;\n (_this$props$onReset2 = (_this$props3 = this.props).onReset) === null || _this$props$onReset2 === void 0 ? void 0 : _this$props$onReset2.call(_this$props3, {\n next: resetKeys,\n prev: prevProps.resetKeys,\n reason: \"keys\"\n });\n this.setState(initialState);\n }\n }\n render() {\n const {\n children,\n fallbackRender,\n FallbackComponent,\n fallback\n } = this.props;\n const {\n didCatch,\n error\n } = this.state;\n let childToRender = children;\n if (didCatch) {\n const props = {\n error,\n resetErrorBoundary: this.resetErrorBoundary\n };\n if (typeof fallbackRender === \"function\") {\n childToRender = fallbackRender(props);\n } else if (FallbackComponent) {\n childToRender = createElement(FallbackComponent, props);\n } else if (fallback !== undefined) {\n childToRender = fallback;\n } else {\n throw error;\n }\n }\n return createElement(ErrorBoundaryContext.Provider, {\n value: {\n didCatch,\n error,\n resetErrorBoundary: this.resetErrorBoundary\n }\n }, childToRender);\n }\n}\nfunction hasArrayChanged() {\n let a = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];\n let b = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];\n return a.length !== b.length || a.some((item, index) => !Object.is(item, b[index]));\n}\n\nfunction assertErrorBoundaryContext(value) {\n if (value == null || typeof value.didCatch !== \"boolean\" || typeof value.resetErrorBoundary !== \"function\") {\n throw new Error(\"ErrorBoundaryContext not found\");\n }\n}\n\nfunction useErrorBoundary() {\n const context = useContext(ErrorBoundaryContext);\n assertErrorBoundaryContext(context);\n const [state, setState] = useState({\n error: null,\n hasError: false\n });\n const memoized = useMemo(() => ({\n resetBoundary: () => {\n context.resetErrorBoundary();\n setState({\n error: null,\n hasError: false\n });\n },\n showBoundary: error => setState({\n error,\n hasError: true\n })\n }), [context.resetErrorBoundary]);\n if (state.hasError) {\n throw state.error;\n }\n return memoized;\n}\n\nfunction withErrorBoundary(component, errorBoundaryProps) {\n const Wrapped = forwardRef((props, ref) => createElement(ErrorBoundary, errorBoundaryProps, createElement(component, {\n ...props,\n ref\n })));\n\n // Format for display in DevTools\n const name = component.displayName || component.name || \"Unknown\";\n Wrapped.displayName = \"withErrorBoundary(\".concat(name, \")\");\n return Wrapped;\n}\n\nexport { ErrorBoundary, ErrorBoundaryContext, useErrorBoundary, withErrorBoundary };\n"],"x_google_ignoreList":[0],"mappings":";;AAGA,IAAM,IAAuB,EAAc,IAAI,GAEzC,IAAe;CACnB,UAAU;CACV,OAAO;AACT,GACM,IAAN,cAA4B,EAAU;CACpC,YAAY,GAAO;EAGjB,AAFA,MAAM,CAAK,GACX,KAAK,qBAAqB,KAAK,mBAAmB,KAAK,IAAI,GAC3D,KAAK,QAAQ;CACf;CACA,OAAO,yBAAyB,GAAO;EACrC,OAAO;GACL,UAAU;GACV;EACF;CACF;CACA,qBAAqB;EACnB,IAAM,EACJ,aACE,KAAK;EACT,IAAI,MAAU,MAAM;GAClB,IAAI,GAAqB,GACS,QACnB;GAMf,CAJC,KAAuB,IAAc,KAAK,MAAA,CAAO,YAAa,QAAkD,EAAoB,KAAK,GAAa;IACrJ;IACA,QAAQ;GACV,CAAC,GACD,KAAK,SAAS,CAAY;EAC5B;CACF;CACA,kBAAkB,GAAO,GAAM;EAC7B,IAAI,GAAqB;EACzB,CAAC,KAAuB,IAAe,KAAK,MAAA,CAAO,YAAa,QAAkD,EAAoB,KAAK,GAAc,GAAO,CAAI;CACtK;CACA,mBAAmB,GAAW,GAAW;EACvC,IAAM,EACJ,gBACE,KAAK,OACH,EACJ,iBACE,KAAK;EAOT,IAAI,KAAY,EAAU,UAAU,QAAQ,EAAgB,EAAU,WAAW,CAAS,GAAG;GAC3F,IAAI,GAAsB;GAM1B,CALC,KAAwB,IAAe,KAAK,MAAA,CAAO,YAAa,QAAmD,EAAqB,KAAK,GAAc;IAC1J,MAAM;IACN,MAAM,EAAU;IAChB,QAAQ;GACV,CAAC,GACD,KAAK,SAAS,CAAY;EAC5B;CACF;CACA,SAAS;EACP,IAAM,EACJ,aACA,mBACA,sBACA,gBACE,KAAK,OACH,EACJ,aACA,aACE,KAAK,OACL,IAAgB;EACpB,IAAI,GAAU;GACZ,IAAM,IAAQ;IACZ;IACA,oBAAoB,KAAK;GAC3B;GACA,IAAI,OAAO,KAAmB,YAC5B,IAAgB,EAAe,CAAK;QAC/B,IAAI,GACT,IAAgB,EAAc,GAAmB,CAAK;QACjD,IAAI,MAAa,KAAA,GACtB,IAAgB;QAEhB,MAAM;EAEV;EACA,OAAO,EAAc,EAAqB,UAAU,EAClD,OAAO;GACL;GACA;GACA,oBAAoB,KAAK;EAC3B,EACF,GAAG,CAAa;CAClB;AACF;AACA,SAAS,IAAkB;CACzB,IAAI,IAAI,UAAU,SAAS,KAAK,UAAU,OAAO,KAAA,IAAY,UAAU,KAAK,CAAC,GACzE,IAAI,UAAU,SAAS,KAAK,UAAU,OAAO,KAAA,IAAY,UAAU,KAAK,CAAC;CAC7E,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,GAAM,MAAU,CAAC,OAAO,GAAG,GAAM,EAAE,EAAM,CAAC;AACpF"}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { U as e, at as t, ft as n, g as r, lt as i, ut as a } from "./getters-COus7Mvg.js";
|
|
2
|
+
import { createContext as o, useContext as s } from "react";
|
|
3
|
+
import { jsx as c } from "react/jsx-runtime";
|
|
4
|
+
import { styled as l } from "@mui/material/styles";
|
|
5
|
+
import u from "@mui/material/Badge";
|
|
6
|
+
import d from "@mui/material/IconButton";
|
|
7
|
+
import f from "@mui/material/Tooltip";
|
|
8
|
+
//#region src/contexts/WorkspaceContext.js
|
|
9
|
+
var p = /* @__PURE__ */ n(t(), 1), m = o({ current: document.body }), h = l(d, {
|
|
10
|
+
name: "MiradorMenuButton",
|
|
11
|
+
slot: "root"
|
|
12
|
+
})(({ selected: e, theme: t }) => ({
|
|
13
|
+
fill: "currentcolor",
|
|
14
|
+
...e && { backgroundColor: t.palette.action.selected }
|
|
15
|
+
}));
|
|
16
|
+
function g({ "aria-label": e, badge: t = !1, children: n, dispatch: r = () => {}, selected: i = !1, BadgeProps: a = {}, TooltipProps: o = {}, sx: l = {}, ...d }) {
|
|
17
|
+
let p = s(m), g = /* @__PURE__ */ c(h, {
|
|
18
|
+
selected: i,
|
|
19
|
+
"aria-label": e,
|
|
20
|
+
...d,
|
|
21
|
+
sx: l,
|
|
22
|
+
size: "large",
|
|
23
|
+
children: t ? /* @__PURE__ */ c(u, {
|
|
24
|
+
overlap: "rectangular",
|
|
25
|
+
...a,
|
|
26
|
+
children: n
|
|
27
|
+
}) : n
|
|
28
|
+
});
|
|
29
|
+
return d.disabled ? g : /* @__PURE__ */ c(f, {
|
|
30
|
+
title: e,
|
|
31
|
+
...o,
|
|
32
|
+
slotProps: { popper: { container: p?.current } },
|
|
33
|
+
children: g
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
g.propTypes = {
|
|
37
|
+
"aria-label": p.default.string.isRequired,
|
|
38
|
+
badge: p.default.bool,
|
|
39
|
+
BadgeProps: p.default.object,
|
|
40
|
+
children: p.default.element.isRequired,
|
|
41
|
+
dispatch: p.default.func,
|
|
42
|
+
selected: p.default.bool,
|
|
43
|
+
sx: p.default.object,
|
|
44
|
+
TooltipProps: p.default.object
|
|
45
|
+
};
|
|
46
|
+
var _ = e(r("MiradorMenuButton"))(g), v = /* @__PURE__ */ a(((e) => {
|
|
47
|
+
Object.defineProperty(e, "__esModule", { value: !0 }), e.useElementSize = void 0;
|
|
48
|
+
var t = i();
|
|
49
|
+
function n() {
|
|
50
|
+
var e = (0, t.useState)(null), n = e[0], r = e[1], i = (0, t.useState)({
|
|
51
|
+
width: 0,
|
|
52
|
+
height: 0
|
|
53
|
+
}), a = i[0], o = i[1], s = (0, t.useCallback)(function() {
|
|
54
|
+
n && o({
|
|
55
|
+
width: n.offsetWidth,
|
|
56
|
+
height: n.offsetHeight
|
|
57
|
+
});
|
|
58
|
+
}, [n]);
|
|
59
|
+
return (typeof window < "u" ? t.useLayoutEffect : t.useEffect)(function() {
|
|
60
|
+
if (n) {
|
|
61
|
+
s();
|
|
62
|
+
var e = new ResizeObserver(s);
|
|
63
|
+
return e.observe(n), function() {
|
|
64
|
+
return e.disconnect();
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
}, [n, s]), [r, a];
|
|
68
|
+
}
|
|
69
|
+
e.useElementSize = n;
|
|
70
|
+
}));
|
|
71
|
+
//#endregion
|
|
72
|
+
//#region ../node_modules/merge-refs/dist/index.js
|
|
73
|
+
function y() {
|
|
74
|
+
var e = [...arguments].filter(Boolean);
|
|
75
|
+
return e.length <= 1 ? e[0] || null : function(t) {
|
|
76
|
+
for (var n = 0, r = e; n < r.length; n++) {
|
|
77
|
+
var i = r[n];
|
|
78
|
+
typeof i == "function" ? i(t) : i && (i.current = t);
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
//#endregion
|
|
83
|
+
//#region ../node_modules/@mui/utils/esm/visuallyHidden/visuallyHidden.js
|
|
84
|
+
var b = {
|
|
85
|
+
border: 0,
|
|
86
|
+
clip: "rect(0 0 0 0)",
|
|
87
|
+
height: "1px",
|
|
88
|
+
margin: "-1px",
|
|
89
|
+
overflow: "hidden",
|
|
90
|
+
padding: 0,
|
|
91
|
+
position: "absolute",
|
|
92
|
+
whiteSpace: "nowrap",
|
|
93
|
+
width: "1px"
|
|
94
|
+
};
|
|
95
|
+
//#endregion
|
|
96
|
+
export { g as a, _ as i, y as n, m as o, v as r, b as t };
|
|
97
|
+
|
|
98
|
+
//# sourceMappingURL=visuallyHidden-DmYvwNdU.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"visuallyHidden-DmYvwNdU.js","names":[],"sources":["../src/contexts/WorkspaceContext.js","../src/components/MiradorMenuButton.jsx","../src/containers/MiradorMenuButton.js","../../node_modules/@custom-react-hooks/use-element-size/dist/index.js","../../node_modules/merge-refs/dist/index.js","../../node_modules/@mui/utils/esm/visuallyHidden/visuallyHidden.js"],"sourcesContent":["import { createContext } from 'react';\n\nconst WorkspaceContext = createContext({ current: document.body });\n\nexport default WorkspaceContext;\n","import { useContext } from 'react';\nimport PropTypes from 'prop-types';\nimport { styled } from '@mui/material/styles';\nimport Badge from '@mui/material/Badge';\nimport IconButton from '@mui/material/IconButton';\nimport Tooltip from '@mui/material/Tooltip';\nimport WorkspaceContext from '../contexts/WorkspaceContext';\n\nconst Root = styled(IconButton, { name: 'MiradorMenuButton', slot: 'root' })(({ selected, theme }) => ({\n fill: 'currentcolor',\n ...(selected && {\n backgroundColor: theme.palette.action.selected,\n }),\n}));\n\n/**\n * MiradorMenuButton ~ Wrap the given icon prop in an IconButton and a Tooltip.\n * This shares the passed in aria-label w/ the Tooltip (as title) and the IconButton\n * All props besides icon are spread to the IconButton component\n */\nexport function MiradorMenuButton({\n 'aria-label': ariaLabel,\n badge = false,\n children,\n dispatch = () => {},\n selected = false,\n BadgeProps = {},\n TooltipProps = {},\n sx = {},\n ...iconButtonProps\n}) {\n const container = useContext(WorkspaceContext);\n const button = (\n <Root selected={selected} aria-label={ariaLabel} {...iconButtonProps} sx={sx} size=\"large\">\n {badge ? (\n <Badge overlap=\"rectangular\" {...BadgeProps}>\n {children}\n </Badge>\n ) : (\n children\n )}\n </Root>\n );\n\n if (iconButtonProps.disabled) return button;\n\n return (\n <Tooltip\n title={ariaLabel}\n {...TooltipProps}\n slotProps={{\n popper: {\n container: container?.current,\n },\n }}\n >\n {button}\n </Tooltip>\n );\n}\n\nMiradorMenuButton.propTypes = {\n 'aria-label': PropTypes.string.isRequired,\n badge: PropTypes.bool,\n BadgeProps: PropTypes.object,\n children: PropTypes.element.isRequired,\n dispatch: PropTypes.func,\n selected: PropTypes.bool,\n sx: PropTypes.object,\n TooltipProps: PropTypes.object,\n};\n","import { compose } from 'redux';\nimport { withPlugins } from '../extend/withPlugins';\nimport { MiradorMenuButton } from '../components/MiradorMenuButton';\n\nconst enhance = compose(withPlugins('MiradorMenuButton'));\n\nexport default enhance(MiradorMenuButton);\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.useElementSize = void 0;\r\nvar react_1 = require(\"react\");\r\nfunction useElementSize() {\r\n var _a = (0, react_1.useState)(null), ref = _a[0], setRef = _a[1];\r\n var _b = (0, react_1.useState)({ width: 0, height: 0 }), size = _b[0], setSize = _b[1];\r\n var handleSize = (0, react_1.useCallback)(function () {\r\n if (ref) {\r\n setSize({\r\n width: ref.offsetWidth,\r\n height: ref.offsetHeight,\r\n });\r\n }\r\n }, [ref]);\r\n var useEnviromentEffect = typeof window !== 'undefined' ? react_1.useLayoutEffect : react_1.useEffect;\r\n useEnviromentEffect(function () {\r\n if (!ref)\r\n return;\r\n handleSize();\r\n var resizeObserver = new ResizeObserver(handleSize);\r\n resizeObserver.observe(ref);\r\n return function () { return resizeObserver.disconnect(); };\r\n }, [ref, handleSize]);\r\n return [setRef, size];\r\n}\r\nexports.useElementSize = useElementSize;\r\n","/**\n * A function that merges React refs into one.\n * Supports both functions and ref objects created using createRef() and useRef().\n *\n * Usage:\n * ```tsx\n * <div ref={mergeRefs(ref1, ref2, ref3)} />\n * ```\n *\n * @param {(React.Ref<T> | undefined)[]} inputRefs Array of refs\n * @returns {React.Ref<T> | React.RefCallback<T>} Merged refs\n */\nexport default function mergeRefs() {\n var inputRefs = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n inputRefs[_i] = arguments[_i];\n }\n var filteredInputRefs = inputRefs.filter(Boolean);\n if (filteredInputRefs.length <= 1) {\n var firstRef = filteredInputRefs[0];\n return firstRef || null;\n }\n return function mergedRefs(ref) {\n for (var _i = 0, filteredInputRefs_1 = filteredInputRefs; _i < filteredInputRefs_1.length; _i++) {\n var inputRef = filteredInputRefs_1[_i];\n if (typeof inputRef === 'function') {\n inputRef(ref);\n }\n else if (inputRef) {\n inputRef.current = ref;\n }\n }\n };\n}\n","const visuallyHidden = {\n border: 0,\n clip: 'rect(0 0 0 0)',\n height: '1px',\n margin: '-1px',\n overflow: 'hidden',\n padding: 0,\n position: 'absolute',\n whiteSpace: 'nowrap',\n width: '1px'\n};\nexport default visuallyHidden;"],"x_google_ignoreList":[3,4,5],"mappings":";;;;;;;;mCAEM,IAAmB,EAAc,EAAE,SAAS,SAAS,KAAK,CAAC,GCM3D,IAAO,EAAO,GAAY;CAAE,MAAM;CAAqB,MAAM;AAAO,CAAC,CAAC,EAAE,EAAE,aAAU,gBAAa;CACrG,MAAM;CACN,GAAI,KAAY,EACd,iBAAiB,EAAM,QAAQ,OAAO,SACxC;AACF,EAAE;AAOF,SAAgB,EAAkB,EAChC,cAAc,GACd,WAAQ,IACR,aACA,oBAAiB,CAAC,GAClB,cAAW,IACX,gBAAa,CAAC,GACd,kBAAe,CAAC,GAChB,QAAK,CAAC,GACN,GAAG,KACF;CACD,IAAM,IAAY,EAAW,CAAgB,GACvC,IACJ,kBAAC,GAAD;EAAgB;EAAU,cAAY;EAAW,GAAI;EAAqB;EAAI,MAAK;EAChF,UAAA,IACC,kBAAC,GAAD;GAAO,SAAQ;GAAc,GAAI;GAC9B;EACI,CAAA,IAEP;CAEE,CAAA;CAKR,OAFI,EAAgB,WAAiB,IAGnC,kBAAC,GAAD;EACE,OAAO;EACP,GAAI;EACJ,WAAW,EACT,QAAQ,EACN,WAAW,GAAW,QACxB,EACF;EAEC,UAAA;CACM,CAAA;AAEb;AAEA,EAAkB,YAAY;CAC5B,cAAc,EAAA,QAAU,OAAO;CAC/B,OAAO,EAAA,QAAU;CACjB,YAAY,EAAA,QAAU;CACtB,UAAU,EAAA,QAAU,QAAQ;CAC5B,UAAU,EAAA,QAAU;CACpB,UAAU,EAAA,QAAU;CACpB,IAAI,EAAA,QAAU;CACd,cAAc,EAAA,QAAU;AAC1B;AChEA,IAAA,IAFgB,EAAQ,EAAY,mBAAmB,CAExC,CAAA,CAAQ,CAAiB;CCJxC,AADA,OAAO,eAAe,GAAS,cAAc,EAAE,OAAO,GAAK,CAAC,GAC5D,EAAQ,iBAAiB,KAAK;CAC9B,IAAI,IAAA,EAAA;CACJ,SAAS,IAAiB;EACtB,IAAI,KAAM,GAAG,EAAQ,SAAA,CAAU,IAAI,GAAG,IAAM,EAAG,IAAI,IAAS,EAAG,IAC3D,KAAM,GAAG,EAAQ,SAAA,CAAU;GAAE,OAAO;GAAG,QAAQ;EAAE,CAAC,GAAG,IAAO,EAAG,IAAI,IAAU,EAAG,IAChF,KAAc,GAAG,EAAQ,YAAA,CAAa,WAAY;GAClD,AAAI,KACA,EAAQ;IACJ,OAAO,EAAI;IACX,QAAQ,EAAI;GAChB,CAAC;EAET,GAAG,CAAC,CAAG,CAAC;EAUR,QAT0B,OAAO,SAAW,MAAc,EAAQ,kBAAkB,EAAQ,UAAA,CACxE,WAAY;GACvB,OAEL;MAAW;IACX,IAAI,IAAiB,IAAI,eAAe,CAAU;IAElD,OADA,EAAe,QAAQ,CAAG,GACnB,WAAY;KAAE,OAAO,EAAe,WAAW;IAAG;GAH9C;EAIf,GAAG,CAAC,GAAK,CAAU,CAAC,GACb,CAAC,GAAQ,CAAI;CACxB;CACA,EAAQ,iBAAiB;;;;ACdzB,SAAwB,IAAY;CAE3B,IAGD,IAAoB,IAFJ,SAEI,CAAA,CAAU,OAAO,OAAO;CAKhD,OAJI,EAAkB,UAAU,IACb,EAAkB,MACd,OAEhB,SAAoB,GAAK;EAC5B,KAAK,IAAI,IAAK,GAAG,IAAsB,GAAmB,IAAK,EAAoB,QAAQ,KAAM;GAC7F,IAAI,IAAW,EAAoB;GACnC,AAAI,OAAO,KAAa,aACpB,EAAS,CAAG,IAEP,MACL,EAAS,UAAU;EAE3B;CACJ;AACJ;;;ACjCA,IAAM,IAAiB;CACrB,QAAQ;CACR,MAAM;CACN,QAAQ;CACR,QAAQ;CACR,UAAU;CACV,SAAS;CACT,UAAU;CACV,YAAY;CACZ,OAAO;AACT"}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import { f as e, h as t } from "./getters-COus7Mvg.js";
|
|
2
|
+
import { t as n } from "./action-types-DjIbTE-A.js";
|
|
3
|
+
//#region src/state/actions/window.js
|
|
4
|
+
function r(e, t = !1) {
|
|
5
|
+
return {
|
|
6
|
+
pan: t,
|
|
7
|
+
type: n.FOCUS_WINDOW,
|
|
8
|
+
windowId: e
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
function i({ companionWindows: r, manifest: i, ...a }) {
|
|
12
|
+
return (o, s) => {
|
|
13
|
+
let { config: c, workspace: { windowIds: l = [] } } = e(s()), u = l.length, d = a.id || `window-${t()}`, f = `cw-${t()}`, p = [{
|
|
14
|
+
content: "thumbnailNavigation",
|
|
15
|
+
default: !0,
|
|
16
|
+
id: f,
|
|
17
|
+
position: a.thumbnailNavigationPosition || c.thumbnailNavigation.defaultPosition,
|
|
18
|
+
windowId: d
|
|
19
|
+
}, ...(r || []).map((e, n) => ({
|
|
20
|
+
...e,
|
|
21
|
+
id: `cw-${t()}`
|
|
22
|
+
}))];
|
|
23
|
+
(a.sideBarPanel || c.window.defaultSideBarPanel || c.window.sideBarPanel) && p.unshift({
|
|
24
|
+
content: a.sideBarPanel || a.defaultSearchQuery && "search" || c.window.defaultSideBarPanel || c.window.sideBarPanel,
|
|
25
|
+
default: !0,
|
|
26
|
+
id: `cw-${t()}`,
|
|
27
|
+
position: "left",
|
|
28
|
+
windowId: d
|
|
29
|
+
});
|
|
30
|
+
let m = {
|
|
31
|
+
canvasId: void 0,
|
|
32
|
+
collectionIndex: 0,
|
|
33
|
+
companionAreaOpen: !0,
|
|
34
|
+
companionWindowIds: p.map((e) => e.id),
|
|
35
|
+
draggingEnabled: !0,
|
|
36
|
+
highlightAllAnnotations: c.window.highlightAllAnnotations || !1,
|
|
37
|
+
id: d,
|
|
38
|
+
manifestId: null,
|
|
39
|
+
maximized: !1,
|
|
40
|
+
rangeId: null,
|
|
41
|
+
rotation: null,
|
|
42
|
+
selectedAnnotations: {},
|
|
43
|
+
sideBarOpen: c.window.sideBarOpenByDefault === void 0 ? c.window.sideBarOpen || !!a.defaultSearchQuery : c.window.sideBarOpenByDefault || !!a.defaultSearchQuery,
|
|
44
|
+
sideBarPanel: a.sideBarPanel || c.window.defaultSideBarPanel || c.window.sideBarPanel,
|
|
45
|
+
thumbnailNavigationId: f
|
|
46
|
+
};
|
|
47
|
+
o({
|
|
48
|
+
companionWindows: p,
|
|
49
|
+
elasticLayout: {
|
|
50
|
+
...c.window.elastic || {
|
|
51
|
+
height: 400,
|
|
52
|
+
width: 480
|
|
53
|
+
},
|
|
54
|
+
x: 200 + (Math.floor(u / 10) * 50 + u * 30 % 300),
|
|
55
|
+
y: 200 + u * 50 % 300
|
|
56
|
+
},
|
|
57
|
+
manifest: i,
|
|
58
|
+
type: n.ADD_WINDOW,
|
|
59
|
+
window: {
|
|
60
|
+
...m,
|
|
61
|
+
...a
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
function a(e, t) {
|
|
67
|
+
return {
|
|
68
|
+
id: e,
|
|
69
|
+
payload: t,
|
|
70
|
+
type: n.UPDATE_WINDOW
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
function o(e) {
|
|
74
|
+
return {
|
|
75
|
+
type: n.MAXIMIZE_WINDOW,
|
|
76
|
+
windowId: e
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
function s(e) {
|
|
80
|
+
return {
|
|
81
|
+
type: n.MINIMIZE_WINDOW,
|
|
82
|
+
windowId: e
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
function c(e, t) {
|
|
86
|
+
return {
|
|
87
|
+
id: e,
|
|
88
|
+
payload: { companionAreaOpen: t },
|
|
89
|
+
type: n.UPDATE_WINDOW
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
function l(e) {
|
|
93
|
+
return {
|
|
94
|
+
type: n.REMOVE_WINDOW,
|
|
95
|
+
windowId: e
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
function u(e) {
|
|
99
|
+
return {
|
|
100
|
+
type: n.TOGGLE_WINDOW_SIDE_BAR,
|
|
101
|
+
windowId: e
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
function d(e, t) {
|
|
105
|
+
return (r, i) => {
|
|
106
|
+
let { windows: a } = i(), { thumbnailNavigationId: o } = a[e];
|
|
107
|
+
r({
|
|
108
|
+
id: o,
|
|
109
|
+
payload: { position: t },
|
|
110
|
+
type: n.UPDATE_COMPANION_WINDOW
|
|
111
|
+
});
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
function f(e, t) {
|
|
115
|
+
return {
|
|
116
|
+
type: n.SET_WINDOW_VIEW_TYPE,
|
|
117
|
+
viewType: t,
|
|
118
|
+
windowId: e
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
function p(e, t = [], r) {
|
|
122
|
+
return {
|
|
123
|
+
dialogCollectionPath: t,
|
|
124
|
+
manifestId: e,
|
|
125
|
+
type: n.SHOW_COLLECTION_DIALOG,
|
|
126
|
+
windowId: r
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
function m(e) {
|
|
130
|
+
return {
|
|
131
|
+
type: n.HIDE_COLLECTION_DIALOG,
|
|
132
|
+
windowId: e
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
//#endregion
|
|
136
|
+
export { s as a, d as c, u as d, a as f, o as i, f as l, r as n, l as o, m as r, c as s, i as t, p as u };
|
|
137
|
+
|
|
138
|
+
//# sourceMappingURL=window-zelwU7wz.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"window-zelwU7wz.js","names":[],"sources":["../src/state/actions/window.js"],"sourcesContent":["import { v4 as uuid } from 'uuid';\nimport ActionTypes from './action-types';\nimport { miradorSlice } from '../selectors/utils';\n\n/**\n * focusWindow - action creator\n *\n * @param {String} windowId\n * @memberof ActionCreators\n */\nexport function focusWindow(windowId, pan = false) {\n return {\n pan,\n type: ActionTypes.FOCUS_WINDOW,\n windowId,\n };\n}\n\n/**\n * addWindow - action creator\n *\n * @param {Object} options\n * @memberof ActionCreators\n */\nexport function addWindow({ companionWindows, manifest, ...options }) {\n return (dispatch, getState) => {\n const {\n config,\n workspace: { windowIds = [] },\n } = miradorSlice(getState());\n const numWindows = windowIds.length;\n\n const windowId = options.id || `window-${uuid()}`;\n const cwThumbs = `cw-${uuid()}`;\n\n const defaultCompanionWindows = [\n {\n content: 'thumbnailNavigation',\n default: true,\n id: cwThumbs,\n position: options.thumbnailNavigationPosition || config.thumbnailNavigation.defaultPosition,\n windowId,\n },\n ...(companionWindows || []).map((cw, i) => ({ ...cw, id: `cw-${uuid()}` })),\n ];\n\n if (options.sideBarPanel || config.window.defaultSideBarPanel || config.window.sideBarPanel) {\n defaultCompanionWindows.unshift({\n content:\n options.sideBarPanel ||\n (options.defaultSearchQuery && 'search') ||\n config.window.defaultSideBarPanel ||\n config.window.sideBarPanel,\n\n default: true,\n id: `cw-${uuid()}`,\n position: 'left',\n windowId,\n });\n }\n\n const defaultOptions = {\n canvasId: undefined,\n collectionIndex: 0,\n companionAreaOpen: true,\n companionWindowIds: defaultCompanionWindows.map((cw) => cw.id),\n draggingEnabled: true,\n highlightAllAnnotations: config.window.highlightAllAnnotations || false,\n id: windowId,\n manifestId: null,\n maximized: false,\n rangeId: null,\n rotation: null,\n selectedAnnotations: {},\n sideBarOpen:\n config.window.sideBarOpenByDefault !== undefined\n ? config.window.sideBarOpenByDefault || !!options.defaultSearchQuery\n : config.window.sideBarOpen || !!options.defaultSearchQuery,\n sideBarPanel: options.sideBarPanel || config.window.defaultSideBarPanel || config.window.sideBarPanel,\n thumbnailNavigationId: cwThumbs,\n };\n\n const elasticLayout = {\n ...(config.window.elastic || { height: 400, width: 480 }),\n x: 200 + (Math.floor(numWindows / 10) * 50 + ((numWindows * 30) % 300)),\n y: 200 + ((numWindows * 50) % 300),\n };\n\n dispatch({\n companionWindows: defaultCompanionWindows,\n elasticLayout,\n manifest,\n type: ActionTypes.ADD_WINDOW,\n window: { ...defaultOptions, ...options },\n });\n };\n}\n\n/** */\nexport function updateWindow(id, payload) {\n return {\n id,\n payload,\n type: ActionTypes.UPDATE_WINDOW,\n };\n}\n\n/**\n * maximizeWindow\n * @param {String} windowId\n * @memberof ActionCreators\n */\nexport function maximizeWindow(windowId) {\n return { type: ActionTypes.MAXIMIZE_WINDOW, windowId };\n}\n\n/**\n * minimizeWindow\n * @param {String} windowId\n * @memberof ActionCreators\n */\nexport function minimizeWindow(windowId) {\n return { type: ActionTypes.MINIMIZE_WINDOW, windowId };\n}\n\n/** */\nexport function setCompanionAreaOpen(id, companionAreaOpen) {\n return {\n id,\n payload: { companionAreaOpen },\n type: ActionTypes.UPDATE_WINDOW,\n };\n}\n\n/**\n * removeWindow - action creator\n *\n * @param {String} windowId\n * @memberof ActionCreators\n */\nexport function removeWindow(windowId) {\n return {\n type: ActionTypes.REMOVE_WINDOW,\n windowId,\n };\n}\n\n/**\n * toggleWindowSideBar - action creator\n *\n * @param {String} windowId\n * @memberof ActionCreators\n */\nexport function toggleWindowSideBar(windowId) {\n return { type: ActionTypes.TOGGLE_WINDOW_SIDE_BAR, windowId };\n}\n\n/**\n * setWindowThumbnailPosition - action creator\n *\n * @param {String} windowId\n * @param {String} position\n * @memberof ActionCreators\n */\nexport function setWindowThumbnailPosition(windowId, position) {\n return (dispatch, getState) => {\n const { windows } = getState();\n const { thumbnailNavigationId } = windows[windowId];\n\n dispatch({\n id: thumbnailNavigationId,\n payload: { position },\n type: ActionTypes.UPDATE_COMPANION_WINDOW,\n });\n };\n}\n\n/**\n * setWindowViewType - action creator\n *\n * @param {String} windowId\n * @param {String} viewType\n * @memberof ActionCreators\n */\nexport function setWindowViewType(windowId, viewType) {\n return {\n type: ActionTypes.SET_WINDOW_VIEW_TYPE,\n viewType,\n windowId,\n };\n}\n\n/** */\nexport function showCollectionDialog(manifestId, dialogCollectionPath = [], windowId) {\n return {\n dialogCollectionPath,\n manifestId,\n type: ActionTypes.SHOW_COLLECTION_DIALOG,\n windowId,\n };\n}\n\n/** */\nexport function hideCollectionDialog(windowId) {\n return {\n type: ActionTypes.HIDE_COLLECTION_DIALOG,\n windowId,\n };\n}\n"],"mappings":";;;AAUA,SAAgB,EAAY,GAAU,IAAM,IAAO;CACjD,OAAO;EACL;EACA,MAAM,EAAY;EAClB;CACF;AACF;AAQA,SAAgB,EAAU,EAAE,qBAAkB,aAAU,GAAG,KAAW;CACpE,QAAQ,GAAU,MAAa;EAC7B,IAAM,EACJ,WACA,WAAW,EAAE,eAAY,CAAC,QACxB,EAAa,EAAS,CAAC,GACrB,IAAa,EAAU,QAEvB,IAAW,EAAQ,MAAM,UAAU,EAAK,KACxC,IAAW,MAAM,EAAK,KAEtB,IAA0B,CAC9B;GACE,SAAS;GACT,SAAS;GACT,IAAI;GACJ,UAAU,EAAQ,+BAA+B,EAAO,oBAAoB;GAC5E;EACF,GACA,IAAI,KAAoB,CAAC,EAAA,CAAG,KAAK,GAAI,OAAO;GAAE,GAAG;GAAI,IAAI,MAAM,EAAK;EAAI,EAAE,CAC5E;EAEA,CAAI,EAAQ,gBAAgB,EAAO,OAAO,uBAAuB,EAAO,OAAO,iBAC7E,EAAwB,QAAQ;GAC9B,SACE,EAAQ,gBACP,EAAQ,sBAAsB,YAC/B,EAAO,OAAO,uBACd,EAAO,OAAO;GAEhB,SAAS;GACT,IAAI,MAAM,EAAK;GACf,UAAU;GACV;EACF,CAAC;EAGH,IAAM,IAAiB;GACrB,UAAU,KAAA;GACV,iBAAiB;GACjB,mBAAmB;GACnB,oBAAoB,EAAwB,KAAK,MAAO,EAAG,EAAE;GAC7D,iBAAiB;GACjB,yBAAyB,EAAO,OAAO,2BAA2B;GAClE,IAAI;GACJ,YAAY;GACZ,WAAW;GACX,SAAS;GACT,UAAU;GACV,qBAAqB,CAAC;GACtB,aACE,EAAO,OAAO,yBAAyB,KAAA,IAEnC,EAAO,OAAO,eAAe,CAAC,CAAC,EAAQ,qBADvC,EAAO,OAAO,wBAAwB,CAAC,CAAC,EAAQ;GAEtD,cAAc,EAAQ,gBAAgB,EAAO,OAAO,uBAAuB,EAAO,OAAO;GACzF,uBAAuB;EACzB;EAQA,EAAS;GACP,kBAAkB;GAClB,eAAA;IAPA,GAAI,EAAO,OAAO,WAAW;KAAE,QAAQ;KAAK,OAAO;IAAI;IACvD,GAAG,OAAO,KAAK,MAAM,IAAa,EAAE,IAAI,KAAO,IAAa,KAAM;IAClE,GAAG,MAAQ,IAAa,KAAM;GAK9B;GACA;GACA,MAAM,EAAY;GAClB,QAAQ;IAAE,GAAG;IAAgB,GAAG;GAAQ;EAC1C,CAAC;CACH;AACF;AAGA,SAAgB,EAAa,GAAI,GAAS;CACxC,OAAO;EACL;EACA;EACA,MAAM,EAAY;CACpB;AACF;AAOA,SAAgB,EAAe,GAAU;CACvC,OAAO;EAAE,MAAM,EAAY;EAAiB;CAAS;AACvD;AAOA,SAAgB,EAAe,GAAU;CACvC,OAAO;EAAE,MAAM,EAAY;EAAiB;CAAS;AACvD;AAGA,SAAgB,EAAqB,GAAI,GAAmB;CAC1D,OAAO;EACL;EACA,SAAS,EAAE,qBAAkB;EAC7B,MAAM,EAAY;CACpB;AACF;AAQA,SAAgB,EAAa,GAAU;CACrC,OAAO;EACL,MAAM,EAAY;EAClB;CACF;AACF;AAQA,SAAgB,EAAoB,GAAU;CAC5C,OAAO;EAAE,MAAM,EAAY;EAAwB;CAAS;AAC9D;AASA,SAAgB,EAA2B,GAAU,GAAU;CAC7D,QAAQ,GAAU,MAAa;EAC7B,IAAM,EAAE,eAAY,EAAS,GACvB,EAAE,6BAA0B,EAAQ;EAE1C,EAAS;GACP,IAAI;GACJ,SAAS,EAAE,YAAS;GACpB,MAAM,EAAY;EACpB,CAAC;CACH;AACF;AASA,SAAgB,EAAkB,GAAU,GAAU;CACpD,OAAO;EACL,MAAM,EAAY;EAClB;EACA;CACF;AACF;AAGA,SAAgB,EAAqB,GAAY,IAAuB,CAAC,GAAG,GAAU;CACpF,OAAO;EACL;EACA;EACA,MAAM,EAAY;EAClB;CACF;AACF;AAGA,SAAgB,EAAqB,GAAU;CAC7C,OAAO;EACL,MAAM,EAAY;EAClB;CACF;AACF"}
|
package/package.json
ADDED
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "dbf-mirador",
|
|
3
|
+
"version": "4.2.3",
|
|
4
|
+
"description": "An open-source, web-based 'multi-up' viewer that supports zoom-pan-rotate functionality, ability to display/compare simple images, and images with annotations.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/mirador.min.js",
|
|
7
|
+
"module": "./dist/mirador.es.js",
|
|
8
|
+
"files": [
|
|
9
|
+
"dist",
|
|
10
|
+
"src"
|
|
11
|
+
],
|
|
12
|
+
"sideEffects": [
|
|
13
|
+
"./demo/**"
|
|
14
|
+
],
|
|
15
|
+
"exports": {
|
|
16
|
+
"./src": "./src/index.js",
|
|
17
|
+
".": {
|
|
18
|
+
"import": "./dist/mirador.es.js",
|
|
19
|
+
"require": "./dist/mirador.min.js"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"scripts": {
|
|
23
|
+
"build": "vite build --config vite.config.js && vite build --config vite-umd.config.js",
|
|
24
|
+
"clean": "rm -rf ./dist",
|
|
25
|
+
"format": "prettier --write .",
|
|
26
|
+
"format:check": "prettier --check .",
|
|
27
|
+
"lint": "node_modules/.bin/eslint ./ && npm run lint:translations && npm run lint:containers",
|
|
28
|
+
"lint:containers": "node ./scripts/container-lint.js",
|
|
29
|
+
"lint:translations": "node ./scripts/i18n-lint.js",
|
|
30
|
+
"size": "size-limit",
|
|
31
|
+
"start": "vite",
|
|
32
|
+
"test": "npm run build && npm run lint && npm run size && vitest run"
|
|
33
|
+
},
|
|
34
|
+
"license": "Apache-2.0",
|
|
35
|
+
"contributors": [
|
|
36
|
+
"Drew Winget <scipioaffricanus@gmail.com> (https://aeschylus.net/)",
|
|
37
|
+
"Jack Reed <phillipjreed@gmail.com> (https://www.jack-reed.com)"
|
|
38
|
+
],
|
|
39
|
+
"repository": "https://github.com/ProjectMirador/mirador",
|
|
40
|
+
"dependencies": {
|
|
41
|
+
"@custom-react-hooks/use-element-size": "^1.5.1",
|
|
42
|
+
"@emotion/cache": "^11.11.0",
|
|
43
|
+
"@hello-pangea/dnd": "^18.0.0",
|
|
44
|
+
"@mui/icons-material": "^7.0.0",
|
|
45
|
+
"@mui/utils": "^7.0.0",
|
|
46
|
+
"@mui/x-tree-view": "^7.25.0",
|
|
47
|
+
"@react-aria/live-announcer": "^3.1.2",
|
|
48
|
+
"@react-hook/resize-observer": "^2.0.2",
|
|
49
|
+
"@redux-devtools/extension": "^3.3.0",
|
|
50
|
+
"@reduxjs/toolkit": "^2.12.0",
|
|
51
|
+
"classnames": "^2.2.6",
|
|
52
|
+
"copy-to-clipboard": "^3.3.1",
|
|
53
|
+
"deepmerge": "^4.2.2",
|
|
54
|
+
"dompurify": "^3.0.0",
|
|
55
|
+
"i18next": "^21.0.0 || ^22.0.0 || ^23.0.0 || ^24.0.0 || ^25.0.0 || ^26.0.0",
|
|
56
|
+
"lodash": "^4.17.11",
|
|
57
|
+
"manifesto.js": "^4.3.4",
|
|
58
|
+
"merge-refs": "^2.0.0",
|
|
59
|
+
"normalize-url": "^9.0.0",
|
|
60
|
+
"openseadragon": "^2.4.2 || ^3.0.0 || 4.0.x || ^4.1.1 || ^5.0.0",
|
|
61
|
+
"prop-types": "^15.6.2",
|
|
62
|
+
"rdndmb-html5-to-touch": "^9.0.0",
|
|
63
|
+
"re-reselect": "^5.0.0",
|
|
64
|
+
"react-dnd": "^16.0.0",
|
|
65
|
+
"react-dnd-html5-backend": "^16.0.0",
|
|
66
|
+
"react-dnd-multi-backend": "^9.0.0",
|
|
67
|
+
"react-dnd-touch-backend": "^16.0.0",
|
|
68
|
+
"react-error-boundary": "^5.0.0",
|
|
69
|
+
"react-image": "^4.0.1",
|
|
70
|
+
"react-intersection-observer": "^10.0.0",
|
|
71
|
+
"react-mosaic-component": "^7.0.0",
|
|
72
|
+
"react-redux": "^8.0.0 || ^9.0.0",
|
|
73
|
+
"react-rnd": "~10.5.3",
|
|
74
|
+
"react-window": "^2.2.7",
|
|
75
|
+
"redux": "^5.0.0",
|
|
76
|
+
"redux-saga": "^1.1.3",
|
|
77
|
+
"redux-thunk": "^3.1.0",
|
|
78
|
+
"reselect": "^5.0.0",
|
|
79
|
+
"stylis": "^4.3.0",
|
|
80
|
+
"stylis-plugin-rtl": "^2.1.1",
|
|
81
|
+
"url": "^0.11.0",
|
|
82
|
+
"use-debounce": "^10.0.4",
|
|
83
|
+
"use-effect-event": "^2.0.3",
|
|
84
|
+
"uuid": "^8.1.0 || ^9.0.0 || ^10.0.0 || ^11.0.0"
|
|
85
|
+
},
|
|
86
|
+
"devDependencies": {
|
|
87
|
+
"@emotion/react": "^11.10.6",
|
|
88
|
+
"@emotion/styled": "^11.10.6",
|
|
89
|
+
"@eslint/compat": "^2.0.3",
|
|
90
|
+
"@eslint/js": "^10.0.0",
|
|
91
|
+
"@mui/material": "^7.x",
|
|
92
|
+
"@mui/system": "^7.x",
|
|
93
|
+
"@size-limit/file": "^12.1.0",
|
|
94
|
+
"@testing-library/dom": "^10.4.0",
|
|
95
|
+
"@testing-library/jest-dom": "^6.1.5",
|
|
96
|
+
"@testing-library/react": "^16.3.2",
|
|
97
|
+
"@testing-library/user-event": "^14.4.3",
|
|
98
|
+
"@vitejs/plugin-react": "^6.0.1",
|
|
99
|
+
"@vitest/coverage-v8": "^4.1.2",
|
|
100
|
+
"@vitest/ui": "^4.1.2",
|
|
101
|
+
"chalk": "^5.3.0",
|
|
102
|
+
"eslint": "^10.0.0",
|
|
103
|
+
"eslint-config-prettier": "^10.1.8",
|
|
104
|
+
"eslint-plugin-import": "^2.32.0",
|
|
105
|
+
"eslint-plugin-jest-dom": "^5.5.0",
|
|
106
|
+
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
107
|
+
"eslint-plugin-prettier": "^5.5.6",
|
|
108
|
+
"eslint-plugin-react": "^7.37.5",
|
|
109
|
+
"eslint-plugin-react-hooks": "^5.2.0",
|
|
110
|
+
"eslint-plugin-testing-library": "^7.16.2",
|
|
111
|
+
"glob": "^13.0.6",
|
|
112
|
+
"globals": "^16.0.0",
|
|
113
|
+
"happy-dom": "^20.0",
|
|
114
|
+
"jsdom": "^29.1.1",
|
|
115
|
+
"prettier": "^3.8.1",
|
|
116
|
+
"react": "^18.0.0 || ^19.0.0",
|
|
117
|
+
"react-dnd-test-backend": "^16.0.1",
|
|
118
|
+
"react-dom": "^18.0.0 || ^19.0.0",
|
|
119
|
+
"react-i18next": "^13.0.0 || ^14.0.0 || ^15.0.0 || ^17.0.0",
|
|
120
|
+
"redux-saga-test-plan": "^4.0.0-rc.3",
|
|
121
|
+
"size-limit": "^12.1.0",
|
|
122
|
+
"vite": "^8.2.1",
|
|
123
|
+
"vitest": "^4.1.2",
|
|
124
|
+
"vitest-fetch-mock": "^0.4.2"
|
|
125
|
+
},
|
|
126
|
+
"overrides": {
|
|
127
|
+
"brace-expansion@1": "^1.1.16"
|
|
128
|
+
},
|
|
129
|
+
"peerDependencies": {
|
|
130
|
+
"@emotion/react": "^11.10.6",
|
|
131
|
+
"@emotion/styled": "^11.10.6",
|
|
132
|
+
"@mui/material": "^7.x",
|
|
133
|
+
"@mui/system": "^7.x",
|
|
134
|
+
"react": "^18.0.0 || ^19.0.0",
|
|
135
|
+
"react-dom": "^18.0.0 || ^19.0.0",
|
|
136
|
+
"react-i18next": "^13.0.0 || ^14.0.0 || ^15.0.0 || ^17.0.0"
|
|
137
|
+
}
|
|
138
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { useCallback } from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import { IIIFIFrameCommunication } from './IIIFIFrameCommunication';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Opens a new window for click
|
|
7
|
+
*/
|
|
8
|
+
export function AccessTokenSender({ handleAccessTokenMessage, url = undefined }) {
|
|
9
|
+
const onReceiveAccessTokenMessage = useCallback(
|
|
10
|
+
(e) => {
|
|
11
|
+
if (e.data && e.data.messageId && e.data.messageId === url) handleAccessTokenMessage(e.data);
|
|
12
|
+
},
|
|
13
|
+
[handleAccessTokenMessage, url],
|
|
14
|
+
);
|
|
15
|
+
|
|
16
|
+
if (!url) return null;
|
|
17
|
+
|
|
18
|
+
const src = new URL(url);
|
|
19
|
+
src.searchParams.append('origin', window.origin);
|
|
20
|
+
src.searchParams.append('messageId', url);
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
login, clickthrough/kiosk open @id, wait for close
|
|
24
|
+
external, no-op
|
|
25
|
+
*/
|
|
26
|
+
return (
|
|
27
|
+
<IIIFIFrameCommunication src={src.toString()} title="AccessTokenSender" handleReceiveMessage={onReceiveAccessTokenMessage} />
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
AccessTokenSender.propTypes = {
|
|
32
|
+
handleAccessTokenMessage: PropTypes.func.isRequired,
|
|
33
|
+
url: PropTypes.string,
|
|
34
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import PropTypes from 'prop-types';
|
|
2
|
+
import VisibilityIcon from '@mui/icons-material/VisibilitySharp';
|
|
3
|
+
import VisibilityOffIcon from '@mui/icons-material/VisibilityOffSharp';
|
|
4
|
+
import { useTranslation } from 'react-i18next';
|
|
5
|
+
import MiradorMenuButton from '../containers/MiradorMenuButton';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* AnnotationSettings is a component to handle various annotation
|
|
9
|
+
* display settings in the Annotation companion window
|
|
10
|
+
*/
|
|
11
|
+
export function AnnotationSettings({ displayAll, displayAllDisabled, toggleAnnotationDisplay }) {
|
|
12
|
+
const { t } = useTranslation();
|
|
13
|
+
return (
|
|
14
|
+
<MiradorMenuButton
|
|
15
|
+
aria-label={t(displayAll ? 'displayNoAnnotations' : 'highlightAllAnnotations')}
|
|
16
|
+
onClick={toggleAnnotationDisplay}
|
|
17
|
+
disabled={displayAllDisabled}
|
|
18
|
+
size="small"
|
|
19
|
+
>
|
|
20
|
+
{displayAll ? <VisibilityIcon /> : <VisibilityOffIcon />}
|
|
21
|
+
</MiradorMenuButton>
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
AnnotationSettings.propTypes = {
|
|
26
|
+
displayAll: PropTypes.bool.isRequired,
|
|
27
|
+
displayAllDisabled: PropTypes.bool.isRequired,
|
|
28
|
+
toggleAnnotationDisplay: PropTypes.func.isRequired,
|
|
29
|
+
// eslint-disable-next-line react/no-unused-prop-types
|
|
30
|
+
windowId: PropTypes.string.isRequired,
|
|
31
|
+
};
|