@museumwnf/viewer-layout 3.63.0 → 3.64.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.63.0",
3
+ "version": "3.64.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",
@@ -269,7 +269,9 @@ export function describeGallerySmoke({ config, sharedTexts, ownTexts, manifest,
269
269
  const dates = host.querySelectorAll('.mwnf-dxa-gallery-collection__dates select')
270
270
  expect(dates).toHaveLength(2)
271
271
  expect(dates[0].options.length).toBeGreaterThan(1)
272
- expect(host.textContent).toContain('this Gallery’s database')
272
+ // Legacy's text, naming the gallery: "… exploring the <name> database."
273
+ expect(host.querySelector('.mwnf-dxa-gallery-collection__description em')?.textContent).toBeTruthy()
274
+ expect(host.querySelector('.mwnf-dxa-gallery-collection__description').textContent).toContain(' database. A range of filters')
273
275
  app.unmount()
274
276
  }, 30000)
275
277
 
@@ -329,6 +331,22 @@ export function describeGallerySmoke({ config, sharedTexts, ownTexts, manifest,
329
331
  app.unmount()
330
332
  }, 60000)
331
333
 
334
+ // Legacy heads a record's videos "Related Videos" (and its audio "Related
335
+ // Audio"), each a ↗ line of the sidebar (inventory-app#2423).
336
+ it('lists a record\'s videos under "Related Videos"', async () => {
337
+ const [items] = await loadEntities(['items'])
338
+ const item = items.find((i) => i.media?.some((m) => m.type === 'video' && m.url && (!m.language || m.language === 'en')))
339
+ if (!item) return
340
+ const { app, host } = await mountSite(`#/item/${item.id}?lang=en`)
341
+ await vi.waitFor(() => expect(host.querySelector('.mwnf-sheet-related__media--video')).not.toBeNull(), WAIT)
342
+ const block = host.querySelector('.mwnf-sheet-related__media--video')
343
+ expect(block.querySelector('.mwnf-sheet-related__heading').textContent).toBe('Related Videos')
344
+ const video = item.media.find((m) => m.type === 'video' && m.url && (!m.language || m.language === 'en'))
345
+ expect([...block.querySelectorAll('a')].map((a) => a.getAttribute('href'))).toContain(video.url)
346
+ expect(host.querySelector('.mwnf-related-media')).toBeNull()
347
+ app.unmount()
348
+ }, 60000)
349
+
332
350
  outsideReferenceTest(mountSite, manifest, sharedTexts)
333
351
 
334
352
  // The Source box takes the colour `projectColors` gives the item's
@@ -2246,8 +2246,11 @@ a { color: inherit; }
2246
2246
  font-size: 20px;
2247
2247
  font-weight: 400;
2248
2248
  }
2249
+ /* Legacy's profile prints the place in the profile's own text colour, never a site's muted
2250
+ one (Arts in Dialogue's is yellow, for text on its green page). */
2249
2251
  .mwnf-dxa-exhibition-profile .mwnf-partner-panel__location {
2250
2252
  margin: 0;
2253
+ color: inherit;
2251
2254
  font-style: italic;
2252
2255
  font-weight: 700;
2253
2256
  }
