@museumwnf/viewer-layout 3.77.0 → 3.78.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.
@@ -3,8 +3,8 @@ import { c as o, d as s, r as c } from "./PartnerMap-DdyMLtgH.js";
3
3
  import { n as l } from "./TimelineEventList-CIkKxyQu.js";
4
4
  import { t as u } from "./RecordView-CBC7tBCX.js";
5
5
  import { t as d } from "./chrome-Bv_mLlHM.js";
6
- import { Fragment as f, computed as p, createBlock as m, createCommentVNode as h, createElementBlock as g, createElementVNode as _, createSlots as v, createTextVNode as y, createVNode as b, guardReactiveProps as x, normalizeClass as S, normalizeProps as C, normalizeStyle as ee, openBlock as w, renderList as T, renderSlot as E, toDisplayString as D, unref as O, useSlots as k, withCtx as A } from "vue";
7
- import { NotFoundView as te, byId as ne, loadEntities as re, mdInline as j, mdStrip as M, mwnfLinks as N, partnerView as ie, renderInline as P, siblingSiteUrl as F, sourceUrl as I, useCatalogue as L, useDataPackage as R, useI18n as z, useProjects as B, useSiteConfig as V } from "@museumwnf/viewer-core";
6
+ import { Fragment as f, computed as p, createBlock as m, createCommentVNode as h, createElementBlock as g, createElementVNode as _, createSlots as v, createTextVNode as y, createVNode as b, guardReactiveProps as x, normalizeClass as S, normalizeProps as C, normalizeStyle as w, openBlock as T, renderList as E, renderSlot as D, toDisplayString as O, unref as k, useSlots as A, withCtx as j } from "vue";
7
+ import { NotFoundView as ee, byId as te, loadEntities as ne, mdInline as M, mdStrip as re, mwnfLinks as N, partnerView as ie, renderInline as P, siblingSiteUrl as F, sourceUrl as I, useCatalogue as L, useDataPackage as R, useI18n as z, useProjects as B, useSiteConfig as V } from "@museumwnf/viewer-core";
8
8
  import { RouterLink as H, useRoute as U } from "vue-router";
9
9
  // src/dxa/RelatedObjects.vue
10
10
  var W = {
@@ -33,7 +33,7 @@ var W = {
33
33
  }
34
34
  },
