@museumwnf/viewer-layout 3.61.0 → 3.62.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.61.0",
3
+ "version": "3.62.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",
@@ -78,9 +78,10 @@ function collectionTest(mountSite, collection = {}, { gallery = false } = {}) {
78
78
  await vi.waitFor(() => expect(host.querySelector(tile)).not.toBeNull(), WAIT)
79
79
  expect(host.querySelector('.mwnf-catalogue')).not.toBeNull()
80
80
  expect(host.querySelector('.mwnf-catalogue__aside .mwnf-filter')).not.toBeNull()
81
- const count = host.querySelector('.mwnf-summary__count')
81
+ // A gallery prints legacy's "<n> result(s) out of <total> objects".
82
+ const count = host.querySelector(gallery ? '.mwnf-dxa-gallery-results__info p + p' : '.mwnf-summary__count')
82
83
  expect(count).not.toBeNull()
83
- const objects = Number(count.textContent.replace(/\D/g, ''))
84
+ const objects = Number(count.textContent.match(/\d+/)?.[0] ?? NaN)
84
85
  const tiles = host.querySelectorAll(tile).length
85
86
  const paginations = host.querySelectorAll('.mwnf-pagination').length
86
87
  if (gallery) expect(tiles).toBe(firstPage(objects))
@@ -224,13 +225,17 @@ export function describeGallerySmoke({ config, sharedTexts, ownTexts, manifest,
224
225
 
225
226
  collectionTest(mountSite, picks.collection, { gallery: true })
226
227
 
227
- it('renders the collection entrance on the composed search form view', async () => {
228
+ it("renders the collection entrance as legacy's", async () => {
228
229
  const { app, host } = await mountSite('#/collection')
229
- await vi.waitFor(() => expect(host.querySelector('.mwnf-search-form')).not.toBeNull(), WAIT)
230
- // The country dropdown plus at least one populated tag category, and
231
- // the shared from/to year buckets.
232
- expect(host.querySelectorAll('.mwnf-search-form .mwnf-facet').length).toBeGreaterThan(1)
233
- expect(host.querySelector('.mwnf-search-form__dates')).not.toBeNull()
230
+ await vi.waitFor(() => expect(host.querySelector('.mwnf-dxa-gallery-collection__select')).not.toBeNull(), WAIT)
231
+ // The country dropdown plus at least one populated category, each
232
+ // opening on its name, and the start and end dates with their years.
233
+ const lists = [...host.querySelectorAll('.mwnf-dxa-gallery-collection__select')]
234
+ expect(lists.length).toBeGreaterThan(3)
235
+ for (const list of lists) expect(list.selectedOptions[0]?.disabled).toBe(true)
236
+ const dates = host.querySelectorAll('.mwnf-dxa-gallery-collection__dates select')
237
+ expect(dates).toHaveLength(2)
238
+ expect(dates[0].options.length).toBeGreaterThan(1)
234
239
  expect(host.textContent).toContain('this Gallery’s database')
235
240
  app.unmount()
236
241
  }, 30000)
@@ -273,6 +278,24 @@ export function describeGallerySmoke({ config, sharedTexts, ownTexts, manifest,
273
278
  app.unmount()
274
279
  }, 60000)
275
280
 
281
+ // On display in (inventory-app#2423): the exhibition pages that show an
282
+ // item, a mini-site's under its project, each an online exhibition's under
283
+ // its title. A package exported before the field has none to show.
284
+ it('lists the exhibition pages that show an item under On display in', async () => {
285
+ const [items] = await loadEntities(['items'])
286
+ const item = items.find((i) => i.exhibition_references?.some((ref) => ref.list !== 'exhibition'))
287
+ ?? items.find((i) => i.exhibition_references?.length)
288
+ if (!item) return
289
+ const { app, host } = await mountSite(`#/item/${item.id}`)
290
+ await vi.waitFor(() => expect(host.querySelector('.mwnf-on-display__caption')).not.toBeNull(), WAIT)
291
+ const lines = [...host.querySelectorAll('.mwnf-on-display__item')].map((li) => li.textContent)
292
+ for (const ref of item.exhibition_references.filter((r) => r.list !== 'exhibition')) {
293
+ const name = ref.exhibition.titles.en ?? Object.values(ref.exhibition.titles)[0]
294
+ if (name) expect(lines.some((line) => line.includes(name))).toBe(true)
295
+ }
296
+ app.unmount()
297
+ }, 60000)
298
+
276
299
  outsideReferenceTest(mountSite, manifest, sharedTexts)
277
300
 
278
301
  // The Source box takes the colour `projectColors` gives the item's
@@ -32,11 +32,26 @@
32
32
  italic face is narrower (inventory-app#2423, the partner badges). */
33
33
  @import url('https://fonts.googleapis.com/css2?family=Roboto+Condensed:wght@300;400;700&family=Roboto:ital,wght@0,300;0,400;0,500;0,700;1,400&display=swap');
34
34
 
35
+ /* The arrows the pages print before a link (↗, ➤, ➦), which Roboto Condensed
36
+ lacks: from a symbol font the system has, held within Roboto Condensed's
37
+ own line, so a line with an arrow keeps the normal height of legacy's lines
38
+ (legacy drew its arrows as icons). Without one of these fonts, the browser
39
+ picks its own, as before. */
40
+ @font-face {
41
+ font-family: 'mwnf-arrows';
42
+ src: local('Segoe UI Symbol'), local('SegoeUISymbol'), local('Apple Symbols'), local('DejaVu Sans'),
43
+ local('Noto Sans Symbols 2'), local('Noto Sans Symbols'), local('Arial Unicode MS');
44
+ unicode-range: U+2197, U+27A4, U+27A6;
45
+ ascent-override: 75%;
46
+ descent-override: 15%;
47
+ line-gap-override: 0%;
48
+ }
49
+
35
50
  /* ── Theme: the family's tokens, read from the palette ───────────────────── */
36
51
  :root {
37
52
  /* ---------- Global ---------- */
38
- --mwnf-font-body: 'Roboto Condensed', 'Roboto', Arial, sans-serif;
39
- --mwnf-font-heading: 'Roboto Condensed', 'Roboto', Arial, sans-serif;
53
+ --mwnf-font-body: 'Roboto Condensed', 'mwnf-arrows', 'Roboto', Arial, sans-serif;
54
+ --mwnf-font-heading: 'Roboto Condensed', 'mwnf-arrows', 'Roboto', Arial, sans-serif;
40
55
  --mwnf-line-height: 1.4;
41
56
  --mwnf-weight-heading: 700;
42
57
  --mwnf-color-text: #1a1a1a;
@@ -1,45 +0,0 @@
1
- import { n as e } from "./chrome-Bv_mLlHM.js";
2
- import { partnerView as t, useSiteConfig as n } from "@museumwnf/viewer-core";
3
- import { FACET_CATEGORIES as r, FACET_LABEL_KEYS as i, GALLERY_ERA_WORDS as a, useFacetLabels as o, useGalleryCollection as s, useGalleryData as c, useGalleryItemDetail as l, useGalleryPartner as u, useGalleryTimeline as d } from "@museumwnf/viewer-core/dxa";
4
- // src/dxa/gallery/data.js
5
- var f = c(), p = s(f), m = d(f, p), h = u(f, p), { itemDetail: g } = l(f, m), { manifest: _, defaultLang: v, tr: y, md: b, mdInline: x, loadEnglish: S, labelOf: C, gallery: w, items: T, itemById: E, partners: D, countries: O, timelines: k, partnerById: A, itemRoute: j, partnerRoute: M, partnerObjectsRoute: N, itemFromUidPath: P, partnerFromKey: F, pickSiblings: I, siblingUrl: L } = f;
6
- function R(t, r = "hi_res") {
7
- return e(n().chrome, t) ?? f.chromeImage(t, r);
8
- }
9
- var { FACETS: z, haystack: B, tile: V, legacyOrder: H, collectionResults: U, countryIdForCode: W } = p, G = {
10
- pageSize: 20,
11
- sort: {
12
- undated: "first",
13
- tiebreak: (e, t) => H(e, t)
14
- }
15
- }, { timelineResults: K, timelineGallery: q } = m, { partnerList: J, partnerSheet: Y, partnerObjects: X } = h, Z = {
16
- countryLabel: (e) => C("countries", e),
17
- md: b,
18
- mdInline: x,
19
- route: M,
20
- objectsRoute: N
21
- };
22
- function Q(e) {
23
- let n = (D.value ?? []).filter((e) => e.featured);
24
- for (let e = n.length - 1; e > 0; e--) {
25
- let t = Math.floor(Math.random() * (e + 1));
26
- [n[e], n[t]] = [n[t], n[e]];
27
- }
28
- return n.slice(0, e).map((e) => t(e, y("partners", e.id, v), Z));
29
- }
30
- var $ = {
31
- spec: {
32
- ...Y,
33
- media: () => []
34
- },
35
- visible: () => !0,
36
- view: (e, n) => t(e, {
37
- ...y("partners", e.id, v),
38
- ...n
39
- }, Z),
40
- labels: { partner: {
41
- objects: "partner.action.viewObjects",
42
- homepage: "partner.nav.homepage"
43
- } }
44
- };
45
- export { q as A, J as C, I as D, M as E, k as M, y as N, L as O, o as P, F as S, N as T, G as _, R as a, A as b, v as c, B as d, E as f, C as g, T as h, a as i, K as j, V as k, Q as l, P as m, r as n, U as o, g as p, i as r, W as s, z as t, w as u, S as v, X as w, $ as x, _ as y };