@@ -1,77 +0,0 @@
1
- import { n as e } from "./chrome-Bv_mLlHM.js";
2
- import { partnerView as t, renderInline as n, useSiteConfig as r } from "@museumwnf/viewer-core";
3
- import { useExhibitionCollection as i, useExhibitionData as a, useExhibitionItemDetail as o, useExhibitionPartner as s, useExhibitionThemes as c, useExhibitionTimeline as l } from "@museumwnf/viewer-core/dxa";
4
- // src/dxa/exhibition/data.js
5
- var u = a(), d = i(u), f = l(u, d), p = s(u), m = c(u), { itemDetail: h } = o(u, f), { defaultLang: g, tr: _, md: v, mdInline: y, mdStrip: ee, labelOf: b, loadEnglish: x, exhibition: S, relatedContent: C, items: w, itemById: T, countries: E, timelines: te, visiblePartners: D, visiblePartnerById: O, isHiddenPartner: k, itemRoute: A, partnerRoute: j, partnerObjectsRoute: M, countryLabelFromCode: N, exhibitionTitle: P, exhibitionSubtitle: F, exhibitionHeadline: ne, bannerCaption: I, projectName: L } = u;
6
- function R(t, n = "hi_res") {
7
- return e(r().chrome, t) ?? u.chromeImage(t, n);
8
- }
9
- var { FACETS: z, haystack: B, tile: re, collectionResults: V, countryIdForCode: ie } = d, H = (e, t) => String(e ?? "").localeCompare(String(t ?? ""), "en", { sensitivity: "base" });
10
- function U(e, t) {
11
- let n = String(e ?? "").split(":"), r = String(t ?? "").split(":");
12
- for (let e = 0; e < Math.max(n.length, r.length); e++) {
13
- let t = n[e] ?? "", i = r[e] ?? "";
14
- if (t !== i) return /^\d+$/.test(t) && /^\d+$/.test(i) ? Number(t) - Number(i) : t.localeCompare(i, "en");
15
- }
16
- return 0;
17
- }
18
- function W(e, t) {
19
- return H(b("countries", e.country_id), b("countries", t.country_id)) || H(b("partners", e.partner_id), b("partners", t.partner_id)) || U(e.backward_compatibility, t.backward_compatibility);
20
- }
21
- var G = {
22
- pageSize: 20,
23
- sort: {
24
- undated: "first",
25
- tiebreak: (e, t) => W(e, t)
26
- }
27
- };
28
- function K(e) {
29
- let t = _("items", e.id, g), r = t.dates ?? "";
30
- return {
31
- id: e.id,
32
- image: e.images?.[0]?.url ?? "",
33
- imageAlt: b("items", e.id),
34
- name: n(t.name ?? e.internal_name ?? ""),
35
- date: r.length > 80 ? `${r.slice(0, 80)}...` : r,
36
- partner: b("partners", e.partner_id),
37
- place: [t.location, b("countries", e.country_id)].filter(Boolean).join(", "),
38
- project: L(e, g) ?? "",
39
- to: A(e)
40
- };
41
- }
42
- var { hasTimeline: q, timelineSpec: J, timelineGallerySpec: Y } = f, { partnerListSpec: X, partnerSheetSpec: Z } = p, Q = {
43
- countryLabel: (e) => b("countries", e),
44
- md: v,
45
- mdInline: y,
46
- route: j,
47
- objectsRoute: M,
48
- hidden: k
49
- }, $ = {
50
- spec: {
51
- ...Z,
52
- media: () => [],
53
- sourceCredit: !1
54
- },
55
- visible: (e) => !!O(e),
56
- view: (e, n) => t(e, {
57
- ..._("partners", e.id, g),
58
- ...n
59
- }, Q),
60
- labels: {
61
- partner: {
62
- objects: "exhibition.action.viewItems",
63
- homepage: "exhibition.partner.homepage"
64
- },
65
- institution: {
66
- objects: "exhibition.action.viewItems",
67
- homepage: "exhibition.action.institutionHomepage"
68
- }
69
- },
70
- className: "mwnf-dxa-exhibition-profile",
71
- media: {
72
- thumbsFrom: 1,
73
- creditCaption: !1
74
- },
75
- legacyMap: { label: "exhibition.partner.mapLabel" }
76
- };
77
- export { J as A, $ as C, C as D, j as E, O as M, D as N, m as O, v as S, M as T, w as _, E as a, K as b, S as c, P as d, q as f, A as g, h, V as i, _ as j, Y as k, ne as l, T as m, I as n, N as o, B as p, R as r, g as s, z as t, F as u, b as v, X as w, x, G as y };
@@ -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, GALLERY_ERA_WORDS as i, useGalleryCollection as a, useGalleryData as o, useGalleryItemDetail as s, useGalleryPartner as c, useGalleryTimeline as l } from "@museumwnf/viewer-core/dxa";
4
- // src/dxa/gallery/data.js
5
- var u = o(), d = a(u), f = l(u, d), p = c(u, d), { itemDetail: m } = s(u, f), { manifest: h, defaultLang: g, tr: _, md: v, mdInline: y, loadEnglish: b, labelOf: x, gallery: S, items: C, itemById: w, partners: T, countries: E, timelines: D, partnerById: O, itemRoute: k, partnerRoute: A, partnerObjectsRoute: j, itemFromUidPath: M, partnerFromKey: N, pickSiblings: P, siblingUrl: F } = u;
6
- function I(t, r = "hi_res") {
7
- return e(n().chrome, t) ?? u.chromeImage(t, r);
8
- }
9
- var { FACETS: L, haystack: R, tile: z, legacyOrder: B, collectionResults: V, countryIdForCode: H } = d, U = {
10
- pageSize: 20,
11
- sort: {
12
- undated: "first",
13
- tiebreak: (e, t) => B(e, t)
14
- }
15
- }, W = r.filter((e) => e !== "artist"), { timelineResults: G, timelineGallery: K } = f, { partnerList: q, partnerSheet: J, partnerObjects: Y } = p, X = {
16
- countryLabel: (e) => x("countries", e),
17
- md: v,
18
- mdInline: y,
19
- route: A,
20
- objectsRoute: j
21
- };
22
- function Z(e) {
23
- let n = (T.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, _("partners", e.id, g), X));
29
- }
30
- var Q = {
31
- spec: {
32
- ...J,
33
- media: () => []
34
- },
35
- visible: () => !0,
36
- view: (e, n) => t(e, {
37
- ..._("partners", e.id, g),
38
- ...n
39
- }, X),
40
- labels: { partner: {
41
- objects: "partner.action.viewObjects",
42
- homepage: "partner.nav.homepage"
43
- } }
44
- };
45
- export { G as A, Y as C, F as D, P as E, _ as M, z as O, q as S, A as T, b as _, V as a, Q as b, Z as c, w as d, m as f, U as g, x as h, I as i, D as j, K as k, S as l, C as m, i as n, H as o, M as p, W as r, g as s, L as t, R as u, h as v, j as w, N as x, O as y };