35
35
  setup(e) {
36
- return (t, n) => e.tiles.length ? (w(), g("div", W, [e.heading ? (w(), g("p", G, D(e.heading), 1)) : h("", !0), _("ul", ae, [(w(!0), g(f, null, T(e.tiles, (e) => (w(), g("li", {
36
+ return (t, n) => e.tiles.length ? (T(), g("div", W, [e.heading ? (T(), g("p", G, O(e.heading), 1)) : h("", !0), _("ul", ae, [(T(!0), g(f, null, E(e.tiles, (e) => (T(), g("li", {
37
37
  key: e.id,
38
38
  class: "mwnf-related-objects__tile"
39
39
  }, [b(s, {
@@ -42,12 +42,12 @@ var W = {
42
42
  external: !!e.href,
43
43
  class: "mwnf-related-objects__link"
44
44
  }, {
45
- default: A(() => [e.image ? (w(), g("img", {
45
+ default: j(() => [e.image ? (T(), g("img", {
46
46
  key: 0,
47
47
  src: e.image,
48
48
  alt: "",
49
49
  loading: "lazy"
50
- }, null, 8, oe)) : (w(), g("span", K)), _("span", {
50
+ }, null, 8, oe)) : (T(), g("span", K)), _("span", {
51
51
  class: "mwnf-related-objects__name-sr",
52
52
  innerHTML: e.name
53
53
  }, null, 8, q)]),
@@ -56,7 +56,7 @@ var W = {
56
56
  "to",
57
57
  "href",
58
58
  "external"
59
- ]), _("div", se, [_("div", null, [_("span", { innerHTML: e.name }, null, 8, ce), e.country ? (w(), g(f, { key: 0 }, [y(", " + D(e.country), 1)], 64)) : h("", !0)]), e.justification ? (w(), g("div", le, D(e.justification), 1)) : h("", !0)])]))), 128))])])) : h("", !0);
59
+ ]), _("div", se, [_("div", null, [_("span", { innerHTML: e.name }, null, 8, ce), e.country ? (T(), g(f, { key: 0 }, [y(", " + O(e.country), 1)], 64)) : h("", !0)]), e.justification ? (T(), g("div", le, O(e.justification), 1)) : h("", !0)])]))), 128))])])) : h("", !0);
60
60
  }
61
61
  }, de = {
62
62
  key: 0,
@@ -89,9 +89,9 @@ var W = {
89
89
  key: 2,
90
90
  class: "mwnf-sheet-related__unresolved"
91
91
  }, Ce = {
92
- key: 4,
92
+ key: 5,
93
93
  class: "mwnf-sheet-related__line"
94
- }, we = ["href"], Te = { class: "mwnf-sheet-related__heading" }, Ee = ["href"], De = { key: 10 }, Oe = { class: "mwnf-sheet-related__heading" }, ke = { key: 11 }, Ae = { class: "mwnf-sheet-related__heading" }, je = { class: "mwnf-sheet-related__line" }, Me = ["href"], Ne = { key: 12 }, Pe = { class: "mwnf-sheet-related__heading" }, Fe = { class: "mwnf-sheet-related__line" }, Ie = ["href"], Le = { key: 13 }, Re = { class: "mwnf-sheet-related__heading" }, ze = "sheet.field.", J = {
94
+ }, we = ["href"], Te = { class: "mwnf-sheet-related__heading" }, Ee = ["href"], De = { key: 11 }, Oe = { class: "mwnf-sheet-related__heading" }, ke = { key: 12 }, Ae = { class: "mwnf-sheet-related__heading" }, je = { class: "mwnf-sheet-related__line" }, Me = ["href"], Ne = { key: 13 }, Pe = { class: "mwnf-sheet-related__heading" }, Fe = { class: "mwnf-sheet-related__line" }, Ie = ["href"], Le = { key: 14 }, Re = { class: "mwnf-sheet-related__heading" }, ze = "sheet.field.", J = {
95
95
  __name: "ItemDetailView",
96
96
  props: {
97
97
  spec: {
@@ -112,7 +112,7 @@ var W = {
112
112
  }
113
113
  },
114
114
  setup(i) {
115
- let o = i, s = k(), P = /* @__PURE__ */ new Set([
115
+ let o = i, s = A(), P = /* @__PURE__ */ new Set([
116
116
  "before-sheet",
117
117
  "museum",
118
118
  "related",
@@ -168,14 +168,14 @@ var W = {
168
168
  notice: o
169
169
  };
170
170
  }
171
- let J = R(), Be = ne("partners"), Y = ne("countries");
172
- re(["partners", "countries"]), J.loadTranslations("countries", "en");
171
+ let J = R(), Be = te("partners"), Y = te("countries");
172
+ ne(["partners", "countries"]), J.loadTranslations("countries", "en");
173
173
  function X(e, t) {
174
174
  let n = J.tr("countries", e, t, "en");
175
- return M(n.name ?? Y.value?.get(e)?.internal_name ?? "");
175
+ return re(n.name ?? Y.value?.get(e)?.internal_name ?? "");
176
176
  }
177
177
  function Z(e) {
178
- let t = e.text?.holder ? j(String(e.text.holder)) : "", n = U.value.museum === !1 ? null : U.value.museum ?? null, r = n ? Be.value?.get(e.record?.partner_id) : null;
178
+ let t = e.text?.holder ? M(String(e.text.holder)) : "", n = U.value.museum === !1 ? null : U.value.museum ?? null, r = n ? Be.value?.get(e.record?.partner_id) : null;
179
179
  return {
180
180
  holder: t,
181
181
  view: r ? ie(r, J.tr("partners", r.id, e.language, "en"), {
@@ -192,7 +192,7 @@ var W = {
192
192
  chipClass: n.outsideChip ? n.outsideChip(e, t) : null
193
193
  })), l = (t) => (n.onDisplayIn?.href ? n.onDisplayIn.href(t, e) : t.legacy_host) || "", u = (e) => ({
194
194
  id: e.id,
195
- label: j(e.name ?? ""),
195
+ label: M(e.name ?? ""),
196
196
  href: l(e),
197
197
  external: !!l(e)
198
198
  }), d = n.onDisplayIn && n.onDisplayIn !== !1 ? {
@@ -214,17 +214,19 @@ var W = {
214
214
  } : null, p = n.overallDatabase && n.overallDatabase !== !1 ? {
215
215
  label: L(n.overallDatabase.label),
216
216
  linkLabel: L(n.overallDatabase.linkLabel)
217
- } : null;
217
+ } : null, m = n.objectTiles ? n.objectTiles({
218
+ record: e,
219
+ inPackage: a,
220
+ references: c,
221
+ ctx: t
222
+ }) : null, h = !!(m && n.monumentsHeading);
218
223
  return {
219
224
  title: n.title ? L(n.title) : "",
220
225
  description: n.description ? L(n.description) : "",
221
226
  heading: L(n.heading ?? "record.related.items"),
222
- tiles: n.objectTiles ? n.objectTiles({
223
- record: e,
224
- inPackage: a,
225
- references: c,
226
- ctx: t
227
- }) : null,
227
+ tiles: h ? m.filter((e) => e.kind !== "monument") : m,
228
+ monumentsHeading: h ? L(n.monumentsHeading) : "",
229
+ monumentTiles: h ? m.filter((e) => e.kind === "monument") : [],
228
230
  variant: n.variant ?? "grid",
229
231
  actionLabel: n.actionLabel ? L(n.actionLabel) : "",
230
232
  inPackage: a,
@@ -261,55 +263,55 @@ var W = {
261
263
  function He() {
262
264
  window.print();
263
265
  }
264
- return (o, s) => I.value ? (w(), m(u, {
266
+ return (o, s) => I.value ? (T(), m(u, {
265
267
  key: 0,
266
268
  spec: U.value,
267
269
  id: i.id,
268
270
  entity: i.entity,
269
- style: ee(Ve.value)
271
+ style: w(Ve.value)
270
272
  }, v({
271
- "before-sheet": A((e) => [E(o.$slots, "before-sheet", C(x(e)), () => [(w(!0), g(f, null, T([le(e.record, e)], (t) => (w(), g(f, { key: "before-sheet" }, [t?.source || t?.addToCollectionLabel ? (w(), g("div", de, [t.source ? (w(), g("p", fe, [t.source.chipClass ? (w(), g("span", {
273
+ "before-sheet": j((e) => [D(o.$slots, "before-sheet", C(x(e)), () => [(T(!0), g(f, null, E([le(e.record, e)], (t) => (T(), g(f, { key: "before-sheet" }, [t?.source || t?.addToCollectionLabel ? (T(), g("div", de, [t.source ? (T(), g("p", fe, [t.source.chipClass ? (T(), g("span", {
272
274
  key: 0,
273
275
  class: S(["mwnf-chip", t.source.chipClass]),
274
276
  "aria-hidden": "true"
275
- }, null, 2)) : h("", !0), t.source.name ? (w(), g(f, { key: 1 }, [y(D(t.source.label) + ": " + D(t.source.name), 1)], 64)) : h("", !0)])) : h("", !0), t.addToCollectionLabel ? (w(), g("p", pe, [_("a", {
276
- href: O(N).myCollection,
277
+ }, null, 2)) : h("", !0), t.source.name ? (T(), g(f, { key: 1 }, [y(O(t.source.label) + ": " + O(t.source.name), 1)], 64)) : h("", !0)])) : h("", !0), t.addToCollectionLabel ? (T(), g("p", pe, [_("a", {
278
+ href: k(N).myCollection,
277
279
  target: "_blank",
278
280
  rel: "noopener"
279
- }, "↗ " + D(t.addToCollectionLabel), 9, me)])) : h("", !0)])) : h("", !0), t?.notice ? (w(), g("div", he, [y(D(t.notice) + " ", 1), _("strong", null, [_("em", null, D(e.languages.map((e) => e.label).join(", ")), 1)])])) : h("", !0)], 64))), 128))])]),
280
- museum: A((e) => [E(o.$slots, "museum", C(x(e)), () => [(w(!0), g(f, null, T([Z(e)], (t) => (w(), g("div", ge, [t.holder ? (w(), g("p", {
281
+ }, "↗ " + O(t.addToCollectionLabel), 9, me)])) : h("", !0)])) : h("", !0), t?.notice ? (T(), g("div", he, [y(O(t.notice) + " ", 1), _("strong", null, [_("em", null, O(e.languages.map((e) => e.label).join(", ")), 1)])])) : h("", !0)], 64))), 128))])]),
282
+ museum: j((e) => [D(o.$slots, "museum", C(x(e)), () => [(T(!0), g(f, null, E([Z(e)], (t) => (T(), g("div", ge, [t.holder ? (T(), g("p", {
281
283
  key: 0,
282
284
  class: "mwnf-sheet-museum__holder",
283
285
  innerHTML: t.holder
284
- }, null, 8, _e)) : h("", !0), t.view ? (w(), m(l, {
286
+ }, null, 8, _e)) : h("", !0), t.view ? (T(), m(l, {
285
287
  key: 1,
286
288
  variant: "summary",
287
289
  partner: t.view,
288
290
  label: "partner.info.about",
289
291
  dir: e.dir
290
292
  }, null, 8, ["partner", "dir"])) : h("", !0)]))), 128))])]),
291
- aside: A((i) => [E(o.$slots, "related", C(x(i)), () => [(w(!0), g(f, null, T([Q(i.record, i)], (o) => (w(), g(f, { key: i.record?.id ?? "related" }, [o ? (w(), g("div", ve, [
292
- o.title ? (w(), g("p", ye, D(o.title), 1)) : h("", !0),
293
- o.description ? (w(), g("p", be, D(o.description), 1)) : h("", !0),
294
- o.tiles ? (w(), m(ue, {
293
+ aside: j((i) => [D(o.$slots, "related", C(x(i)), () => [(T(!0), g(f, null, E([Q(i.record, i)], (o) => (T(), g(f, { key: i.record?.id ?? "related" }, [o ? (T(), g("div", ve, [
294
+ o.title ? (T(), g("p", ye, O(o.title), 1)) : h("", !0),
295
+ o.description ? (T(), g("p", be, O(o.description), 1)) : h("", !0),
296
+ o.tiles ? (T(), m(ue, {
295
297
  key: 2,
296
298
  heading: o.heading,
297
299
  tiles: o.tiles
298
- }, null, 8, ["heading", "tiles"])) : o.inPackage.length || o.references.length ? (w(), m(c, {
300
+ }, null, 8, ["heading", "tiles"])) : o.inPackage.length || o.references.length ? (T(), m(c, {
299
301
  key: 3,
300
302
  heading: o.heading,
301
303
  records: o.inPackage,
302
304
  variant: o.variant,
303
305
  "action-label": o.actionLabel
304
306
  }, {
305
- default: A(() => [o.references.length ? (w(), g("ul", xe, [(w(!0), g(f, null, T(o.references, (e) => (w(), g("li", { key: e.id }, [
306
- e.chipClass ? (w(), g("span", {
307
+ default: j(() => [o.references.length ? (T(), g("ul", xe, [(T(!0), g(f, null, E(o.references, (e) => (T(), g("li", { key: e.id }, [
308
+ e.chipClass ? (T(), g("span", {
307
309
  key: 0,
308
310
  class: S(["mwnf-chip", e.chipClass]),
309
311
  "aria-hidden": "true"
310
312
  }, null, 2)) : h("", !0),
311
- e.name ? (w(), g(f, { key: 1 }, [y(D(e.name), 1)], 64)) : h("", !0),
312
- o.notInPackageLabel ? (w(), g("span", Se, D(o.notInPackageLabel), 1)) : h("", !0)
313
+ e.name ? (T(), g(f, { key: 1 }, [y(O(e.name), 1)], 64)) : h("", !0),
314
+ o.notInPackageLabel ? (T(), g("span", Se, O(o.notInPackageLabel), 1)) : h("", !0)
313
315
  ]))), 128))])) : h("", !0)]),
314
316
  _: 2
315
317
  }, 1032, [
@@ -318,17 +320,23 @@ var W = {
318
320
  "variant",
319
321
  "action-label"
320
322
  ])) : h("", !0),
321
- o.artisticIntroduction ? (w(), g("p", Ce, [_("a", {
323
+ o.monumentTiles.length ? (T(), m(ue, {
324
+ key: 4,
325
+ heading: o.monumentsHeading,
326
+ tiles: o.monumentTiles,
327
+ class: "mwnf-related-objects--monuments"
328
+ }, null, 8, ["heading", "tiles"])) : h("", !0),
329
+ o.artisticIntroduction ? (T(), g("p", Ce, [_("a", {
322
330
  href: o.artisticIntroduction.url,
323
331
  target: "_blank",
324
332
  rel: "noopener"
325
- }, "↗ " + D(o.artisticIntroduction.label), 9, we)])) : h("", !0),
326
- o.timeline ? (w(), m(r, {
333
+ }, "↗ " + O(o.artisticIntroduction.label), 9, we)])) : h("", !0),
334
+ o.timeline ? (T(), m(r, {
327
335
  key: i.record.id,
328
336
  info: o.timeline
329
337
  }, null, 8, ["info"])) : h("", !0),
330
- o.glossary ? (w(), m(n, {
331
- key: 6,
338
+ o.glossary ? (T(), m(n, {
339
+ key: 7,
332
340
  language: i.language,
333
341
  labels: o.glossaryLabels,
334
342
  dir: i.dir
@@ -337,8 +345,8 @@ var W = {
337
345
  "labels",
338
346
  "dir"
339
347
  ])) : h("", !0),
340
- o.dynasties?.records?.length ? (w(), m(e, {
341
- key: 7,
348
+ o.dynasties?.records?.length ? (T(), m(e, {
349
+ key: 8,
342
350
  heading: o.dynastiesHeading,
343
351
  dynasties: o.dynasties.records,
344
352
  tr: o.dynasties.tr,
@@ -349,18 +357,18 @@ var W = {
349
357
  "tr",
350
358
  "dir"
351
359
  ])) : h("", !0),
352
- o.mediaGroups ? (w(!0), g(f, { key: 8 }, T(o.mediaGroups, (e) => (w(), g("div", {
360
+ o.mediaGroups ? (T(!0), g(f, { key: 9 }, E(o.mediaGroups, (e) => (T(), g("div", {
353
361
  key: e.type,
354
362
  class: S(["mwnf-sheet-related__media", `mwnf-sheet-related__media--${e.type}`])
355
- }, [_("p", Te, D(e.heading), 1), (w(!0), g(f, null, T(e.entries, (e) => (w(), g("p", {
363
+ }, [_("p", Te, O(e.heading), 1), (T(!0), g(f, null, E(e.entries, (e) => (T(), g("p", {
356
364
  key: e.url,
357
365
  class: "mwnf-sheet-related__line"
358
366
  }, [_("a", {
359
367
  href: e.url,
360
368
  target: "_blank",
361
369
  rel: "noopener"
362
- }, "↗ " + D(e.title || e.url), 9, Ee)]))), 128))], 2))), 128)) : (w(), m(t, {
363
- key: 9,
370
+ }, "↗ " + O(e.title || e.url), 9, Ee)]))), 128))], 2))), 128)) : (T(), m(t, {
371
+ key: 10,
364
372
  media: o.media,
365
373
  language: i.language,
366
374
  descriptions: !1,
@@ -370,7 +378,7 @@ var W = {
370
378
  "language",
371
379
  "dir"
372
380
  ])),
373
- o.onDisplayIn?.groups.length ? (w(), g("div", De, [_("p", Oe, D(O(L)("record.related.onDisplayIn")), 1), b(a, {
381
+ o.onDisplayIn?.groups.length ? (T(), g("div", De, [_("p", Oe, O(k(L)("record.related.onDisplayIn")), 1), b(a, {
374
382
  heading: "",
375
383
  groups: o.onDisplayIn.groups,
376
384
  "pending-label": o.onDisplayIn.pendingLabel,
@@ -380,31 +388,31 @@ var W = {
380
388
  "pending-label",
381
389
  "dir"
382
390
  ])])) : h("", !0),
383
- o.database ? (w(), g("div", ke, [_("p", Ae, D(o.database.label), 1), _("p", je, [_("a", {
391
+ o.database ? (T(), g("div", ke, [_("p", Ae, O(o.database.label), 1), _("p", je, [_("a", {
384
392
  href: o.database.url,
385
393
  target: "_blank",
386
394
  rel: "noopener"
387
- }, "↗ " + D(o.database.name), 9, Me)])])) : h("", !0),
388
- o.overallDatabase ? (w(), g("div", Ne, [_("p", Pe, D(o.overallDatabase.label), 1), _("p", Fe, [_("a", {
389
- href: O(N).overallDatabase,
395
+ }, "↗ " + O(o.database.name), 9, Me)])])) : h("", !0),
396
+ o.overallDatabase ? (T(), g("div", Ne, [_("p", Pe, O(o.overallDatabase.label), 1), _("p", Fe, [_("a", {
397
+ href: k(N).overallDatabase,
390
398
  target: "_blank",
391
399
  rel: "noopener"
392
- }, "↗ " + D(o.overallDatabase.linkLabel), 9, Ie)])])) : h("", !0),
393
- o.download ? (w(), g("div", Le, [_("p", Re, D(o.download.label), 1), _("p", {
400
+ }, "↗ " + O(o.overallDatabase.linkLabel), 9, Ie)])])) : h("", !0),
401
+ o.download ? (T(), g("div", Le, [_("p", Re, O(o.download.label), 1), _("p", {
394
402
  class: "mwnf-sheet-related__line mwnf-sheet-related__line--action",
395
403
  onClick: He
396
- }, "➤ " + D(o.download.pdfLabel), 1)])) : h("", !0)
404
+ }, "➤ " + O(o.download.pdfLabel), 1)])) : h("", !0)
397
405
  ])) : h("", !0)], 64))), 128))])]),
398
406
  _: 2
399
- }, [T(F.value, (e) => ({
407
+ }, [E(F.value, (e) => ({
400
408
  name: e,
401
- fn: A((t) => [E(o.$slots, e, C(x(t)))])
409
+ fn: j((t) => [D(o.$slots, e, C(x(t)))])
402
410
  }))]), 1032, [
403
411
  "spec",
404
412
  "id",
405
413
  "entity",
406
414
  "style"
407
- ])) : (w(), m(O(te), { key: 1 }));
415
+ ])) : (T(), m(k(ee), { key: 1 }));
408
416
  }
409
417
  }, Be = "mwnf-on-display__theme", Y = (e) => P(e ?? ""), X = (e) => e?.titles?.en ?? Object.values(e?.titles ?? {})[0] ?? "", Z = (e) => `<span class="${Be}">${e}</span>`;
410
418
  function Q(e, t, n) {
@@ -453,14 +461,18 @@ function Ve(e, t, n = null) {
453
461
  }
454
462
  return i;
455
463
  }
464
+ // src/dxa/relatedKind.js
465
+ function He(e, t) {
466
+ return (e?.type ?? t?.get(e?.id)?.type) === "monument" ? "monument" : "object";
467
+ }
456
468
  // src/dxa/LegacyItemSheet.vue
457
- var He = { class: "mwnf-dxa-item__languages" }, Ue = ["dir"], We = ["href"], Ge = ["href"], Ke = ["innerHTML"], qe = ["innerHTML"], Je = ["dir"], Ye = { class: "mwnf-dxa-gallery-item__label" }, Xe = {
469
+ var Ue = { class: "mwnf-dxa-item__languages" }, We = ["dir"], Ge = ["href"], Ke = ["href"], qe = ["innerHTML"], Je = ["innerHTML"], Ye = ["dir"], Xe = { class: "mwnf-dxa-gallery-item__label" }, Ze = {
458
470
  key: "citation",
459
471
  class: "mwnf-dxa-gallery-item__citation"
460
- }, Ze = { class: "mwnf-dxa-gallery-item__project" }, Qe = { class: "mwnf-dxa-gallery-item__address" }, $e = { class: "mwnf-dxa-gallery-item__credit-label" }, et = {
472
+ }, Qe = { class: "mwnf-dxa-gallery-item__project" }, $e = { class: "mwnf-dxa-gallery-item__address" }, et = { class: "mwnf-dxa-gallery-item__credit-label" }, tt = {
461
473
  key: 1,
462
474
  class: "mwnf-dxa-gallery-item__number"
463
- }, tt = { class: "mwnf-dxa-gallery-item__number-label" }, nt = ["href"], rt = {
475
+ }, nt = { class: "mwnf-dxa-gallery-item__number-label" }, rt = ["href"], it = {
464
476
  __name: "LegacyItemSheet",
465
477
  props: {
466
478
  id: {
@@ -483,25 +495,27 @@ var He = { class: "mwnf-dxa-item__languages" }, Ue = ["dir"], We = ["href"], Ge
483
495
  setup(e) {
484
496
  let t = e, { t: n } = z(), r = U(), a = B(), s = R(), c = V(), l = L(), u = (e, t) => e?.[t] ?? e?.en ?? Object.values(e ?? {})[0] ?? "";
485
497
  function d({ record: e, inPackage: t, references: n, ctx: r }) {
486
- let i = r.language, o = new Map((e.related_items ?? []).map((e) => [e.id, e])), s = (e) => M(u(o.get(e)?.justifications, i)), c = t.map((e) => ({
498
+ let i = r.language, o = new Map((e.related_items ?? []).map((e) => [e.id, e])), s = (e) => re(u(o.get(e)?.justifications, i)), c = (e) => He(o.get(e) ?? { id: e }, l.itemById.value), d = (e) => (e ?? "").replace(/\.$/, ""), f = t.map((e) => ({
487
499
  id: e.id,
500
+ kind: c(e.id),
488
501
  image: e.image,
489
- name: e.name,
502
+ name: d(e.name),
490
503
  country: l.countryLabel(l.itemById.value.get(e.id)?.country_id),
491
504
  justification: s(e.id),
492
505
  to: e.to
493
- })), d = n.map((e) => {
506
+ })), p = n.map((e) => {
494
507
  let t = a.links(e.project_id)?.homeSite;
495
508
  return {
496
509
  id: e.id,
510
+ kind: c(e.id),
497
511
  image: e.image ?? "",
498
- name: j(u(e.names, i)),
512
+ name: d(M(u(e.names, i))),
499
513
  country: l.countryLabel(e.country_id),
500
514
  justification: s(e.id),
501
515
  href: t ? F(t, `/item/${e.id}`) : ""
502
516
  };
503
- }), f = (e.related_items ?? []).map((e) => e.id);
504
- return [...c, ...d].sort((e, t) => f.indexOf(e.id) - f.indexOf(t.id));
517
+ }), m = (e.related_items ?? []).map((e) => e.id);
518
+ return [...f, ...p].sort((e, t) => m.indexOf(e.id) - m.indexOf(t.id));
505
519
  }
506
520
  let v = p(() => ({
507
521
  ...t.itemDetail,
@@ -525,6 +539,7 @@ var He = { class: "mwnf-dxa-item__languages" }, Ue = ["dir"], We = ["href"], Ge
525
539
  heading: t.words.relatedObjects,
526
540
  objectTiles: d
527
541
  } : {},
542
+ ...t.words.relatedMonuments ? { monumentsHeading: t.words.relatedMonuments } : {},
528
543
  onDisplayIn: {
529
544
  ...t.itemDetail.related?.onDisplayIn,
530
545
  exhibitionsHeading: t.words.exhibitions,
@@ -546,8 +561,8 @@ var He = { class: "mwnf-dxa-item__languages" }, Ue = ["dir"], We = ["href"], Ge
546
561
  return e;
547
562
  }
548
563
  }
549
- let ee = (e) => c.projectColors?.[e?.project_id] ?? "";
550
- function E(e, t) {
564
+ let w = (e) => c.projectColors?.[e?.project_id] ?? "";
565
+ function D(e, t) {
551
566
  let n = a.label(t?.project_id) ?? "", r = n ? e.indexOf(` ${n},`) : -1;
552
567
  return r < 0 ? {
553
568
  before: e,
@@ -559,19 +574,19 @@ var He = { class: "mwnf-dxa-item__languages" }, Ue = ["dir"], We = ["href"], Ge
559
574
  after: e.slice(r + 1 + n.length)
560
575
  };
561
576
  }
562
- function k(e) {
577
+ function A(e) {
563
578
  return {
564
579
  to: t.itemDetail.museum?.route?.(e.record?.partner_id) ?? null,
565
- holder: e.text?.holder ? j(String(e.text.holder)) : ""
580
+ holder: e.text?.holder ? M(String(e.text.holder)) : ""
566
581
  };
567
582
  }
568
- return (t, r) => (w(), m(J, {
583
+ return (t, r) => (T(), m(J, {
569
584
  spec: v.value,
570
585
  id: e.id,
571
586
  "data-getter": e.dataGetter,
572
587
  class: "mwnf-dxa-item mwnf-dxa-gallery-item"
573
588
  }, {
574
- header: A(({ languages: e, language: t, select: n }) => [_("div", He, [b(o, {
589
+ header: j(({ languages: e, language: t, select: n }) => [_("div", Ue, [b(o, {
575
590
  languages: e,
576
591
  language: t,
577
592
  from: 1,
@@ -581,7 +596,7 @@ var He = { class: "mwnf-dxa-item__languages" }, Ue = ["dir"], We = ["href"], Ge
581
596
  "language",
582
597
  "onSelect"
583
598
  ])]), b(i)]),
584
- "after-media": A(({ record: e, dir: t }) => [e ? (w(), g("div", {
599
+ "after-media": j(({ record: e, dir: t }) => [e ? (T(), g("div", {
585
600
  key: 0,
586
601
  class: "mwnf-dxa-gallery-item__links",
587
602
  dir: t || void 0
@@ -592,50 +607,50 @@ var He = { class: "mwnf-dxa-item__languages" }, Ue = ["dir"], We = ["href"], Ge
592
607
  }, [r[0] ||= _("span", {
593
608
  class: "mwnf-dxa-gallery-item__icon",
594
609
  "aria-hidden": "true"
595
- }, "↗", -1), _("bdi", null, [y(D(O(n)("record.source.label")) + " ", 1), _("span", null, "(" + D(C(x(e))) + ")", 1)])], 8, We)]), _("p", null, [_("a", {
596
- href: O(N).myCollection,
610
+ }, "↗", -1), _("bdi", null, [y(O(k(n)("record.source.label")) + " ", 1), _("span", null, "(" + O(C(x(e))) + ")", 1)])], 8, Ge)]), _("p", null, [_("a", {
611
+ href: k(N).myCollection,
597
612
  target: "_blank",
598
613
  rel: "noopener"
599
614
  }, [r[1] ||= _("span", {
600
615
  class: "mwnf-dxa-gallery-item__icon",
601
616
  "aria-hidden": "true"
602
- }, "↗", -1), y(D(O(n)("record.action.addToCollection")), 1)], 8, Ge)])], 8, Ue)) : h("", !0)]),
603
- museum: A((e) => [(w(!0), g(f, null, T([k(e)], (e) => (w(), g(f, { key: "museum" }, [e.to && e.holder ? (w(), m(O(H), {
617
+ }, "↗", -1), y(O(k(n)("record.action.addToCollection")), 1)], 8, Ke)])], 8, We)) : h("", !0)]),
618
+ museum: j((e) => [(T(!0), g(f, null, E([A(e)], (e) => (T(), g(f, { key: "museum" }, [e.to && e.holder ? (T(), m(k(H), {
604
619
  key: 0,
605
620
  to: e.to,
606
621
  class: "mwnf-dxa-gallery-item__museum"
607
622
  }, {
608
- default: A(() => [r[2] ||= _("span", {
623
+ default: j(() => [r[2] ||= _("span", {
609
624
  class: "mwnf-dxa-gallery-item__icon",
610
625
  "aria-hidden": "true"
611
- }, "↗", -1), _("span", { innerHTML: e.holder }, null, 8, Ke)]),
626
+ }, "↗", -1), _("span", { innerHTML: e.holder }, null, 8, qe)]),
612
627
  _: 2
613
- }, 1032, ["to"])) : e.holder ? (w(), g("span", {
628
+ }, 1032, ["to"])) : e.holder ? (T(), g("span", {
614
629
  key: 1,
615
630
  innerHTML: e.holder
616
- }, null, 8, qe)) : h("", !0)], 64))), 128))]),
617
- credits: A(({ record: t, credits: r, workingNumber: i, citation: a, dir: o }) => [t ? (w(), g("div", {
631
+ }, null, 8, Je)) : h("", !0)], 64))), 128))]),
632
+ credits: j(({ record: t, credits: r, workingNumber: i, citation: a, dir: o }) => [t ? (T(), g("div", {
618
633
  key: 0,
619
634
  class: "mwnf-dxa-gallery-item__credits",
620
635
  dir: o || void 0
621
636
  }, [
622
- a ? (w(), g(f, { key: 0 }, [_("p", Ye, D(O(n)("record.citation.ofThisPage")), 1), (w(!0), g(f, null, T([E(a, t)], (e) => (w(), g("p", Xe, [
623
- y(D(e.before), 1),
624
- _("span", Ze, D(e.project), 1),
625
- y(D(e.after) + " ", 1),
626
- _("span", Qe, D(x(t)), 1)
637
+ a ? (T(), g(f, { key: 0 }, [_("p", Xe, O(k(n)("record.citation.ofThisPage")), 1), (T(!0), g(f, null, E([D(a, t)], (e) => (T(), g("p", Ze, [
638
+ y(O(e.before), 1),
639
+ _("span", Qe, O(e.project), 1),
640
+ y(O(e.after) + " ", 1),
641
+ _("span", $e, O(x(t)), 1)
627
642
  ]))), 128))], 64)) : h("", !0),
628
- (w(!0), g(f, null, T(r, (e) => (w(), g("p", {
643
+ (T(!0), g(f, null, E(r, (e) => (T(), g("p", {
629
644
  key: e.label,
630
645
  class: "mwnf-dxa-gallery-item__credit"
631
- }, [_("span", $e, D(e.label), 1), _("span", null, D(e.value), 1)]))), 128)),
632
- i ? (w(), g("p", et, [_("span", tt, D(O(n)(e.words.workingNumber)), 1), y(D(" ") + D(i), 1)])) : h("", !0),
633
- _("div", { class: S(["mwnf-dxa-gallery-item__source", ee(t)]) }, [_("p", null, D(O(n)("record.source.label")), 1), _("p", null, [_("a", {
646
+ }, [_("span", et, O(e.label), 1), _("span", null, O(e.value), 1)]))), 128)),
647
+ i ? (T(), g("p", tt, [_("span", nt, O(k(n)(e.words.workingNumber)), 1), y(O(" ") + O(i), 1)])) : h("", !0),
648
+ _("div", { class: S(["mwnf-dxa-gallery-item__source", w(t)]) }, [_("p", null, O(k(n)("record.source.label")), 1), _("p", null, [_("a", {
634
649
  href: x(t),
635
650
  target: "_blank",
636
651
  rel: "noopener"
637
- }, D(x(t)), 9, nt)])], 2)
638
- ], 8, Je)) : h("", !0)]),
652
+ }, O(x(t)), 9, rt)])], 2)
653
+ ], 8, Ye)) : h("", !0)]),
639
654
  _: 1
640
655
  }, 8, [
641
656
  "spec",
@@ -644,4 +659,4 @@ var He = { class: "mwnf-dxa-item__languages" }, Ue = ["dir"], We = ["href"], Ge
644
659
  ]));
645
660
  }
646
661
  };
647
- export { J as n, rt as t };
662
+ export { J as n, it as t };
package/dist/dxa.js CHANGED
@@ -8,7 +8,7 @@ import { n as Ye, r as E, t as Xe } from "./TimelineResultsView-Bn4rC_Se.js";
8
8
  import { t as Ze } from "./SiteShell-CzKgoOBm.js";
9
9
  import { i as Qe, n as $e, r as et, t as tt } from "./chrome-Bv_mLlHM.js";
10
10
  import { i as nt } from "./PageShell-BAtk_qcb.js";
11
- import { n as rt, t as it } from "./LegacyItemSheet-B4Ob4upz.js";
11
+ import { n as rt, t as it } from "./LegacyItemSheet-CNooycyz.js";
12
12
  import { n as at, r as D } from "./Theme-BCn6_VkI.js";
13
13
  import { n as ot, r as st, t as ct } from "./themeSpecs-BJ82RvA1.js";
14
14
  import { Fragment as O, computed as k, createBlock as A, createCommentVNode as j, createElementBlock as M, createElementVNode as N, createSlots as lt, createTextVNode as P, createVNode as F, normalizeClass as I, normalizeStyle as ut, onBeforeUnmount as dt, onMounted as ft, openBlock as L, reactive as pt, ref as R, renderList as z, renderSlot as mt, resolveDynamicComponent as ht, toDisplayString as B, unref as V, vModelCheckbox as gt, vModelSelect as _t, vModelText as vt, vShow as yt, watch as bt, watchEffect as xt, withCtx as H, withDirectives as U, withModifiers as St } from "vue";
@@ -2871,7 +2871,8 @@ var jo = {
2871
2871
  workingNumber: "gallery.sheet.workingNumber",
2872
2872
  relatedAudio: "gallery.related.audio",
2873
2873
  relatedVideos: "gallery.related.videos",
2874
- relatedObjects: "gallery.related.objects"
2874
+ relatedObjects: "gallery.related.objects",
2875
+ relatedMonuments: "gallery.related.monuments"
2875
2876
  };
2876
2877
  return (n, r) => (L(), A(it, {
2877
2878
  id: e.id,
@@ -3200,7 +3201,8 @@ var jo = {
3200
3201
  workingNumber: "exhibition.sheet.workingNumber",
3201
3202
  relatedAudio: "exhibition.sheet.relatedAudio",
3202
3203
  relatedVideos: "exhibition.sheet.relatedVideos",
3203
- relatedObjects: "exhibition.related.objects"
3204
+ relatedObjects: "exhibition.related.objects",
3205
+ relatedMonuments: "exhibition.related.monuments"
3204
3206
  }, n = (e) => Re.value.get(e);
3205
3207
  return (r, i) => (L(), A(it, {
3206
3208
  id: e.id,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@museumwnf/viewer-layout",
3
- "version": "3.77.0",
3
+ "version": "3.78.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",
@@ -18,6 +18,7 @@
18
18
  "src/styles/dxa-gallery.css",
19
19
  "src/styles/dxa-exhibition.css",
20
20
  "src/dxa/testing.js",
21
+ "src/dxa/relatedKind.js",
21
22
  "src/minisite/testing.js"
22
23
  ],
23
24
  "main": "./dist/index.js",
@@ -0,0 +1,11 @@
1
+ // Which of an item sheet's two related blocks a `related_items` entry goes
2
+ // in: legacy's Related Objects (dxa-client DatabaseItem.vue drew only the
3
+ // related objects) or Related Monuments (Discover Islamic Art's sheet drew
4
+ // the monuments apart, under "Related monuments"). The exporters write each
5
+ // entry's `type` since inventory-app#2611; before that, an entry in the
6
+ // package takes its record's type and one outside counts as an object, as
7
+ // the sheet drew it then.
8
+ export function relatedKind(ref, itemById) {
9
+ const type = ref?.type ?? itemById?.get(ref?.id)?.type
10
+ return type === 'monument' ? 'monument' : 'object'
11
+ }
@@ -12,6 +12,7 @@
12
12
  import { describe, expect, it, vi } from 'vitest'
13
13
  import { loadEntities, mergeMessages } from '@museumwnf/viewer-core'
14
14
  import * as viewerCore from '@museumwnf/viewer-core'
15
+ import { relatedKind } from './relatedKind.js'
15
16
 
16
17
  // A link to a legacy site that has a new one is drawn with the new site's
17
18
  // address from viewer-core 2.18.0 on (inventory-app#2482), as stored before.
@@ -168,25 +169,37 @@ function searchTests(mountSite, loadItems) {
168
169
  }
169
170
 
170
171
  // Legacy's Related Objects: every related object a thumbnail under "Related
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. Both
173
- // families drew them so; `heading` is the family's own word for them. An
172
+ // Objects", those outside this site's package too (inventory-app#2491), and
173
+ // the related monuments apart under "Related Monuments", after them, as
174
+ // Discover Islamic Art's sheet drew them (inventory-app#2611). One outside
175
+ // whose project has a site of its own links to it there. Both families draw
176
+ // them so; `headings` are the family's own words for the two blocks. An
174
177
  // 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 () => {
178
+ function relatedObjectsTest(mountSite, manifest, headings) {
179
+ it('draws every related object and monument as a thumbnail, apart, those outside the package too', async () => {
177
180
  const [items] = await loadEntities(['items'])
181
+ const byId = new Map(items.map((i) => [i.id, i]))
182
+ const isMonument = (ref) => relatedKind(ref, byId) === 'monument'
178
183
  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)
184
+ const related = (i) => i.related_items ?? []
185
+ const item = shown.find((i) => related(i).some(isMonument) && related(i).some((ref) => !isMonument(ref)) && related(i).some((ref) => ref.in_package === false))
186
+ ?? shown.find((i) => related(i).some((ref) => ref.in_package === false))
187
+ ?? shown.find((i) => related(i).length)
181
188
  if (!item) return
182
189
  const { app, host } = await mountSite(`#/item/${item.id}?lang=en`)
183
190
  await vi.waitFor(() => expect(host.querySelector('.mwnf-related-objects__tile')).not.toBeNull(), WAIT)
184
- const block = host.querySelector('.mwnf-related-objects')
185
- expect(block.querySelector('.mwnf-related-objects__heading').textContent).toBe(heading)
186
- expect(block.querySelectorAll('.mwnf-related-objects__tile')).toHaveLength(item.related_items.length)
191
+ const expected = [
192
+ [headings.objects, item.related_items.filter((ref) => !isMonument(ref))],
193
+ [headings.monuments, item.related_items.filter(isMonument)],
194
+ ].filter(([, refs]) => refs.length)
195
+ const blocks = [...host.querySelectorAll('.mwnf-related-objects')]
196
+ expect(blocks.map((block) => block.querySelector('.mwnf-related-objects__heading').textContent)).toEqual(expected.map(([heading]) => heading))
197
+ expected.forEach(([, refs], index) => {
198
+ expect(blocks[index].querySelectorAll('.mwnf-related-objects__tile')).toHaveLength(refs.length)
199
+ })
187
200
  const outside = item.related_items.find((ref) => ref.in_package === false && manifest.projects[ref.project_id]?.home_site)
188
201
  if (outside) {
189
- const hrefs = [...block.querySelectorAll('.mwnf-related-objects__link')].map((a) => a.getAttribute('href') ?? '')
202
+ const hrefs = blocks.flatMap((block) => [...block.querySelectorAll('.mwnf-related-objects__link')].map((a) => a.getAttribute('href') ?? ''))
190
203
  expect(hrefs.some((href) => href.endsWith(`/item/${outside.id}`))).toBe(true)
191
204
  }
192
205
  expect(host.querySelector('.mwnf-sheet-related__references')).toBeNull()
@@ -370,7 +383,7 @@ export function describeGallerySmoke({ config, sharedTexts, ownTexts, manifest,
370
383
  app.unmount()
371
384
  }, 60000)
372
385
 
373
- relatedObjectsTest(mountSite, manifest, sharedTexts.en['gallery.related.objects'])
386
+ relatedObjectsTest(mountSite, manifest, { objects: sharedTexts.en['gallery.related.objects'], monuments: sharedTexts.en['gallery.related.monuments'] })
374
387
 
375
388
  // The Source box takes the colour `projectColors` gives the item's
376
389
  // project, and the citation its name from the manifest.
@@ -704,7 +717,7 @@ export function describeExhibitionSmoke({
704
717
  app.unmount()
705
718
  }, 60000)
706
719
 
707
- relatedObjectsTest(mountSite, manifest, messages.en['exhibition.related.objects'])
720
+ relatedObjectsTest(mountSite, manifest, { objects: messages.en['exhibition.related.objects'], monuments: messages.en['exhibition.related.monuments'] })
708
721
 
709
722
  // On display in: this exhibition's own pages that show the item open
710
723
  // here, as legacy's did.