@museumwnf/viewer-layout 3.75.0 → 3.76.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@museumwnf/viewer-layout",
3
- "version": "3.75.0",
3
+ "version": "3.76.0",
4
4
  "description": "Page structure for MWNF websites: PageShell composing seven optional, token-styled sections, the content components a page is made of, and the composed views a website names instead of writing a page.",
5
5
  "type": "module",
6
6
  "license": "SEE LICENSE IN LICENSE.md",
@@ -169,17 +169,20 @@ function searchTests(mountSite, loadItems) {
169
169
 
170
170
  // Legacy's Related Objects: every related object a thumbnail under "Related
171
171
  // Objects", those outside this site's package too (inventory-app#2491). One
172
- // outside whose project has a site of its own links to it there.
173
- function relatedObjectsTest(mountSite, manifest, sharedTexts) {
174
- it('draws every related object as a thumbnail, those outside the gallery too', async () => {
172
+ // outside whose project has a site of its own links to it there. Both
173
+ // families drew them so; `heading` is the family's own word for them. An
174
+ // exhibition's sheet shows only the records its build carries in English.
175
+ function relatedObjectsTest(mountSite, manifest, heading) {
176
+ it('draws every related object as a thumbnail, those outside the package too', async () => {
175
177
  const [items] = await loadEntities(['items'])
176
- const item = items.find((i) => (i.related_items ?? []).some((ref) => ref.in_package === false))
177
- ?? items.find((i) => (i.related_items ?? []).length)
178
+ const shown = items.filter((i) => !i.languages?.length || i.languages.includes('en'))
179
+ const item = shown.find((i) => (i.related_items ?? []).some((ref) => ref.in_package === false))
180
+ ?? shown.find((i) => (i.related_items ?? []).length)
178
181
  if (!item) return
179
182
  const { app, host } = await mountSite(`#/item/${item.id}?lang=en`)
180
183
  await vi.waitFor(() => expect(host.querySelector('.mwnf-related-objects__tile')).not.toBeNull(), WAIT)
181
184
  const block = host.querySelector('.mwnf-related-objects')
182
- expect(block.querySelector('.mwnf-related-objects__heading').textContent).toBe(sharedTexts.en['gallery.related.objects'])
185
+ expect(block.querySelector('.mwnf-related-objects__heading').textContent).toBe(heading)
183
186
  expect(block.querySelectorAll('.mwnf-related-objects__tile')).toHaveLength(item.related_items.length)
184
187
  const outside = item.related_items.find((ref) => ref.in_package === false && manifest.projects[ref.project_id]?.home_site)
185
188
  if (outside) {
@@ -187,8 +190,10 @@ function relatedObjectsTest(mountSite, manifest, sharedTexts) {
187
190
  expect(hrefs.some((href) => href.endsWith(`/item/${outside.id}`))).toBe(true)
188
191
  }
189
192
  expect(host.querySelector('.mwnf-sheet-related__references')).toBeNull()
190
- // Only in the sidebar: the sheet draws no grid of its own under the citation.
193
+ // Only in the sidebar: the sheet draws no grid of its own under the
194
+ // citation, and the sidebar no tile grid with a card on hover.
191
195
  expect(host.querySelector('.mwnf-record__main .mwnf-related')).toBeNull()
196
+ expect(host.querySelector('.mwnf-record__aside .mwnf-grid')).toBeNull()
192
197
  app.unmount()
193
198
  }, 60000)
194
199
  }
@@ -365,7 +370,7 @@ export function describeGallerySmoke({ config, sharedTexts, ownTexts, manifest,
365
370
  app.unmount()
366
371
  }, 60000)
367
372
 
368
- relatedObjectsTest(mountSite, manifest, sharedTexts)
373
+ relatedObjectsTest(mountSite, manifest, sharedTexts.en['gallery.related.objects'])
369
374
 
370
375
  // The Source box takes the colour `projectColors` gives the item's
371
376
  // project, and the citation its name from the manifest.
@@ -699,6 +704,8 @@ export function describeExhibitionSmoke({
699
704
  app.unmount()
700
705
  }, 60000)
701
706
 
707
+ relatedObjectsTest(mountSite, manifest, messages.en['exhibition.related.objects'])
708
+
702
709
  // On display in: this exhibition's own pages that show the item open
703
710
  // here, as legacy's did.
704
711
  it("lists the exhibition's own pages that show an item under On display in", async () => {
@@ -2167,6 +2167,15 @@ a { color: inherit; }
2167
2167
  .mwnf-dxa-exhibition-item .mwnf-record__aside .mwnf-sheet-related__heading { font-size: 20px; }
2168
2168
  .mwnf-dxa-exhibition-item .mwnf-record__aside .mwnf-sheet-related__description { font-size: 16px; }
2169
2169
  .mwnf-dxa-exhibition-item .mwnf-sheet-notice { font-size: 16px; }
2170
+ /* The related objects' tooltip (RelatedObjects.vue) on black at 16px, where
2171
+ the galleries' takes their dark tone at 90%. */
2172
+ .mwnf-dxa-exhibition-item .mwnf-related-objects__tooltip {
2173
+ background: #000000;
2174
+ font-size: 16px;
2175
+ }
2176
+ .mwnf-dxa-exhibition-item .mwnf-related-objects__tooltip::after {
2177
+ border-inline-start-color: #000000;
2178
+ }
2170
2179
  .mwnf-dxa-exhibition-item .mwnf-media__image {
2171
2180
  max-height: 325px;
2172
2181
  object-position: left;