@museumwnf/viewer-layout 3.62.0 → 3.63.1

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.
@@ -1,87 +0,0 @@
1
- import { d as e } from "./PartnerMap-U-Hi2FBi.js";
2
- import { Fragment as t, computed as n, createCommentVNode as r, createElementBlock as i, createElementVNode as a, createVNode as o, openBlock as s, renderList as c, renderSlot as l, toDisplayString as u, useSlots as d, withCtx as f } from "vue";
3
- // src/content/FeaturedRecord.vue
4
- var p = {
5
- key: 0,
6
- class: "mwnf-featured"
7
- }, m = {
8
- key: 0,
9
- class: "mwnf-featured__heading"
10
- }, h = {
11
- key: 0,
12
- class: "mwnf-featured__media"
13
- }, g = ["src", "alt"], _ = { class: "mwnf-featured__body" }, v = {
14
- key: 0,
15
- class: "mwnf-featured__eyebrow"
16
- }, y = ["innerHTML"], b = {
17
- key: 1,
18
- class: "mwnf-featured__action"
19
- }, x = {
20
- __name: "FeaturedRecord",
21
- props: {
22
- image: {
23
- type: String,
24
- default: ""
25
- },
26
- imageAlt: {
27
- type: String,
28
- default: ""
29
- },
30
- eyebrow: {
31
- type: String,
32
- default: ""
33
- },
34
- name: {
35
- type: String,
36
- default: ""
37
- },
38
- meta: {
39
- type: Array,
40
- default: () => []
41
- },
42
- action: {
43
- type: String,
44
- default: ""
45
- },
46
- to: {
47
- type: [String, Object],
48
- default: null
49
- },
50
- href: {
51
- type: String,
52
- default: ""
53
- },
54
- heading: {
55
- type: String,
56
- default: ""
57
- }
58
- },
59
- setup(x) {
60
- let S = x, C = d(), w = n(() => !!(S.name || S.image || C.default));
61
- return (n, d) => w.value ? (s(), i("section", p, [x.heading ? (s(), i("h2", m, u(x.heading), 1)) : r("", !0), l(n.$slots, "default", {}, () => [o(e, {
62
- class: "mwnf-featured__link",
63
- to: x.to,
64
- href: x.href
65
- }, {
66
- default: f(() => [x.image ? (s(), i("span", h, [a("img", {
67
- class: "mwnf-featured__image",
68
- src: x.image,
69
- alt: x.imageAlt,
70
- loading: "eager"
71
- }, null, 8, g)])) : r("", !0), a("span", _, [
72
- x.eyebrow ? (s(), i("span", v, u(x.eyebrow), 1)) : r("", !0),
73
- a("span", {
74
- class: "mwnf-featured__name",
75
- innerHTML: x.name
76
- }, null, 8, y),
77
- (s(!0), i(t, null, c(x.meta, (e, t) => (s(), i("span", {
78
- key: t,
79
- class: "mwnf-featured__meta"
80
- }, u(e), 1))), 128)),
81
- x.action ? (s(), i("span", b, u(x.action) + " →", 1)) : r("", !0)
82
- ])]),
83
- _: 1
84
- }, 8, ["to", "href"])])])) : r("", !0);
85
- }
86
- };
87
- export { x as t };
@@ -1,313 +0,0 @@
1
- import { i as e, n as t, o as n, r, t as i } from "./OnDisplayIn-CPANKcOd.js";
2
- import { n as a } from "./TimelineEventList-1feZA5t7.js";
3
- import { r as o } from "./PartnerMap-U-Hi2FBi.js";
4
- import { t as s } from "./RecordView-BE4mbj6G.js";
5
- import { t as c } from "./chrome-Bv_mLlHM.js";
6
- import { Fragment as l, computed as u, createBlock as d, createCommentVNode as f, createElementBlock as p, createElementVNode as m, createSlots as ee, createTextVNode as h, createVNode as g, guardReactiveProps as _, normalizeClass as v, normalizeProps as y, normalizeStyle as te, openBlock as b, renderList as x, renderSlot as S, toDisplayString as C, unref as w, useSlots as ne, withCtx as T } from "vue";
7
- import { NotFoundView as re, byId as E, loadEntities as ie, mdInline as D, mdStrip as ae, mwnfLinks as O, partnerView as oe, useDataPackage as se, useI18n as ce, useProjects as le, useSiteConfig as ue } from "@museumwnf/viewer-core";
8
- // src/dxa/ItemDetailView.vue
9
- var k = {
10
- key: 0,
11
- class: "mwnf-sheet-source"
12
- }, A = {
13
- key: 0,
14
- class: "mwnf-sheet-source__line"
15
- }, j = {
16
- key: 1,
17
- class: "mwnf-sheet-source__collection"
18
- }, M = ["href"], N = {
19
- key: 1,
20
- class: "mwnf-sheet-notice"
21
- }, P = {
22
- key: "museum",
23
- class: "mwnf-sheet-museum"
24
- }, F = ["innerHTML"], I = {
25
- key: 0,
26
- class: "mwnf-sheet-related"
27
- }, L = {
28
- key: 0,
29
- class: "mwnf-sheet-related__heading mwnf-sheet-related__heading--caps"
30
- }, R = {
31
- key: 1,
32
- class: "mwnf-sheet-related__description"
33
- }, z = {
34
- key: 0,
35
- class: "mwnf-sheet-related__references"
36
- }, B = {
37
- key: 2,
38
- class: "mwnf-sheet-related__unresolved"
39
- }, V = {
40
- key: 3,
41
- class: "mwnf-sheet-related__line"
42
- }, H = ["href"], U = { key: 7 }, de = { class: "mwnf-sheet-related__heading" }, fe = { key: 8 }, pe = { class: "mwnf-sheet-related__heading" }, me = { class: "mwnf-sheet-related__line" }, W = ["href"], he = { key: 9 }, ge = { class: "mwnf-sheet-related__heading" }, _e = { class: "mwnf-sheet-related__line" }, ve = ["href"], ye = { key: 10 }, be = { class: "mwnf-sheet-related__heading" }, xe = "sheet.field.", G = {
43
- __name: "ItemDetailView",
44
- props: {
45
- spec: {
46
- type: Object,
47
- required: !0
48
- },
49
- id: {
50
- type: String,
51
- required: !0
52
- },
53
- entity: {
54
- type: String,
55
- default: ""
56
- },
57
- dataGetter: {
58
- type: Function,
59
- default: null
60
- }
61
- },
62
- setup(G) {
63
- let K = G, Se = ne(), Ce = /* @__PURE__ */ new Set([
64
- "before-sheet",
65
- "museum",
66
- "related",
67
- "aside"
68
- ]), we = u(() => Object.keys(Se).filter((e) => !Ce.has(e))), Te = u(() => !K.dataGetter || K.dataGetter(K.id) != null), { t: q } = ce();
69
- function Ee(e) {
70
- if (typeof e != "string" || !e.startsWith(xe)) return e;
71
- let t = `sheet.dxa.${e.slice(12)}`;
72
- return q(t) === t ? e : t;
73
- }
74
- let J = u(() => Array.isArray(K.spec.fields) ? {
75
- ...K.spec,
76
- fields: K.spec.fields.map((e) => ({
77
- ...e,
78
- label: Ee(e.label)
79
- }))
80
- } : K.spec), Y = le(), X = (e, t) => (e.name ?? "").localeCompare(t.name ?? ""), De = (e) => (e.gallery_references ?? []).filter((e) => e.kind === "gallery").sort(X), Oe = (e) => (e.gallery_references ?? []).filter((e) => e.kind === "exhibition").sort(X), Z = (e) => Y.links(e.project_id)?.artisticIntroductionUrl ?? null, Q = (e) => Y.links(e.project_id)?.relatedDatabaseUrl ?? null;
81
- function ke(e, t) {
82
- if (!e) return null;
83
- let n = J.value.sourceDatabase === !1 ? null : J.value.sourceDatabase ?? null, r = null;
84
- if (n) {
85
- let i = n.chipClass ? n.chipClass(e, t) : null, a = Y.label(e.project_id);
86
- (i || a) && (r = {
87
- chipClass: i,
88
- name: a,
89
- label: q(n.label ?? "record.sheet.sourceDatabase")
90
- });
91
- }
92
- let i = n && n.addToCollection !== !1 ? q(n.addToCollection?.label ?? "record.action.addToCollection") : null, a = J.value.notice === !1 ? null : J.value.notice ?? null, o = a && a.show(e, t) ? q(a.label) : null;
93
- return {
94
- source: r,
95
- addToCollectionLabel: i,
96
- notice: o
97
- };
98
- }
99
- let $ = se(), Ae = E("partners"), je = E("countries");
100
- ie(["partners", "countries"]), $.loadTranslations("countries", "en");
101
- function Me(e, t) {
102
- let n = $.tr("countries", e, t, "en");
103
- return ae(n.name ?? je.value?.get(e)?.internal_name ?? "");
104
- }
105
- function Ne(e) {
106
- let t = e.text?.holder ? D(String(e.text.holder)) : "", n = J.value.museum === !1 ? null : J.value.museum ?? null, r = n ? Ae.value?.get(e.record?.partner_id) : null;
107
- return {
108
- holder: t,
109
- view: r ? oe(r, $.tr("partners", r.id, e.language, "en"), {
110
- countryLabel: (t) => Me(t, e.language),
111
- route: (t) => n.route ? n.route(t.id, e) : null
112
- }) : null
113
- };
114
- }
115
- function Pe(e, t) {
116
- if (!e) return null;
117
- let n = J.value.related ?? {}, r = t.records ?? [], i = t.outside ?? [], a = K.dataGetter ? r.filter((e) => K.dataGetter(e.id) != null) : r, o = K.dataGetter ? r.filter((e) => K.dataGetter(e.id) == null).map((t) => (e.related_items ?? []).find((e) => e.id === t.id)).filter(Boolean) : [], s = [...i, ...o].map((e) => ({
118
- ...e,
119
- name: e.project_id ? Y.label(e.project_id) : null,
120
- chipClass: n.outsideChip ? n.outsideChip(e, t) : null
121
- })), c = (t) => (n.onDisplayIn?.href ? n.onDisplayIn.href(t, e) : t.legacy_host) || "", l = (e) => ({
122
- id: e.id,
123
- label: D(e.name ?? ""),
124
- href: c(e),
125
- external: !!c(e)
126
- }), u = n.onDisplayIn && n.onDisplayIn !== !1 ? {
127
- pendingLabel: n.onDisplayIn.linkPendingLabel ?? "",
128
- groups: [n.onDisplayIn.exhibitions ? {
129
- heading: n.onDisplayIn.exhibitionsHeading ?? "record.related.exhibitions",
130
- sections: n.onDisplayIn.exhibitions(e, t)
131
- } : {
132
- heading: n.onDisplayIn.exhibitionsHeading ?? "record.related.exhibitions",
133
- links: Oe(e).map(l)
134
- }, {
135
- heading: n.onDisplayIn.galleriesHeading ?? "record.related.galleries",
136
- links: De(e).map(l)
137
- }].filter((e) => (e.sections ?? [e]).some((e) => e.links?.length))
138
- } : null, d = n.databaseLabel && Q(e) ? {
139
- url: Q(e),
140
- label: q(n.databaseLabel),
141
- name: Y.label(e.project_id)
142
- } : null, f = n.overallDatabase && n.overallDatabase !== !1 ? {
143
- label: q(n.overallDatabase.label),
144
- linkLabel: q(n.overallDatabase.linkLabel)
145
- } : null;
146
- return {
147
- title: n.title ? q(n.title) : "",
148
- description: n.description ? q(n.description) : "",
149
- heading: q(n.heading ?? "record.related.items"),
150
- variant: n.variant ?? "grid",
151
- actionLabel: n.actionLabel ? q(n.actionLabel) : "",
152
- inPackage: a,
153
- references: s,
154
- notInPackageLabel: n.notInPackageLabel ? q(n.notInPackageLabel) : "",
155
- artisticIntroduction: n.artisticIntroductionLabel && Z(e) ? {
156
- url: Z(e),
157
- label: q(n.artisticIntroductionLabel)
158
- } : null,
159
- timeline: n.timeline ? n.timeline(e, t) : null,
160
- glossary: n.glossary !== !1,
161
- glossaryLabels: n.glossaryLabels ?? {},
162
- dynasties: n.dynasties ? n.dynasties(e, t.language, t) : null,
163
- dynastiesHeading: q(n.dynastiesHeading ?? "record.dynasty.list"),
164
- media: n.media === !1 ? [] : e.media ?? [],
165
- onDisplayIn: u,
166
- database: d,
167
- overallDatabase: f,
168
- download: n.download === !1 ? null : {
169
- label: q("record.action.download"),
170
- pdfLabel: q("record.action.downloadPdf")
171
- }
172
- };
173
- }
174
- let Fe = ue(), Ie = u(() => {
175
- let e = c(Fe.chrome, "world.png");
176
- return e ? { "--mwnf-dxa-glossary-image": `url("${e}")` } : null;
177
- });
178
- function Le() {
179
- window.print();
180
- }
181
- return (c, u) => Te.value ? (b(), d(s, {
182
- key: 0,
183
- spec: J.value,
184
- id: G.id,
185
- entity: G.entity,
186
- style: te(Ie.value)
187
- }, ee({
188
- "before-sheet": T((e) => [S(c.$slots, "before-sheet", y(_(e)), () => [(b(!0), p(l, null, x([ke(e.record, e)], (t) => (b(), p(l, { key: "before-sheet" }, [t?.source || t?.addToCollectionLabel ? (b(), p("div", k, [t.source ? (b(), p("p", A, [t.source.chipClass ? (b(), p("span", {
189
- key: 0,
190
- class: v(["mwnf-chip", t.source.chipClass]),
191
- "aria-hidden": "true"
192
- }, null, 2)) : f("", !0), t.source.name ? (b(), p(l, { key: 1 }, [h(C(t.source.label) + ": " + C(t.source.name), 1)], 64)) : f("", !0)])) : f("", !0), t.addToCollectionLabel ? (b(), p("p", j, [m("a", {
193
- href: w(O).myCollection,
194
- target: "_blank",
195
- rel: "noopener"
196
- }, "↗ " + C(t.addToCollectionLabel), 9, M)])) : f("", !0)])) : f("", !0), t?.notice ? (b(), p("div", N, [h(C(t.notice) + " ", 1), m("strong", null, [m("em", null, C(e.languages.map((e) => e.label).join(", ")), 1)])])) : f("", !0)], 64))), 128))])]),
197
- museum: T((e) => [S(c.$slots, "museum", y(_(e)), () => [(b(!0), p(l, null, x([Ne(e)], (t) => (b(), p("div", P, [t.holder ? (b(), p("p", {
198
- key: 0,
199
- class: "mwnf-sheet-museum__holder",
200
- innerHTML: t.holder
201
- }, null, 8, F)) : f("", !0), t.view ? (b(), d(a, {
202
- key: 1,
203
- variant: "summary",
204
- partner: t.view,
205
- label: "partner.info.about",
206
- dir: e.dir
207
- }, null, 8, ["partner", "dir"])) : f("", !0)]))), 128))])]),
208
- related: T(() => []),
209
- aside: T((a) => [S(c.$slots, "related", y(_(a)), () => [(b(!0), p(l, null, x([Pe(a.record, a)], (s) => (b(), p(l, { key: a.record?.id ?? "related" }, [s ? (b(), p("div", I, [
210
- s.title ? (b(), p("p", L, C(s.title), 1)) : f("", !0),
211
- s.description ? (b(), p("p", R, C(s.description), 1)) : f("", !0),
212
- s.inPackage.length || s.references.length ? (b(), d(o, {
213
- key: 2,
214
- heading: s.heading,
215
- records: s.inPackage,
216
- variant: s.variant,
217
- "action-label": s.actionLabel
218
- }, {
219
- default: T(() => [s.references.length ? (b(), p("ul", z, [(b(!0), p(l, null, x(s.references, (e) => (b(), p("li", { key: e.id }, [
220
- e.chipClass ? (b(), p("span", {
221
- key: 0,
222
- class: v(["mwnf-chip", e.chipClass]),
223
- "aria-hidden": "true"
224
- }, null, 2)) : f("", !0),
225
- e.name ? (b(), p(l, { key: 1 }, [h(C(e.name), 1)], 64)) : f("", !0),
226
- s.notInPackageLabel ? (b(), p("span", B, C(s.notInPackageLabel), 1)) : f("", !0)
227
- ]))), 128))])) : f("", !0)]),
228
- _: 2
229
- }, 1032, [
230
- "heading",
231
- "records",
232
- "variant",
233
- "action-label"
234
- ])) : f("", !0),
235
- s.artisticIntroduction ? (b(), p("p", V, [m("a", {
236
- href: s.artisticIntroduction.url,
237
- target: "_blank",
238
- rel: "noopener"
239
- }, "↗ " + C(s.artisticIntroduction.label), 9, H)])) : f("", !0),
240
- s.timeline ? (b(), d(r, {
241
- key: a.record.id,
242
- info: s.timeline
243
- }, null, 8, ["info"])) : f("", !0),
244
- s.glossary ? (b(), d(n, {
245
- key: 5,
246
- language: a.language,
247
- labels: s.glossaryLabels,
248
- dir: a.dir
249
- }, null, 8, [
250
- "language",
251
- "labels",
252
- "dir"
253
- ])) : f("", !0),
254
- s.dynasties?.records?.length ? (b(), d(e, {
255
- key: 6,
256
- heading: s.dynastiesHeading,
257
- dynasties: s.dynasties.records,
258
- tr: s.dynasties.tr,
259
- dir: a.dir
260
- }, null, 8, [
261
- "heading",
262
- "dynasties",
263
- "tr",
264
- "dir"
265
- ])) : f("", !0),
266
- g(t, {
267
- media: s.media,
268
- language: a.language,
269
- descriptions: !1,
270
- dir: a.dir
271
- }, null, 8, [
272
- "media",
273
- "language",
274
- "dir"
275
- ]),
276
- s.onDisplayIn?.groups.length ? (b(), p("div", U, [m("p", de, C(w(q)("record.related.onDisplayIn")), 1), g(i, {
277
- heading: "",
278
- groups: s.onDisplayIn.groups,
279
- "pending-label": s.onDisplayIn.pendingLabel,
280
- dir: a.dir
281
- }, null, 8, [
282
- "groups",
283
- "pending-label",
284
- "dir"
285
- ])])) : f("", !0),
286
- s.database ? (b(), p("div", fe, [m("p", pe, C(s.database.label), 1), m("p", me, [m("a", {
287
- href: s.database.url,
288
- target: "_blank",
289
- rel: "noopener"
290
- }, "↗ " + C(s.database.name), 9, W)])])) : f("", !0),
291
- s.overallDatabase ? (b(), p("div", he, [m("p", ge, C(s.overallDatabase.label), 1), m("p", _e, [m("a", {
292
- href: w(O).overallDatabase,
293
- target: "_blank",
294
- rel: "noopener"
295
- }, "↗ " + C(s.overallDatabase.linkLabel), 9, ve)])])) : f("", !0),
296
- s.download ? (b(), p("div", ye, [m("p", be, C(s.download.label), 1), m("p", {
297
- class: "mwnf-sheet-related__line mwnf-sheet-related__line--action",
298
- onClick: Le
299
- }, "➤ " + C(s.download.pdfLabel), 1)])) : f("", !0)
300
- ])) : f("", !0)], 64))), 128))])]),
301
- _: 2
302
- }, [x(we.value, (e) => ({
303
- name: e,
304
- fn: T((t) => [S(c.$slots, e, y(_(t)))])
305
- }))]), 1032, [
306
- "spec",
307
- "id",
308
- "entity",
309
- "style"
310
- ])) : (b(), d(w(re), { key: 1 }));
311
- }
312
- };
313
- export { G as t };