@museumwnf/viewer-layout 3.60.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/dist/views.js CHANGED
@@ -1,7 +1,7 @@
1
- import { t as e } from "./FeaturedRecord-DLYyyRey.js";
2
- import { s as t } from "./TimelineEventList-e1fNm28F.js";
3
- import { a as n, i as r, n as i, o as a, r as o, s, t as c } from "./TimelineResultsView-Cl_LcM--.js";
4
- import { t as l } from "./RecordView-n7bbQUg2.js";
1
+ import { t as e } from "./FeaturedRecord-DaGLHyhD.js";
2
+ import { s as t } from "./TimelineEventList-1feZA5t7.js";
3
+ import { a as n, i as r, n as i, o as a, r as o, s, t as c } from "./TimelineResultsView-CkH3NDqL.js";
4
+ import { t as l } from "./RecordView-BE4mbj6G.js";
5
5
  import { computed as u, createBlock as d, createCommentVNode as f, createElementBlock as p, createVNode as m, mergeProps as h, normalizeClass as g, openBlock as _, renderSlot as v, toDisplayString as y, unref as b } from "vue";
6
6
  import { I18nText as x, renderInline as S, renderPlain as C, useDataPackage as w, useFeaturedRecord as T, useI18n as E, useSiteConfig as D } from "@museumwnf/viewer-core";
7
7
  // src/views/HomeView.vue
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@museumwnf/viewer-layout",
3
- "version": "3.60.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",
@@ -43,12 +43,12 @@
43
43
  "test": "vitest run"
44
44
  },
45
45
  "peerDependencies": {
46
- "@museumwnf/viewer-core": "^2.16.0",
46
+ "@museumwnf/viewer-core": "^2.17.0",
47
47
  "vue": "^3.5.0",
48
48
  "vue-router": "^4.5.0 || ^5.0.0"
49
49
  },
50
50
  "devDependencies": {
51
- "@museumwnf/viewer-core": "^2.16.0",
51
+ "@museumwnf/viewer-core": "^2.17.0",
52
52
  "@vitejs/plugin-vue": "^6.0.10",
53
53
  "@vue/test-utils": "^2.5.1",
54
54
  "jsdom": "^30.1.3",
@@ -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)
@@ -264,22 +269,42 @@ export function describeGallerySmoke({ config, sharedTexts, ownTexts, manifest,
264
269
  // is never shown.
265
270
  expect(host.querySelector('.mwnf-record__aside .mwnf-sheet-related')).not.toBeNull()
266
271
  expect(host.textContent).not.toContain('mwnf3:')
267
- // The "Source database" line names the item's project from the manifest.
272
+ // Legacy's sheet (inventory-app#2423): Source and My Collection under
273
+ // the pictures, and the citation names the item's project from the
274
+ // manifest.
275
+ expect(host.querySelectorAll('.mwnf-record__media .mwnf-dxa-gallery-item__links a')).toHaveLength(2)
268
276
  const projectName = manifest.projects[items[0].project_id]?.name?.en ?? ''
269
- expect(host.querySelector('.mwnf-sheet-source').textContent).toContain(projectName)
277
+ expect(host.querySelector('.mwnf-dxa-gallery-item__credits').textContent).toContain(projectName)
278
+ app.unmount()
279
+ }, 60000)
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
+ }
270
296
  app.unmount()
271
297
  }, 60000)
272
298
 
273
299
  outsideReferenceTest(mountSite, manifest, sharedTexts)
274
300
 
