@museumwnf/viewer-layout 3.67.0 → 3.68.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/LegacyItemSheet-CZpGoBDb.js +639 -0
- package/dist/dxa.js +438 -436
- package/dist/viewer-layout.css +1 -1
- package/package.json +1 -1
- package/src/dxa/testing.js +18 -18
- package/dist/LegacyItemSheet-DO80usKA.js +0 -552
|
@@ -0,0 +1,639 @@
|
|
|
1
|
+
import { i as e, n as t, o as n, r, s as i, t as a } from "./OnDisplayIn-BH3Bqope.js";
|
|
2
|
+
import { c as o, d as s, r as c } from "./PartnerMap-DdyMLtgH.js";
|
|
3
|
+
import { n as l } from "./TimelineEventList-CIkKxyQu.js";
|
|
4
|
+
import { t as u } from "./RecordView-Bgd5mm_e.js";
|
|
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";
|
|
8
|
+
import { RouterLink as H, useRoute as U } from "vue-router";
|
|
9
|
+
// src/dxa/RelatedObjects.vue
|
|
10
|
+
var W = {
|
|
11
|
+
key: 0,
|
|
12
|
+
class: "mwnf-related-objects"
|
|
13
|
+
}, G = {
|
|
14
|
+
key: 0,
|
|
15
|
+
class: "mwnf-related-objects__heading"
|
|
16
|
+
}, ae = { class: "mwnf-related-objects__tiles" }, oe = ["src"], K = {
|
|
17
|
+
key: 1,
|
|
18
|
+
class: "mwnf-related-objects__empty",
|
|
19
|
+
"aria-hidden": "true"
|
|
20
|
+
}, q = ["innerHTML"], se = {
|
|
21
|
+
class: "mwnf-related-objects__tooltip",
|
|
22
|
+
"aria-hidden": "true"
|
|
23
|
+
}, ce = ["innerHTML"], le = { key: 0 }, ue = {
|
|
24
|
+
__name: "RelatedObjects",
|
|
25
|
+
props: {
|
|
26
|
+
heading: {
|
|
27
|
+
type: String,
|
|
28
|
+
default: ""
|
|
29
|
+
},
|
|
30
|
+
tiles: {
|
|
31
|
+
type: Array,
|
|
32
|
+
default: () => []
|
|
33
|
+
}
|
|
34
|
+
},
|
|
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", {
|
|
37
|
+
key: e.id,
|
|
38
|
+
class: "mwnf-related-objects__tile"
|
|
39
|
+
}, [b(s, {
|
|
40
|
+
to: e.to,
|
|
41
|
+
href: e.href,
|
|
42
|
+
external: !!e.href,
|
|
43
|
+
class: "mwnf-related-objects__link"
|
|
44
|
+
}, {
|
|
45
|
+
default: A(() => [e.image ? (w(), g("img", {
|
|
46
|
+
key: 0,
|
|
47
|
+
src: e.image,
|
|
48
|
+
alt: "",
|
|
49
|
+
loading: "lazy"
|
|
50
|
+
}, null, 8, oe)) : (w(), g("span", K)), _("span", {
|
|
51
|
+
class: "mwnf-related-objects__name-sr",
|
|
52
|
+
innerHTML: e.name
|
|
53
|
+
}, null, 8, q)]),
|
|
54
|
+
_: 2
|
|
55
|
+
}, 1032, [
|
|
56
|
+
"to",
|
|
57
|
+
"href",
|
|
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);
|
|
60
|
+
}
|
|
61
|
+
}, de = {
|
|
62
|
+
key: 0,
|
|
63
|
+
class: "mwnf-sheet-source"
|
|
64
|
+
}, fe = {
|
|
65
|
+
key: 0,
|
|
66
|
+
class: "mwnf-sheet-source__line"
|
|
67
|
+
}, pe = {
|
|
68
|
+
key: 1,
|
|
69
|
+
class: "mwnf-sheet-source__collection"
|
|
70
|
+
}, me = ["href"], he = {
|
|
71
|
+
key: 1,
|
|
72
|
+
class: "mwnf-sheet-notice"
|
|
73
|
+
}, ge = {
|
|
74
|
+
key: "museum",
|
|
75
|
+
class: "mwnf-sheet-museum"
|
|
76
|
+
}, _e = ["innerHTML"], ve = {
|
|
77
|
+
key: 0,
|
|
78
|
+
class: "mwnf-sheet-related"
|
|
79
|
+
}, ye = {
|
|
80
|
+
key: 0,
|
|
81
|
+
class: "mwnf-sheet-related__heading mwnf-sheet-related__heading--caps"
|
|
82
|
+
}, be = {
|
|
83
|
+
key: 1,
|
|
84
|
+
class: "mwnf-sheet-related__description"
|
|
85
|
+
}, xe = {
|
|
86
|
+
key: 0,
|
|
87
|
+
class: "mwnf-sheet-related__references"
|
|
88
|
+
}, Se = {
|
|
89
|
+
key: 2,
|
|
90
|
+
class: "mwnf-sheet-related__unresolved"
|
|
91
|
+
}, Ce = {
|
|
92
|
+
key: 4,
|
|
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 = {
|
|
95
|
+
__name: "ItemDetailView",
|
|
96
|
+
props: {
|
|
97
|
+
spec: {
|
|
98
|
+
type: Object,
|
|
99
|
+
required: !0
|
|
100
|
+
},
|
|
101
|
+
id: {
|
|
102
|
+
type: String,
|
|
103
|
+
required: !0
|
|
104
|
+
},
|
|
105
|
+
entity: {
|
|
106
|
+
type: String,
|
|
107
|
+
default: ""
|
|
108
|
+
},
|
|
109
|
+
dataGetter: {
|
|
110
|
+
type: Function,
|
|
111
|
+
default: null
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
setup(i) {
|
|
115
|
+
let o = i, s = k(), P = /* @__PURE__ */ new Set([
|
|
116
|
+
"before-sheet",
|
|
117
|
+
"museum",
|
|
118
|
+
"related",
|
|
119
|
+
"aside"
|
|
120
|
+
]), F = p(() => Object.keys(s).filter((e) => !P.has(e))), I = p(() => !o.dataGetter || o.dataGetter(o.id) != null), { t: L } = z();
|
|
121
|
+
function H(e) {
|
|
122
|
+
if (typeof e != "string" || !e.startsWith(ze)) return e;
|
|
123
|
+
let t = `sheet.dxa.${e.slice(12)}`;
|
|
124
|
+
return L(t) === t ? e : t;
|
|
125
|
+
}
|
|
126
|
+
let U = p(() => Array.isArray(o.spec.fields) ? {
|
|
127
|
+
...o.spec,
|
|
128
|
+
fields: o.spec.fields.map((e) => ({
|
|
129
|
+
...e,
|
|
130
|
+
label: H(e.label)
|
|
131
|
+
}))
|
|
132
|
+
} : o.spec), W = B(), G = (e, t) => (e.name ?? "").localeCompare(t.name ?? ""), ae = (e) => (e.gallery_references ?? []).filter((e) => e.kind === "gallery").sort(G), oe = (e) => (e.gallery_references ?? []).filter((e) => e.kind === "exhibition").sort(G), K = (e) => W.links(e.project_id)?.artisticIntroductionUrl ?? null, q = (e) => W.links(e.project_id)?.relatedDatabaseUrl ?? null, se = {
|
|
133
|
+
"islamicart.museumwnf.org": "core.project.islamicArt",
|
|
134
|
+
"baroqueart.museumwnf.org": "core.project.baroqueArt",
|
|
135
|
+
"sharinghistory.museumwnf.org": "core.project.sharingHistory"
|
|
136
|
+
};
|
|
137
|
+
function ce(e) {
|
|
138
|
+
try {
|
|
139
|
+
let t = se[new URL(q(e)).host];
|
|
140
|
+
if (t) return L(t);
|
|
141
|
+
} catch {}
|
|
142
|
+
return W.label(e.project_id);
|
|
143
|
+
}
|
|
144
|
+
function le(e, t) {
|
|
145
|
+
if (!e) return null;
|
|
146
|
+
let n = U.value.sourceDatabase === !1 ? null : U.value.sourceDatabase ?? null, r = null;
|
|
147
|
+
if (n) {
|
|
148
|
+
let i = n.chipClass ? n.chipClass(e, t) : null, a = W.label(e.project_id);
|
|
149
|
+
(i || a) && (r = {
|
|
150
|
+
chipClass: i,
|
|
151
|
+
name: a,
|
|
152
|
+
label: L(n.label ?? "record.sheet.sourceDatabase")
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
let i = n && n.addToCollection !== !1 ? L(n.addToCollection?.label ?? "record.action.addToCollection") : null, a = U.value.notice === !1 ? null : U.value.notice ?? null, o = a && a.show(e, t) ? L(a.label) : null;
|
|
156
|
+
return {
|
|
157
|
+
source: r,
|
|
158
|
+
addToCollectionLabel: i,
|
|
159
|
+
notice: o
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
let J = R(), Be = ne("partners"), Y = ne("countries");
|
|
163
|
+
re(["partners", "countries"]), J.loadTranslations("countries", "en");
|
|
164
|
+
function X(e, t) {
|
|
165
|
+
let n = J.tr("countries", e, t, "en");
|
|
166
|
+
return M(n.name ?? Y.value?.get(e)?.internal_name ?? "");
|
|
167
|
+
}
|
|
168
|
+
function Z(e) {
|
|
169
|
+
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;
|
|
170
|
+
return {
|
|
171
|
+
holder: t,
|
|
172
|
+
view: r ? ie(r, J.tr("partners", r.id, e.language, "en"), {
|
|
173
|
+
countryLabel: (t) => X(t, e.language),
|
|
174
|
+
route: (t) => n.route ? n.route(t.id, e) : null
|
|
175
|
+
}) : null
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
function Q(e, t) {
|
|
179
|
+
if (!e) return null;
|
|
180
|
+
let n = U.value.related ?? {}, r = t.records ?? [], i = t.outside ?? [], a = o.dataGetter ? r.filter((e) => o.dataGetter(e.id) != null) : r, s = o.dataGetter ? r.filter((e) => o.dataGetter(e.id) == null).map((t) => (e.related_items ?? []).find((e) => e.id === t.id)).filter(Boolean) : [], c = [...i, ...s].map((e) => ({
|
|
181
|
+
...e,
|
|
182
|
+
name: e.project_id ? W.label(e.project_id) : null,
|
|
183
|
+
chipClass: n.outsideChip ? n.outsideChip(e, t) : null
|
|
184
|
+
})), l = (t) => (n.onDisplayIn?.href ? n.onDisplayIn.href(t, e) : t.legacy_host) || "", u = (e) => ({
|
|
185
|
+
id: e.id,
|
|
186
|
+
label: j(e.name ?? ""),
|
|
187
|
+
href: l(e),
|
|
188
|
+
external: !!l(e)
|
|
189
|
+
}), d = n.onDisplayIn && n.onDisplayIn !== !1 ? {
|
|
190
|
+
pendingLabel: n.onDisplayIn.linkPendingLabel ?? "",
|
|
191
|
+
groups: [n.onDisplayIn.exhibitions ? {
|
|
192
|
+
heading: n.onDisplayIn.exhibitionsHeading ?? "record.related.exhibitions",
|
|
193
|
+
sections: n.onDisplayIn.exhibitions(e, t)
|
|
194
|
+
} : {
|
|
195
|
+
heading: n.onDisplayIn.exhibitionsHeading ?? "record.related.exhibitions",
|
|
196
|
+
links: oe(e).map(u)
|
|
197
|
+
}, {
|
|
198
|
+
heading: n.onDisplayIn.galleriesHeading ?? "record.related.galleries",
|
|
199
|
+
links: ae(e).map(u)
|
|
200
|
+
}].filter((e) => (e.sections ?? [e]).some((e) => e.links?.length))
|
|
201
|
+
} : null, f = n.databaseLabel && q(e) ? {
|
|
202
|
+
url: q(e),
|
|
203
|
+
label: L(n.databaseLabel),
|
|
204
|
+
name: ce(e)
|
|
205
|
+
} : null, p = n.overallDatabase && n.overallDatabase !== !1 ? {
|
|
206
|
+
label: L(n.overallDatabase.label),
|
|
207
|
+
linkLabel: L(n.overallDatabase.linkLabel)
|
|
208
|
+
} : null;
|
|
209
|
+
return {
|
|
210
|
+
title: n.title ? L(n.title) : "",
|
|
211
|
+
description: n.description ? L(n.description) : "",
|
|
212
|
+
heading: L(n.heading ?? "record.related.items"),
|
|
213
|
+
tiles: n.objectTiles ? n.objectTiles({
|
|
214
|
+
record: e,
|
|
215
|
+
inPackage: a,
|
|
216
|
+
references: c,
|
|
217
|
+
ctx: t
|
|
218
|
+
}) : null,
|
|
219
|
+
variant: n.variant ?? "grid",
|
|
220
|
+
actionLabel: n.actionLabel ? L(n.actionLabel) : "",
|
|
221
|
+
inPackage: a,
|
|
222
|
+
references: c,
|
|
223
|
+
notInPackageLabel: n.notInPackageLabel ? L(n.notInPackageLabel) : "",
|
|
224
|
+
artisticIntroduction: n.artisticIntroductionLabel && K(e) ? {
|
|
225
|
+
url: K(e),
|
|
226
|
+
label: L(n.artisticIntroductionLabel)
|
|
227
|
+
} : null,
|
|
228
|
+
timeline: n.timeline ? n.timeline(e, t) : null,
|
|
229
|
+
glossary: n.glossary !== !1,
|
|
230
|
+
glossaryLabels: n.glossaryLabels ?? {},
|
|
231
|
+
dynasties: n.dynasties ? n.dynasties(e, t.language, t) : null,
|
|
232
|
+
dynastiesHeading: L(n.dynastiesHeading ?? "record.dynasty.list"),
|
|
233
|
+
media: n.media === !1 ? [] : e.media ?? [],
|
|
234
|
+
mediaGroups: n.mediaHeadings && n.media !== !1 ? ["audio", "video"].map((r) => ({
|
|
235
|
+
type: r,
|
|
236
|
+
heading: L(n.mediaHeadings[r]),
|
|
237
|
+
entries: (e.media ?? []).filter((e) => e?.url && e.type === r && (!e.language || !t.language || e.language === t.language))
|
|
238
|
+
})).filter((e) => e.entries.length) : null,
|
|
239
|
+
onDisplayIn: d,
|
|
240
|
+
database: f,
|
|
241
|
+
overallDatabase: p,
|
|
242
|
+
download: n.download === !1 ? null : {
|
|
243
|
+
label: L("record.action.download"),
|
|
244
|
+
pdfLabel: L("record.action.downloadPdf")
|
|
245
|
+
}
|
|
246
|
+
};
|
|
247
|
+
}
|
|
248
|
+
let $ = V(), Ve = p(() => {
|
|
249
|
+
let e = d($.chrome, "world.png");
|
|
250
|
+
return e ? { "--mwnf-dxa-glossary-image": `url("${e}")` } : null;
|
|
251
|
+
});
|
|
252
|
+
function He() {
|
|
253
|
+
window.print();
|
|
254
|
+
}
|
|
255
|
+
return (o, s) => I.value ? (w(), m(u, {
|
|
256
|
+
key: 0,
|
|
257
|
+
spec: U.value,
|
|
258
|
+
id: i.id,
|
|
259
|
+
entity: i.entity,
|
|
260
|
+
style: ee(Ve.value)
|
|
261
|
+
}, v({
|
|
262
|
+
"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", {
|
|
263
|
+
key: 0,
|
|
264
|
+
class: S(["mwnf-chip", t.source.chipClass]),
|
|
265
|
+
"aria-hidden": "true"
|
|
266
|
+
}, 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", {
|
|
267
|
+
href: O(N).myCollection,
|
|
268
|
+
target: "_blank",
|
|
269
|
+
rel: "noopener"
|
|
270
|
+
}, "↗ " + 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))])]),
|
|
271
|
+
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", {
|
|
272
|
+
key: 0,
|
|
273
|
+
class: "mwnf-sheet-museum__holder",
|
|
274
|
+
innerHTML: t.holder
|
|
275
|
+
}, null, 8, _e)) : h("", !0), t.view ? (w(), m(l, {
|
|
276
|
+
key: 1,
|
|
277
|
+
variant: "summary",
|
|
278
|
+
partner: t.view,
|
|
279
|
+
label: "partner.info.about",
|
|
280
|
+
dir: e.dir
|
|
281
|
+
}, null, 8, ["partner", "dir"])) : h("", !0)]))), 128))])]),
|
|
282
|
+
related: A(() => []),
|
|
283
|
+
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, [
|
|
284
|
+
o.title ? (w(), g("p", ye, D(o.title), 1)) : h("", !0),
|
|
285
|
+
o.description ? (w(), g("p", be, D(o.description), 1)) : h("", !0),
|
|
286
|
+
o.tiles ? (w(), m(ue, {
|
|
287
|
+
key: 2,
|
|
288
|
+
heading: o.heading,
|
|
289
|
+
tiles: o.tiles
|
|
290
|
+
}, null, 8, ["heading", "tiles"])) : o.inPackage.length || o.references.length ? (w(), m(c, {
|
|
291
|
+
key: 3,
|
|
292
|
+
heading: o.heading,
|
|
293
|
+
records: o.inPackage,
|
|
294
|
+
variant: o.variant,
|
|
295
|
+
"action-label": o.actionLabel
|
|
296
|
+
}, {
|
|
297
|
+
default: A(() => [o.references.length ? (w(), g("ul", xe, [(w(!0), g(f, null, T(o.references, (e) => (w(), g("li", { key: e.id }, [
|
|
298
|
+
e.chipClass ? (w(), g("span", {
|
|
299
|
+
key: 0,
|
|
300
|
+
class: S(["mwnf-chip", e.chipClass]),
|
|
301
|
+
"aria-hidden": "true"
|
|
302
|
+
}, null, 2)) : h("", !0),
|
|
303
|
+
e.name ? (w(), g(f, { key: 1 }, [y(D(e.name), 1)], 64)) : h("", !0),
|
|
304
|
+
o.notInPackageLabel ? (w(), g("span", Se, D(o.notInPackageLabel), 1)) : h("", !0)
|
|
305
|
+
]))), 128))])) : h("", !0)]),
|
|
306
|
+
_: 2
|
|
307
|
+
}, 1032, [
|
|
308
|
+
"heading",
|
|
309
|
+
"records",
|
|
310
|
+
"variant",
|
|
311
|
+
"action-label"
|
|
312
|
+
])) : h("", !0),
|
|
313
|
+
o.artisticIntroduction ? (w(), g("p", Ce, [_("a", {
|
|
314
|
+
href: o.artisticIntroduction.url,
|
|
315
|
+
target: "_blank",
|
|
316
|
+
rel: "noopener"
|
|
317
|
+
}, "↗ " + D(o.artisticIntroduction.label), 9, we)])) : h("", !0),
|
|
318
|
+
o.timeline ? (w(), m(r, {
|
|
319
|
+
key: i.record.id,
|
|
320
|
+
info: o.timeline
|
|
321
|
+
}, null, 8, ["info"])) : h("", !0),
|
|
322
|
+
o.glossary ? (w(), m(n, {
|
|
323
|
+
key: 6,
|
|
324
|
+
language: i.language,
|
|
325
|
+
labels: o.glossaryLabels,
|
|
326
|
+
dir: i.dir
|
|
327
|
+
}, null, 8, [
|
|
328
|
+
"language",
|
|
329
|
+
"labels",
|
|
330
|
+
"dir"
|
|
331
|
+
])) : h("", !0),
|
|
332
|
+
o.dynasties?.records?.length ? (w(), m(e, {
|
|
333
|
+
key: 7,
|
|
334
|
+
heading: o.dynastiesHeading,
|
|
335
|
+
dynasties: o.dynasties.records,
|
|
336
|
+
tr: o.dynasties.tr,
|
|
337
|
+
dir: i.dir
|
|
338
|
+
}, null, 8, [
|
|
339
|
+
"heading",
|
|
340
|
+
"dynasties",
|
|
341
|
+
"tr",
|
|
342
|
+
"dir"
|
|
343
|
+
])) : h("", !0),
|
|
344
|
+
o.mediaGroups ? (w(!0), g(f, { key: 8 }, T(o.mediaGroups, (e) => (w(), g("div", {
|
|
345
|
+
key: e.type,
|
|
346
|
+
class: S(["mwnf-sheet-related__media", `mwnf-sheet-related__media--${e.type}`])
|
|
347
|
+
}, [_("p", Te, D(e.heading), 1), (w(!0), g(f, null, T(e.entries, (e) => (w(), g("p", {
|
|
348
|
+
key: e.url,
|
|
349
|
+
class: "mwnf-sheet-related__line"
|
|
350
|
+
}, [_("a", {
|
|
351
|
+
href: e.url,
|
|
352
|
+
target: "_blank",
|
|
353
|
+
rel: "noopener"
|
|
354
|
+
}, "↗ " + D(e.title || e.url), 9, Ee)]))), 128))], 2))), 128)) : (w(), m(t, {
|
|
355
|
+
key: 9,
|
|
356
|
+
media: o.media,
|
|
357
|
+
language: i.language,
|
|
358
|
+
descriptions: !1,
|
|
359
|
+
dir: i.dir
|
|
360
|
+
}, null, 8, [
|
|
361
|
+
"media",
|
|
362
|
+
"language",
|
|
363
|
+
"dir"
|
|
364
|
+
])),
|
|
365
|
+
o.onDisplayIn?.groups.length ? (w(), g("div", De, [_("p", Oe, D(O(L)("record.related.onDisplayIn")), 1), b(a, {
|
|
366
|
+
heading: "",
|
|
367
|
+
groups: o.onDisplayIn.groups,
|
|
368
|
+
"pending-label": o.onDisplayIn.pendingLabel,
|
|
369
|
+
dir: i.dir
|
|
370
|
+
}, null, 8, [
|
|
371
|
+
"groups",
|
|
372
|
+
"pending-label",
|
|
373
|
+
"dir"
|
|
374
|
+
])])) : h("", !0),
|
|
375
|
+
o.database ? (w(), g("div", ke, [_("p", Ae, D(o.database.label), 1), _("p", je, [_("a", {
|
|
376
|
+
href: o.database.url,
|
|
377
|
+
target: "_blank",
|
|
378
|
+
rel: "noopener"
|
|
379
|
+
}, "↗ " + D(o.database.name), 9, Me)])])) : h("", !0),
|
|
380
|
+
o.overallDatabase ? (w(), g("div", Ne, [_("p", Pe, D(o.overallDatabase.label), 1), _("p", Fe, [_("a", {
|
|
381
|
+
href: O(N).overallDatabase,
|
|
382
|
+
target: "_blank",
|
|
383
|
+
rel: "noopener"
|
|
384
|
+
}, "↗ " + D(o.overallDatabase.linkLabel), 9, Ie)])])) : h("", !0),
|
|
385
|
+
o.download ? (w(), g("div", Le, [_("p", Re, D(o.download.label), 1), _("p", {
|
|
386
|
+
class: "mwnf-sheet-related__line mwnf-sheet-related__line--action",
|
|
387
|
+
onClick: He
|
|
388
|
+
}, "➤ " + D(o.download.pdfLabel), 1)])) : h("", !0)
|
|
389
|
+
])) : h("", !0)], 64))), 128))])]),
|
|
390
|
+
_: 2
|
|
391
|
+
}, [T(F.value, (e) => ({
|
|
392
|
+
name: e,
|
|
393
|
+
fn: A((t) => [E(o.$slots, e, C(x(t)))])
|
|
394
|
+
}))]), 1032, [
|
|
395
|
+
"spec",
|
|
396
|
+
"id",
|
|
397
|
+
"entity",
|
|
398
|
+
"style"
|
|
399
|
+
])) : (w(), m(O(te), { key: 1 }));
|
|
400
|
+
}
|
|
401
|
+
}, 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>`;
|
|
402
|
+
function Q(e, t, n) {
|
|
403
|
+
return n && e.site === n ? {
|
|
404
|
+
id: e.path,
|
|
405
|
+
label: t,
|
|
406
|
+
to: e.path
|
|
407
|
+
} : {
|
|
408
|
+
id: `${e.site}${e.path}`,
|
|
409
|
+
label: t,
|
|
410
|
+
href: F(e.site, e.path),
|
|
411
|
+
external: !0
|
|
412
|
+
};
|
|
413
|
+
}
|
|
414
|
+
function $(e) {
|
|
415
|
+
return e.toLowerCase().split(" ").filter((e) => ![
|
|
416
|
+
"a",
|
|
417
|
+
"an",
|
|
418
|
+
"the"
|
|
419
|
+
].includes(e)).join(" ");
|
|
420
|
+
}
|
|
421
|
+
function Ve(e, t, n = null) {
|
|
422
|
+
let r = e?.exhibition_references ?? [], i = [], a = r.filter((e) => e.list === "virtual" || e.list === "sharing_history");
|
|
423
|
+
a.length && i.push({
|
|
424
|
+
caption: a[0].project ? Y(a[0].project.name) : "",
|
|
425
|
+
links: a.map((e) => Q(e, [
|
|
426
|
+
Y(X(e.exhibition)),
|
|
427
|
+
Z(Y(X(e.theme))),
|
|
428
|
+
...e.subtheme ? [Z(Y(X(e.subtheme)))] : []
|
|
429
|
+
].join(" | "), n))
|
|
430
|
+
});
|
|
431
|
+
let o = r.filter((e) => e.list === "exhibition"), s = o.filter((e) => e.exhibition?.titles?.[t]), c = s.length ? {
|
|
432
|
+
refs: s,
|
|
433
|
+
lang: t
|
|
434
|
+
} : {
|
|
435
|
+
refs: o.filter((e) => e.exhibition?.titles?.en),
|
|
436
|
+
lang: "en"
|
|
437
|
+
}, l = (e) => e?.titles?.[c.lang] ?? e?.titles?.en ?? "", u = [...c.refs].sort((e, t) => $(l(e.exhibition)).localeCompare($(l(t.exhibition)), "en", { sensitivity: "base" }) || (e.legacy_order?.[0] ?? 0) - (t.legacy_order?.[0] ?? 0));
|
|
438
|
+
for (let e of u) {
|
|
439
|
+
let t = Y(l(e.exhibition)), r = Q(e, `${Y(l(e.theme))} | ${Z(Y(l(e.subtheme)))}`, n), a = i[i.length - 1];
|
|
440
|
+
a?.exhibition === e.exhibition.id ? a.links.push(r) : i.push({
|
|
441
|
+
exhibition: e.exhibition.id,
|
|
442
|
+
caption: t,
|
|
443
|
+
links: [r]
|
|
444
|
+
});
|
|
445
|
+
}
|
|
446
|
+
return i;
|
|
447
|
+
}
|
|
448
|
+
// src/dxa/LegacyItemSheet.vue
|
|
449
|
+
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 = {
|
|
450
|
+
key: "citation",
|
|
451
|
+
class: "mwnf-dxa-gallery-item__citation"
|
|
452
|
+
}, Ze = { class: "mwnf-dxa-gallery-item__project" }, Qe = { class: "mwnf-dxa-gallery-item__address" }, $e = { class: "mwnf-dxa-gallery-item__credit-label" }, et = {
|
|
453
|
+
key: 1,
|
|
454
|
+
class: "mwnf-dxa-gallery-item__number"
|
|
455
|
+
}, tt = { class: "mwnf-dxa-gallery-item__number-label" }, nt = ["href"], rt = {
|
|
456
|
+
__name: "LegacyItemSheet",
|
|
457
|
+
props: {
|
|
458
|
+
id: {
|
|
459
|
+
type: String,
|
|
460
|
+
required: !0
|
|
461
|
+
},
|
|
462
|
+
itemDetail: {
|
|
463
|
+
type: Object,
|
|
464
|
+
required: !0
|
|
465
|
+
},
|
|
466
|
+
dataGetter: {
|
|
467
|
+
type: Function,
|
|
468
|
+
default: null
|
|
469
|
+
},
|
|
470
|
+
words: {
|
|
471
|
+
type: Object,
|
|
472
|
+
required: !0
|
|
473
|
+
}
|
|
474
|
+
},
|
|
475
|
+
setup(e) {
|
|
476
|
+
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] ?? "";
|
|
477
|
+
function d({ record: e, inPackage: t, references: n, ctx: r }) {
|
|
478
|
+
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) => ({
|
|
479
|
+
id: e.id,
|
|
480
|
+
image: e.image,
|
|
481
|
+
name: e.name,
|
|
482
|
+
country: l.countryLabel(l.itemById.value.get(e.id)?.country_id),
|
|
483
|
+
justification: s(e.id),
|
|
484
|
+
to: e.to
|
|
485
|
+
})), d = n.map((e) => {
|
|
486
|
+
let t = a.links(e.project_id)?.homeSite;
|
|
487
|
+
return {
|
|
488
|
+
id: e.id,
|
|
489
|
+
image: e.image ?? "",
|
|
490
|
+
name: j(u(e.names, i)),
|
|
491
|
+
country: l.countryLabel(e.country_id),
|
|
492
|
+
justification: s(e.id),
|
|
493
|
+
href: t ? F(t, `/item/${e.id}`) : ""
|
|
494
|
+
};
|
|
495
|
+
}), f = (e.related_items ?? []).map((e) => e.id);
|
|
496
|
+
return [...c, ...d].sort((e, t) => f.indexOf(e.id) - f.indexOf(t.id));
|
|
497
|
+
}
|
|
498
|
+
let v = p(() => ({
|
|
499
|
+
...t.itemDetail,
|
|
500
|
+
sourceDatabase: !1,
|
|
501
|
+
sourceCredit: !1,
|
|
502
|
+
mediaThumbsFrom: 1,
|
|
503
|
+
mediaCreditCaption: !1,
|
|
504
|
+
shortDescriptionLabels: {
|
|
505
|
+
view: t.words.viewShortDescription,
|
|
506
|
+
hide: t.words.hideShortDescription
|
|
507
|
+
},
|
|
508
|
+
related: {
|
|
509
|
+
...t.itemDetail.related,
|
|
510
|
+
glossaryLabels: { tool: t.words.glossary },
|
|
511
|
+
dynastiesHeading: t.words.dynasties,
|
|
512
|
+
mediaHeadings: {
|
|
513
|
+
audio: t.words.relatedAudio,
|
|
514
|
+
video: t.words.relatedVideos
|
|
515
|
+
},
|
|
516
|
+
...t.words.relatedObjects ? {
|
|
517
|
+
heading: t.words.relatedObjects,
|
|
518
|
+
objectTiles: d
|
|
519
|
+
} : {},
|
|
520
|
+
onDisplayIn: {
|
|
521
|
+
...t.itemDetail.related?.onDisplayIn,
|
|
522
|
+
exhibitionsHeading: t.words.exhibitions,
|
|
523
|
+
galleriesHeading: "core.project.galleries",
|
|
524
|
+
href: (e, t) => e.site ? F(e.site, `/item/${t.id}`) : e.legacy_host,
|
|
525
|
+
exhibitions: (e, t) => Ve(e, t.language, s.manifest?.site?.key)
|
|
526
|
+
}
|
|
527
|
+
}
|
|
528
|
+
}));
|
|
529
|
+
function x(e) {
|
|
530
|
+
let t = a.links(e?.project_id)?.homeSite;
|
|
531
|
+
return (t && t !== s.manifest?.site?.key ? F(t, `/item/${e.id}`) : null) ?? I(r);
|
|
532
|
+
}
|
|
533
|
+
function C(e) {
|
|
534
|
+
try {
|
|
535
|
+
let { host: t, pathname: n } = new URL(e), r = n.split("/").find(Boolean);
|
|
536
|
+
return r ? `${t}/${r}` : t;
|
|
537
|
+
} catch {
|
|
538
|
+
return e;
|
|
539
|
+
}
|
|
540
|
+
}
|
|
541
|
+
let ee = (e) => c.projectColors?.[e?.project_id] ?? "";
|
|
542
|
+
function E(e, t) {
|
|
543
|
+
let n = a.label(t?.project_id) ?? "", r = n ? e.indexOf(` ${n},`) : -1;
|
|
544
|
+
return r < 0 ? {
|
|
545
|
+
before: e,
|
|
546
|
+
project: "",
|
|
547
|
+
after: ""
|
|
548
|
+
} : {
|
|
549
|
+
before: e.slice(0, r + 1),
|
|
550
|
+
project: n,
|
|
551
|
+
after: e.slice(r + 1 + n.length)
|
|
552
|
+
};
|
|
553
|
+
}
|
|
554
|
+
function k(e) {
|
|
555
|
+
return {
|
|
556
|
+
to: t.itemDetail.museum?.route?.(e.record?.partner_id) ?? null,
|
|
557
|
+
holder: e.text?.holder ? j(String(e.text.holder)) : ""
|
|
558
|
+
};
|
|
559
|
+
}
|
|
560
|
+
return (t, r) => (w(), m(J, {
|
|
561
|
+
spec: v.value,
|
|
562
|
+
id: e.id,
|
|
563
|
+
"data-getter": e.dataGetter,
|
|
564
|
+
class: "mwnf-dxa-item mwnf-dxa-gallery-item"
|
|
565
|
+
}, {
|
|
566
|
+
header: A(({ languages: e, language: t, select: n }) => [_("div", He, [b(o, {
|
|
567
|
+
languages: e,
|
|
568
|
+
language: t,
|
|
569
|
+
from: 1,
|
|
570
|
+
onSelect: n
|
|
571
|
+
}, null, 8, [
|
|
572
|
+
"languages",
|
|
573
|
+
"language",
|
|
574
|
+
"onSelect"
|
|
575
|
+
])]), b(i)]),
|
|
576
|
+
"after-media": A(({ record: e, dir: t }) => [e ? (w(), g("div", {
|
|
577
|
+
key: 0,
|
|
578
|
+
class: "mwnf-dxa-gallery-item__links",
|
|
579
|
+
dir: t || void 0
|
|
580
|
+
}, [_("p", null, [_("a", {
|
|
581
|
+
href: x(e),
|
|
582
|
+
target: "_blank",
|
|
583
|
+
rel: "noopener"
|
|
584
|
+
}, [r[0] ||= _("span", {
|
|
585
|
+
class: "mwnf-dxa-gallery-item__icon",
|
|
586
|
+
"aria-hidden": "true"
|
|
587
|
+
}, "↗", -1), _("bdi", null, [y(D(O(n)("record.source.label")) + " ", 1), _("span", null, "(" + D(C(x(e))) + ")", 1)])], 8, We)]), _("p", null, [_("a", {
|
|
588
|
+
href: O(N).myCollection,
|
|
589
|
+
target: "_blank",
|
|
590
|
+
rel: "noopener"
|
|
591
|
+
}, [r[1] ||= _("span", {
|
|
592
|
+
class: "mwnf-dxa-gallery-item__icon",
|
|
593
|
+
"aria-hidden": "true"
|
|
594
|
+
}, "↗", -1), y(D(O(n)("record.action.addToCollection")), 1)], 8, Ge)])], 8, Ue)) : h("", !0)]),
|
|
595
|
+
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), {
|
|
596
|
+
key: 0,
|
|
597
|
+
to: e.to,
|
|
598
|
+
class: "mwnf-dxa-gallery-item__museum"
|
|
599
|
+
}, {
|
|
600
|
+
default: A(() => [r[2] ||= _("span", {
|
|
601
|
+
class: "mwnf-dxa-gallery-item__icon",
|
|
602
|
+
"aria-hidden": "true"
|
|
603
|
+
}, "↗", -1), _("span", { innerHTML: e.holder }, null, 8, Ke)]),
|
|
604
|
+
_: 2
|
|
605
|
+
}, 1032, ["to"])) : e.holder ? (w(), g("span", {
|
|
606
|
+
key: 1,
|
|
607
|
+
innerHTML: e.holder
|
|
608
|
+
}, null, 8, qe)) : h("", !0)], 64))), 128))]),
|
|
609
|
+
credits: A(({ record: t, credits: r, workingNumber: i, citation: a, dir: o }) => [t ? (w(), g("div", {
|
|
610
|
+
key: 0,
|
|
611
|
+
class: "mwnf-dxa-gallery-item__credits",
|
|
612
|
+
dir: o || void 0
|
|
613
|
+
}, [
|
|
614
|
+
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, [
|
|
615
|
+
y(D(e.before), 1),
|
|
616
|
+
_("span", Ze, D(e.project), 1),
|
|
617
|
+
y(D(e.after) + " ", 1),
|
|
618
|
+
_("span", Qe, D(x(t)), 1)
|
|
619
|
+
]))), 128))], 64)) : h("", !0),
|
|
620
|
+
(w(!0), g(f, null, T(r, (e) => (w(), g("p", {
|
|
621
|
+
key: e.label,
|
|
622
|
+
class: "mwnf-dxa-gallery-item__credit"
|
|
623
|
+
}, [_("span", $e, D(e.label), 1), _("span", null, D(e.value), 1)]))), 128)),
|
|
624
|
+
i ? (w(), g("p", et, [_("span", tt, D(O(n)(e.words.workingNumber)), 1), y(D(" ") + D(i), 1)])) : h("", !0),
|
|
625
|
+
_("div", { class: S(["mwnf-dxa-gallery-item__source", ee(t)]) }, [_("p", null, D(O(n)("record.source.label")), 1), _("p", null, [_("a", {
|
|
626
|
+
href: x(t),
|
|
627
|
+
target: "_blank",
|
|
628
|
+
rel: "noopener"
|
|
629
|
+
}, D(x(t)), 9, nt)])], 2)
|
|
630
|
+
], 8, Je)) : h("", !0)]),
|
|
631
|
+
_: 1
|
|
632
|
+
}, 8, [
|
|
633
|
+
"spec",
|
|
634
|
+
"id",
|
|
635
|
+
"data-getter"
|
|
636
|
+
]));
|
|
637
|
+
}
|
|
638
|
+
};
|
|
639
|
+
export { J as n, rt as t };
|