Skip to content

Commit c605e0f

Browse files
authored
Merge branch 'main' into manifest-getValue-locale2
2 parents c92dd06 + e5470d6 commit c605e0f

9 files changed

Lines changed: 21 additions & 38 deletions

File tree

.github/workflows/node.js.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ name: Node.js CI
55

66
on:
77
push:
8-
branches: [ master ]
8+
branches: [ main ]
99
pull_request:
10-
branches: [ master ]
10+
branches: [ main ]
1111

1212
jobs:
1313
build:
@@ -23,7 +23,7 @@ jobs:
2323
with:
2424
node-version: ${{ matrix.node-version }}
2525
- run: npm install
26-
- run: npm test
26+
- run: npm test -- --coverage
2727
- name: Upload coverage to Codecov
2828
uses: codecov/codecov-action@v5
2929
env:

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ Contributions to Mirador are always welcome!
77

88
It is always helpful to begin any large change by submitting an issue or engaging with the Mirador community. Mirador 3.0 and beyond adheres to [semantic versioning](https://semver.org/) so that adopters and contributors can better understand what changes can be expected in released versions of the software.
99

10-
All contributions should be submitted as a [GitHub pull request](https://help.github.com/articles/about-pull-requests/) to the master branch. Pull requests must be reviewed and accepted by another Mirador maintainer and pass all continuous integration checks. Contributions should have tests for the feature or bug fix, documentation, should maintain high code coverage, and should conform to the Mirador agreed-upon coding style. Contributions should not include a “built” version of Mirador—this will help to reduce merge conflicts.
10+
All contributions should be submitted as a [GitHub pull request](https://help.github.com/articles/about-pull-requests/) to the main branch. Pull requests must be reviewed and accepted by another Mirador maintainer and pass all continuous integration checks. Contributions should have tests for the feature or bug fix, documentation, should maintain high code coverage, and should conform to the Mirador agreed-upon coding style. Contributions should not include a “built” version of Mirador—this will help to reduce merge conflicts.
1111

1212
### Code of Conduct
13-
Everyone interacting in this community is expected to follow the [Mirador Code of Conduct](https://github.com/ProjectMirador/mirador/blob/master/CODE_OF_CONDUCT.md).
13+
Everyone interacting in this community is expected to follow the [Mirador Code of Conduct](https://github.com/ProjectMirador/mirador/blob/main/CODE_OF_CONDUCT.md).
1414

1515
### Accessibility
1616
Mirador 3 aims to comply with the [Web Content Accessibility Guidelines (WCAG) 2.1 AA](https://www.w3.org/WAI/standards-guidelines/wcag/). These guidelines, authored by the W3C and legally adopted [internationally](https://www.w3.org/WAI/policies/?q=wcag-20), are comprehensive and provide the success criteria designers and developers need to build accessible web applications.

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Mirador
2-
![Node.js CI](https://github.com/ProjectMirador/mirador/workflows/Node.js%20CI/badge.svg) [![codecov](https://codecov.io/gh/ProjectMirador/mirador/branch/master/graph/badge.svg)](https://codecov.io/gh/ProjectMirador/mirador)
2+
![Node.js CI](https://github.com/ProjectMirador/mirador/workflows/Node.js%20CI/badge.svg) [![codecov](https://codecov.io/gh/ProjectMirador/mirador/branch/main/graph/badge.svg)](https://codecov.io/gh/ProjectMirador/mirador)
33

44
## For Mirador Users
55
You can quickly use and configure Mirador by remixing the [mirador-start](https://mirador-start.glitch.me/) Glitch.
@@ -14,7 +14,7 @@ $ npm install mirador
1414
$ yarn add mirador
1515
```
1616

17-
If you are interested in integrating Mirador with plugins into your project, we recommend using webpack or parcel to integrate the es version of the packages. Examples are here:
17+
If you are interested in integrating Mirador with plugins into your project, we recommend using vite to integrate the es version of the packages. Examples are here:
1818

1919
[https://github.com/ProjectMirador/mirador-integration](https://github.com/ProjectMirador/mirador-integration)
2020

@@ -24,7 +24,7 @@ If you want to simply embed Mirador in an HTML page without further customizatio
2424
<script src="https://unpkg.com/mirador@latest/dist/mirador.min.js"></script>
2525
```
2626

27-
More examples of embedding Mirador can be found at [https://github.com/ProjectMirador/mirador/wiki/M3-Embedding-in-Another-Environment#in-an-html-document-with-javascript](https://github.com/ProjectMirador/mirador/wiki/M3-Embedding-in-Another-Environment#in-an-html-document-with-javascript).
27+
More examples of embedding Mirador can be found at [https://github.com/ProjectMirador/mirador/wiki/M3-Embedding-in-Another-Environment#in-an-html-document-with-javascript](https://github.com/ProjectMirador/mirador/wiki/Embedding-in-Another-Environment).
2828

2929
## Adding translations to Mirador
3030
For help with adding a translation, see [src/locales/README.md](src/locales/README.md)

__tests__/src/components/AccessTokenSender.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ describe('AccessTokenSender', () => {
2222
it('renders properly', () => {
2323
const { container } = createWrapper({ url: 'http://example.com' });
2424

25-
expect(container.querySelector('iframe')).toHaveAttribute('src', 'http://example.com?origin=http://localhost&messageId=http://example.com'); // eslint-disable-line testing-library/no-node-access, testing-library/no-container
25+
expect(container.querySelector('iframe')).toHaveAttribute('src', 'http://example.com/?origin=http%3A%2F%2Flocalhost&messageId=http%3A%2F%2Fexample.com'); // eslint-disable-line testing-library/no-node-access, testing-library/no-container
2626
});
2727

2828
it('triggers an action when the iframe sends a message', () => {

src/components/AccessTokenSender.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,17 @@ export function AccessTokenSender({ handleAccessTokenMessage, url = undefined })
1212

1313
if (!url) return null;
1414

15+
const src = new URL(url);
16+
src.searchParams.append('origin', window.origin);
17+
src.searchParams.append('messageId', url);
18+
1519
/**
1620
login, clickthrough/kiosk open @id, wait for close
1721
external, no-op
1822
*/
1923
return (
2024
<IIIFIFrameCommunication
21-
src={`${url}?origin=${window.origin}&messageId=${url}`}
25+
src={src.toString()}
2226
title="AccessTokenSender"
2327
handleReceiveMessage={onReceiveAccessTokenMessage}
2428
/>

src/components/CompanionWindow.js

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Children, cloneElement } from 'react';
1+
import { Children, cloneElement, forwardRef } from 'react';
22
import { useSelector } from 'react-redux';
33
import PropTypes from 'prop-types';
44
import { styled } from '@mui/material/styles';
@@ -29,11 +29,11 @@ const StyledCloseButton = styled(MiradorMenuButton, { name: 'CompanionWindow', s
2929
/**
3030
* CompanionWindow
3131
*/
32-
export function CompanionWindow(props) { // eslint-disable-line react/require-default-props
32+
export const CompanionWindow = forwardRef((props, innerRef) => {
3333
const {
3434
ariaLabel = undefined, classes = {}, direction, id, paperClassName = '', onCloseClick = () => {}, updateCompanionWindow = undefined, isDisplayed = false,
3535
position = null, title = null, children = undefined, titleControls = null,
36-
defaultSidebarPanelWidth = 235, defaultSidebarPanelHeight = 201, innerRef = undefined,
36+
defaultSidebarPanelWidth = 235, defaultSidebarPanelHeight = 201,
3737
} = props;
3838
const [sizeRef, size] = useElementSize();
3939
const { t } = useTranslation();
@@ -189,7 +189,7 @@ export function CompanionWindow(props) { // eslint-disable-line react/require-de
189189
</LocaleContext.Provider>
190190
</Root>
191191
);
192-
}
192+
});
193193

194194
CompanionWindow.propTypes = {
195195
ariaLabel: PropTypes.string,
@@ -199,10 +199,6 @@ CompanionWindow.propTypes = {
199199
defaultSidebarPanelWidth: PropTypes.number,
200200
direction: PropTypes.string.isRequired,
201201
id: PropTypes.string.isRequired,
202-
innerRef: PropTypes.oneOfType([
203-
PropTypes.func,
204-
PropTypes.shape({ current: PropTypes.instanceOf(Element) }),
205-
]),
206202
isDisplayed: PropTypes.bool,
207203
onCloseClick: PropTypes.func,
208204
paperClassName: PropTypes.string,
@@ -215,3 +211,5 @@ CompanionWindow.propTypes = {
215211
titleControls: PropTypes.node,
216212
updateCompanionWindow: PropTypes.func,
217213
};
214+
215+
CompanionWindow.displayName = 'CompanionWindow';

src/components/WindowCanvasNavigationControls.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ export const WindowCanvasNavigationControls = forwardRef(({
7777

7878
WindowCanvasNavigationControls.propTypes = {
7979
showZoomControls: PropTypes.bool,
80-
size: PropTypes.shape({ width: PropTypes.number }).isRequired,
8180
visible: PropTypes.bool,
8281
windowId: PropTypes.string.isRequired,
8382
zoomToWorld: PropTypes.func.isRequired,

src/state/selectors/manifests.js

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -90,20 +90,6 @@ function getProperty(property) {
9090
);
9191
}
9292

93-
/**
94-
* Returns the manifest provider.
95-
* @param {object} state
96-
* @param {object} props
97-
* @param {string} props.companionWindowId
98-
* @returns {string}
99-
*/
100-
export const getManifestProvider = createSelector(
101-
[
102-
getProperty('provider'),
103-
],
104-
(provider) => provider,
105-
);
106-
10793
/**
10894
* Return the IIIF v3 provider of a manifest or null.
10995
* @param {object} state
@@ -129,7 +115,7 @@ export const getManifestProviderName = createSelector(
129115
* @returns {string|null}
130116
*/
131117
export const getProviderLogo = createSelector(
132-
[getManifestProvider],
118+
[getProperty('provider')],
133119
(provider) => {
134120
const logo = provider && provider[0] && provider[0].logo && provider[0].logo[0];
135121
if (!logo) return null;

vitest.config.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,6 @@ export default defineConfig({
3333
},
3434
},
3535
test: {
36-
coverage: {
37-
all: true,
38-
enabled: true,
39-
},
4036
environment: 'happy-dom',
4137
exclude: ['node_modules'],
4238
globals: true,

0 commit comments

Comments
 (0)