275
- // The chip's colour and text come from `projectColors` and the manifest's
276
- // project name, keyed by the item's `project_id`.
277
- it('colours and names the source-database chip from the manifest projects section', async () => {
301
+ // The Source box takes the colour `projectColors` gives the item's
302
+ // project, and the citation its name from the manifest.
303
+ it("colours the Source box and names the citation's project from the manifest projects section", async () => {
278
304
  const { app, host } = await mountSite(`#/item/${chip.item}`)
279
- await vi.waitFor(() => expect(host.querySelector('.mwnf-sheet-source .mwnf-chip')).not.toBeNull(), WAIT)
280
- const line = host.querySelector('.mwnf-sheet-source__line')
281
- expect(line.textContent).toContain(chip.project)
282
- expect(line.querySelector('.mwnf-chip').classList.contains(chip.className)).toBe(true)
305
+ await vi.waitFor(() => expect(host.querySelector('.mwnf-dxa-gallery-item__source')).not.toBeNull(), WAIT)
306
+ expect(host.querySelector('.mwnf-dxa-gallery-item__project').textContent).toContain(chip.project)
307
+ expect(host.querySelector('.mwnf-dxa-gallery-item__source').classList.contains(chip.className)).toBe(true)
283
308
  app.unmount()
284
309
  }, 60000)
285
310
 
@@ -287,12 +312,12 @@ export function describeGallerySmoke({ config, sharedTexts, ownTexts, manifest,
287
312
  // lists, and stays off every other.
288
313
  it.skipIf(!noticeItem)('shows the explore-partner notice only for the project dataset.config.js lists', async () => {
289
314
  const epm = await mountSite(`#/item/${noticeItem}`)
290
- await vi.waitFor(() => expect(epm.host.querySelector('.mwnf-sheet-source')).not.toBeNull(), WAIT)
315
+ await vi.waitFor(() => expect(epm.host.querySelector('.mwnf-dxa-gallery-item__source')).not.toBeNull(), WAIT)
291
316
  expect(epm.host.querySelector('.mwnf-sheet-notice')).not.toBeNull()
292
317
  epm.app.unmount()
293
318
 
294
319
  const other = await mountSite(`#/item/${chip.item}`)
295
- await vi.waitFor(() => expect(other.host.querySelector('.mwnf-sheet-source')).not.toBeNull(), WAIT)
320
+ await vi.waitFor(() => expect(other.host.querySelector('.mwnf-dxa-gallery-item__source')).not.toBeNull(), WAIT)
296
321
  expect(other.host.querySelector('.mwnf-sheet-notice')).toBeNull()
297
322
  other.app.unmount()
298
323
  }, 60000)
@@ -330,14 +355,24 @@ export function describeGallerySmoke({ config, sharedTexts, ownTexts, manifest,
330
355
  app.unmount()
331
356
  }, 30000)
332
357
 
333
- it('renders the source credit on the item sheet, addressed to this deployed site', async () => {
358
+ // Legacy's Source box pointed at the record in its home database: now the
359
+ // record's page on its project's home site, a sibling of this one
360
+ // (`manifest.projects`' `home_site`), or this page when it has none.
361
+ it("points the Source box at the record's home site, or this page", async () => {
334
362
  const [items] = await loadEntities(['items'])
335
363
  const item = items[0]
336
364
  const { app, host } = await mountSite(`#/item/${item.id}`)
337
- await vi.waitFor(() => expect(host.querySelector('.mwnf-source-credit')).not.toBeNull(), WAIT)
338
- const link = host.querySelector('.mwnf-source-credit a')
365
+ await vi.waitFor(() => expect(host.querySelector('.mwnf-dxa-gallery-item__source a')).not.toBeNull(), WAIT)
366
+ const link = host.querySelector('.mwnf-dxa-gallery-item__source a')
339
367
  expect(link.textContent).toBe(link.getAttribute('href'))
340
- expect(link.getAttribute('href').startsWith(`${config.site.origin}/#/item/${item.id}`)).toBe(true)
368
+ const home = manifest.projects[item.project_id]?.home_site
369
+ let origin = config.site.origin
370
+ while (origin.endsWith('/')) origin = origin.slice(0, -1)
371
+ const expected = home && home !== manifest.site?.key
372
+ ? `${origin.slice(0, origin.lastIndexOf('/'))}/${home}/#/item/${item.id}`
373
+ : `${origin}/#/item/${item.id}`
374
+ expect(link.getAttribute('href').startsWith(expected)).toBe(true)
375
+ expect(host.querySelector('.mwnf-source-credit')).toBeNull()
341
376
  app.unmount()
342
377
  }, 60000)
343
378
 
@@ -20,6 +20,9 @@
20
20
  * --theme-light light menu items
21
21
  * --background-color page background
22
22
  *
23
+ * and, where legacy's `text-color` mixin took the medium-dark tone rather
24
+ * than the dark one, `--theme-text` (the item sidebar's headings).
25
+ *
23
26
  * Every token below can be set again in the gallery's theme/tokens.css; the
24
27
  * gallery's value wins. Legacy drew white text on both menu shades and on the
25
28
  * header buttons whatever the palette, and so does this file.
@@ -29,11 +32,26 @@
29
32
  italic face is narrower (inventory-app#2423, the partner badges). */
30
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');
31
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
+
32
50
  /* ── Theme: the family's tokens, read from the palette ───────────────────── */
33
51
  :root {
34
52
  /* ---------- Global ---------- */
35
- --mwnf-font-body: 'Roboto Condensed', 'Roboto', Arial, sans-serif;
36
- --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;
37
55
  --mwnf-line-height: 1.4;
38
56
  --mwnf-weight-heading: 700;
39
57
  --mwnf-color-text: #1a1a1a;
@@ -227,10 +245,12 @@
227
245
  --mwnf-dxa-heading-color: var(--theme-dark);
228
246
  --mwnf-dxa-band-background: var(--background-color);
229
247
  /* The item sheet's Related Content sidebar: white on the light tone, its
230
- headings underlined in the dark tone (legacy's `$theme-light`). */
248
+ headings underlined and its description in the gallery's text colour
249
+ (legacy's `$theme-light` and `text-color` mixin, which ten galleries set
250
+ to their medium-dark tone: a gallery sets `--theme-text` for that). */
231
251
  --mwnf-dxa-related-background: var(--theme-light);
232
252
  --mwnf-dxa-related-text: #ffffff;
233
- --mwnf-dxa-related-heading-color: var(--theme-dark);
253
+ --mwnf-dxa-related-heading-color: var(--theme-text, var(--theme-dark));
234
254
  }
235
255
 
236
256
  /* ── Page reset ──────────────────────────────────────────────────────────── */
@@ -306,12 +326,17 @@ a { color: inherit; }
306
326
  }
307
327
  .mwnf-nav__links li:nth-child(odd) { background: var(--theme-medium-dark); }
308
328
  .mwnf-nav__links li:nth-child(even) { background: var(--theme-light); }
329
+ /* Legacy's entries are their 28px line, no taller; the notice under them its
330
+ text's own line (inventory-app#2423). */
309
331
  .mwnf-nav__link {
310
332
  width: 100%;
311
333
  text-align: center;
312
- padding: 2px 4px;
334
+ padding: 0 4px;
313
335
  text-transform: uppercase;
314
336
  }
337
+ .mwnf-nav__notice {
338
+ line-height: normal;
339
+ }
315
340
  .mwnf-nav__link--active {
316
341
  background: rgba(0, 0, 0, 0.18);
317
342
  text-decoration: none;
@@ -839,6 +839,7 @@
839
839
  /* --mwnf-dxa-related-background: #f0f0f0; Its background */
840
840
  /* --mwnf-dxa-related-text: inherit; Its text and links */
841
841
  /* --mwnf-dxa-related-heading-color: inherit; Its underlined headings */
842
+ /* --mwnf-dxa-languages-background: var(--theme-dark); A gallery item page's language band (legacy's dark tone) */
842
843
  /* --mwnf-dxa-glossary-image: none; The glossary entry header's picture (set by ItemDetailView from the site's world.png) */
843
844
  /* --mwnf-dxa-popup-image-width: 13.25rem; An exhibition popup notice's pictures: their widest (legacy sized them 191 to 211px) */
844
845
  /* --mwnf-dxa-theme-background: #ffffff; Exhibition theme pages: the ground (legacy's secondary colour) */
@@ -1,345 +0,0 @@
1
- import { t as e } from "./GlossaryPopover-DbQKXhx9.js";
2
- import { a as t, c as n, d as r, i, n as ee, o as te, r as ne, s as re } from "./PartnerMap-BuQo_FLl.js";
3
- import { Fragment as ie, computed as a, createBlock as o, createCommentVNode as s, createElementBlock as c, createElementVNode as l, createSlots as ae, createTextVNode as oe, createVNode as u, guardReactiveProps as d, mergeProps as se, normalizeClass as ce, normalizeProps as f, openBlock as p, ref as m, renderList as h, renderSlot as g, toDisplayString as _, unref as v, useSlots as le, watch as y, withCtx as ue } from "vue";
4
- import { useI18n as b } from "@museumwnf/viewer-core/i18n";
5
- import { NotFoundView as de, byId as x, citation as fe, creditLine as pe, entityRef as me, languageLabels as he, loadEntities as ge, pictureCredits as _e, picturesInLanguage as ve, renderBlock as S, renderInline as C, renderPlain as ye, sheetRows as be, sourceUrl as xe, useDataPackage as Se, useGlossaryPopup as Ce, useI18n as we, useProjects as Te, useRecordSheet as Ee, useRelatedRecords as De } from "@museumwnf/viewer-core";
6
- import { useRoute as Oe } from "vue-router";
7
- // src/content/ShortDescription.vue
8
- var w = ["dir"], ke = ["aria-expanded"], T = ["innerHTML"], Ae = {
9
- __name: "ShortDescription",
10
- props: {
11
- html: {
12
- type: String,
13
- required: !0
14
- },
15
- dir: {
16
- type: String,
17
- default: void 0
18
- }
19
- },
20
- setup(e) {
21
- let t = e, { t: n } = b(), r = m(!1);
22
- return y(() => t.html, () => {
23
- r.value = !1;
24
- }), (t, i) => (p(), c("div", {
25
- class: "mwnf-sheet__short",
26
- dir: e.dir
27
- }, [l("button", {
28
- type: "button",
29
- class: "mwnf-sheet__toggle",
30
- "aria-expanded": r.value ? "true" : "false",
31
- onClick: i[0] ||= (e) => r.value = !r.value
32
- }, _(r.value ? v(n)("record.action.hideShortDescription") : v(n)("record.action.viewShortDescription")), 9, ke), r.value ? (p(), c("div", {
33
- key: 0,
34
- class: "mwnf-sheet__block",
35
- innerHTML: e.html
36
- }, null, 8, T)) : s("", !0)], 8, w));
37
- }
38
- };
39
- // src/views/pictureLimit.js
40
- function E(e, t, n) {
41
- let r = typeof t == "function" ? t(n) : t;
42
- return Number.isInteger(r) && r > 0 ? e.slice(0, r) : e;
43
- }
44
- // src/views/RecordView.vue
45
- var je = ["dir", "innerHTML"], Me = { class: "mwnf-record__body" }, Ne = { class: "mwnf-record__main" }, Pe = {
46
- key: 1,
47
- class: "mwnf-record__status"
48
- }, Fe = {
49
- key: 0,
50
- class: "mwnf-record__aside"
51
- }, Ie = {
52
- key: 2,
53
- class: "mwnf-record__status"
54
- }, D = {
55
- __name: "RecordView",
56
- props: {
57
- spec: {
58
- type: Object,
59
- required: !0
60
- },
61
- id: {
62
- type: String,
63
- required: !0
64
- },
65
- entity: {
66
- type: String,
67
- default: ""
68
- }
69
- },
70
- setup(m) {
71
- let y = m, { t: b, tIn: w, locale: ke } = we(), T = Se(), D = Te(), Le = le(), Re = Oe(), O = y.spec.entity ?? y.entity, k = a(() => y.spec), ze = me(O), Be = x(O), A = a(() => Be.value.get(y.id) ?? null), Ve = a(() => ze.value !== null), j = y.spec.creditPeople ? y.spec.creditPeople.entity ?? "authors" : null;
72
- j && ge([j]).catch(() => {});
73
- let He = j ? x(j) : null, { language: M, languages: Ue, dir: N, select: P, text: F, ready: I, terms: We, glossary: L, attribution: R } = Ee(A, {
74
- entity: O,
75
- translations: [...y.spec.translations ?? [], ...j ? [j] : []],
76
- attribution: y.spec.attribution ?? []
77
- }), z = a(() => he(Ue.value)), { active: B, onClick: V, close: Ge } = Ce(We), Ke = a(() => B.value ? S(B.value.definition, { breaks: !0 }) : ""), H = (e, t) => T.tr(e, t, M.value, "en"), U = (e) => T.translations(e, M.value), W = a(() => ({
78
- record: A.value,
79
- text: F.value,
80
- language: M.value,
81
- languages: z.value,
82
- select: P,
83
- dir: N.value,
84
- glossary: L.value,
85
- ready: I.value,
86
- attribution: R.value,
87
- t: b,
88
- tIn: (e) => w ? w(M.value, e) : b(e),
89
- tr: H,
90
- translations: U
91
- })), G = (e) => k.value.labelsInRecordLanguage && w ? w(M.value, e) : b(e);
92
- function K(e) {
93
- return ((typeof e == "function" ? e(W.value) : e) ?? []).map((e) => ({
94
- ...e,
95
- label: e.label ? G(e.label) : ""
96
- }));
97
- }
98
- let q = a(() => A.value ? be(K(k.value.fields), W.value) : []), J = a(() => A.value ? be(K(k.value.sections).map((e) => ({
99
- render: "block",
100
- ...e
101
- })), W.value) : []), Y = a(() => k.value.shortDescriptionAfter ?? "description"), qe = a(() => !q.value.some((e) => e.key === Y.value) && J.value.some((e) => e.key === Y.value)), Je = a(() => k.value.shortDescription === !1 ? "" : k.value.shortDescription ?? "short_description"), X = a(() => {
102
- let e = Je.value ? F.value[Je.value] : "";
103
- return e ? { html: S(String(e), {
104
- breaks: !0,
105
- glossary: L.value
106
- }) } : null;
107
- }), Ye = a(() => {
108
- if (!A.value) return "";
109
- if (k.value.title) return k.value.title(W.value);
110
- let e = F.value.name ?? A.value.internal_name ?? A.value.id;
111
- return C(String(e), { glossary: L.value });
112
- }), Xe = a(() => A.value ? E(Ze(), k.value.pictureLimit, W.value) : []);
113
- function Ze() {
114
- if (k.value.media) return k.value.media(A.value, W.value);
115
- let e = ye(String(F.value.name ?? A.value.internal_name ?? ""));
116
- return ve(A.value.images, M.value).map((t) => ({
117
- url: t.url,
118
- alt: t.captions?.[M.value] ?? e,
119
- caption: t.captions?.[M.value] ?? "",
120
- ..._e(t, M.value)
121
- }));
122
- }
123
- let Qe = [
124
- {
125
- field: "author",
126
- label: "sheet.field.preparedBy"
127
- },
128
- {
129
- field: "copy_editor",
130
- label: "sheet.field.copyeditedBy"
131
- },
132
- {
133
- field: "translator",
134
- label: "sheet.field.translationBy"
135
- },
136
- {
137
- field: "translation_copy_editor",
138
- label: "sheet.field.translationCopyeditedBy"
139
- }
140
- ];
141
- function $e(e) {
142
- let t = k.value.creditNames ? F.value.credit_names?.[e] : null;
143
- return t?.length ? pe(t) : F.value[e] ?? R.value[e] ?? "";
144
- }
145
- function et(e) {
146
- let t = He ? F.value.credit_ids?.[e] : null;
147
- if (!t?.length) return null;
148
- let n = U(j), r = t.map((e) => {
149
- let t = He.value.get(e);
150
- if (!t) return null;
151
- let r = t.name ?? "";
152
- return {
153
- name: M.value === "ar" && t.originalname ? t.originalname : r,
154
- heading: [t.firstname, t.lastname].filter(Boolean).join(" ") || r,
155
- biography: n?.[e]?.curriculum ?? ""
156
- };
157
- });
158
- return r.every(Boolean) ? r : null;
159
- }
160
- let tt = a(() => (k.value.credits ?? Qe).map(({ field: e, label: t }) => ({
161
- label: G(t),
162
- value: $e(e),
163
- people: et(e)
164
- })).filter((e) => e.value)), nt = a(() => String(A.value?.[k.value.workingNumber ?? "mwnf_reference"] ?? ""));
165
- function rt(e) {
166
- if (e?.permalink !== !1) return typeof e?.permalink == "string" ? e.permalink : xe(Re) ?? void 0;
167
- }
168
- let it = a(() => {
169
- let e = k.value.citation;
170
- return !A.value || typeof e?.format != "function" ? "" : e.format(W.value, {
171
- permalink: rt(e),
172
- year: (/* @__PURE__ */ new Date()).getFullYear()
173
- });
174
- }), at = a(() => {
175
- let e = k.value.citation;
176
- if (!A.value || e === !1 || typeof e?.format == "function") return "";
177
- let t = typeof e?.project == "function" ? null : e?.project ?? A.value.project_id, n = typeof e?.project == "function" ? e.project(A.value, W.value) : D.label(t);
178
- return fe({
179
- author: $e("author") || void 0,
180
- name: F.value.name ?? A.value.internal_name ?? "",
181
- project: n,
182
- permalink: rt(e),
183
- inWord: b("record.citation.in")
184
- });
185
- }), Z = De(A, {
186
- entity: O,
187
- language: M
188
- }), Q = a(() => k.value.related === !1 ? null : k.value.related ?? {}), $ = a(() => {
189
- if (!Q.value) return [];
190
- let e = Q.value.record ?? ot;
191
- return Z.value.inPackage.map((t) => e(t, W.value));
192
- });
193
- function ot({ record: e, justification: t }) {
194
- let n = H(O, e.id).name ?? e.internal_name ?? e.id;
195
- return {
196
- id: e.id,
197
- image: e.images?.[0]?.url ?? "",
198
- imageAlt: ye(String(n)),
199
- name: C(String(n)),
200
- meta: t ? [t] : [],
201
- badge: e.type ?? "",
202
- to: {
203
- name: k.value.route ?? (y.entity ? `${y.entity}-detail` : "item"),
204
- params: { id: e.id }
205
- }
206
- };
207
- }
208
- let st = /* @__PURE__ */ new Set([
209
- "header",
210
- "before-sheet",
211
- "after-sheet",
212
- "aside",
213
- "source",
214
- "related",
215
- "after",
216
- "default"
217
- ]), ct = a(() => Object.keys(Le).filter((e) => !st.has(e)));
218
- return (a, m) => Ve.value && !A.value ? (p(), o(v(de), { key: 0 })) : A.value ? (p(), c("article", {
219
- key: 1,
220
- class: ce(["mwnf-record", { "mwnf-record--spaced": k.value.spaced }]),
221
- onClick: m[0] ||= (...e) => v(V) && v(V)(...e)
222
- }, [
223
- g(a.$slots, "header", f(d(W.value)), () => [
224
- k.value.back ? (p(), o(r, {
225
- key: 0,
226
- class: "mwnf-record__back",
227
- to: k.value.back.to,
228
- href: k.value.back.href
229
- }, {
230
- default: ue(() => [oe("← " + _(v(b)(k.value.back.label)), 1)]),
231
- _: 1
232
- }, 8, ["to", "href"])) : s("", !0),
233
- u(n, {
234
- languages: z.value,
235
- language: v(M),
236
- onSelect: v(P)
237
- }, null, 8, [
238
- "languages",
239
- "language",
240
- "onSelect"
241
- ]),
242
- l("h1", {
243
- class: "mwnf-record__title",
244
- dir: v(N) || void 0,
245
- innerHTML: Ye.value
246
- }, null, 8, je)
247
- ]),
248
- l("div", Me, [l("div", Ne, [
249
- Xe.value.length ? (p(), o(ee, {
250
- key: 0,
251
- images: Xe.value,
252
- variant: k.value.mediaVariant ?? ""
253
- }, null, 8, ["images", "variant"])) : s("", !0),
254
- v(I) ? s("", !0) : (p(), c("p", Pe, _(v(b)("core.status.loading")), 1)),
255
- g(a.$slots, "before-sheet", f(d(W.value))),
256
- u(re, {
257
- rows: q.value,
258
- layout: k.value.layout ?? "table",
259
- dir: v(N),
260
- "short-description": X.value,
261
- "short-description-after": Y.value
262
- }, ae({ _: 2 }, [h(ct.value, (e) => ({
263
- name: e,
264
- fn: ue((t) => [g(a.$slots, e, f(d({
265
- ...t,
266
- ...W.value
267
- })))])
268
- }))]), 1032, [
269
- "rows",
270
- "layout",
271
- "dir",
272
- "short-description",
273
- "short-description-after"
274
- ]),
275
- (p(!0), c(ie, null, h(J.value, (e) => (p(), c(ie, { key: e.key }, [
276
- u(te, {
277
- heading: e.label,
278
- html: e.html,
279
- dir: v(N)
280
- }, null, 8, [
281
- "heading",
282
- "html",
283
- "dir"
284
- ]),
285
- X.value && qe.value && e.key === Y.value ? (p(), o(Ae, {
286
- key: 0,
287
- html: X.value.html,
288
- dir: v(N)
289
- }, null, 8, ["html", "dir"])) : s("", !0),
290
- g(a.$slots, `after-${e.key}`, se({ ref_for: !0 }, W.value))
291
- ], 64))), 128)),
292
- g(a.$slots, "after-sheet", f(d(W.value))),
293
- u(t, {
294
- credits: tt.value,
295
- "working-number": nt.value,
296
- "working-number-label": G(k.value.workingNumberLabel ?? "sheet.field.workingNumber"),
297
- citation: at.value,
298
- "citation-html": it.value,
299
- "citation-heading": k.value.citation?.heading ? G(k.value.citation.heading) : ""
300
- }, null, 8, [
301
- "credits",
302
- "working-number",
303
- "working-number-label",
304
- "citation",
305
- "citation-html",
306
- "citation-heading"
307
- ]),
308
- g(a.$slots, "source", f(d(W.value)), () => [u(i)]),
309
- g(a.$slots, "related", f(d({
310
- ...W.value,
311
- records: $.value,
312
- outside: v(Z).outside
313
- })), () => [Q.value ? (p(), o(ne, {
314
- key: 0,
315
- heading: v(b)(Q.value.heading ?? "record.related.items"),
316
- records: $.value,
317
- variant: Q.value.variant ?? "list",
318
- "action-label": Q.value.actionLabel ? v(b)(Q.value.actionLabel) : ""
319
- }, null, 8, [
320
- "heading",
321
- "records",
322
- "variant",
323
- "action-label"
324
- ])) : s("", !0)])
325
- ]), a.$slots.aside ? (p(), c("aside", Fe, [g(a.$slots, "aside", f(d({
326
- ...W.value,
327
- records: $.value,
328
- outside: v(Z).outside
329
- })))])) : s("", !0)]),
330
- g(a.$slots, "after", f(d(W.value))),
331
- u(e, {
332
- term: v(B),
333
- html: Ke.value,
334
- dir: v(N),
335
- onClose: v(Ge)
336
- }, null, 8, [
337
- "term",
338
- "html",
339
- "dir",
340
- "onClose"
341
- ])
342
- ], 2)) : (p(), c("p", Ie, _(v(b)("core.status.loading")), 1));
343
- }
344
- };
345
- export { E as n, D as t };
@@ -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 };