@museumwnf/viewer-layout 3.3.0 → 3.5.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/README.md +191 -12
- package/dist/{FeaturedRecord-BJ8LaWGP.js → FeaturedRecord-DJfyvfqt.js} +1 -1
- package/dist/GlossaryPopover-DcptyNWI.js +654 -0
- package/dist/ItemDetailView-COWC8GDg.js +299 -0
- package/dist/{OnDisplayIn-Dv8i7uvH.js → OnDisplayIn-BfJoPonn.js} +38 -38
- package/dist/RecordView-C9rP8TyQ.js +263 -0
- package/dist/SiteShell-4vV2jIzf.js +192 -0
- package/dist/{Theme-Db88mckV.js → Theme-CZ-OVXao.js} +26 -26
- package/dist/TimelineEventList-gsoc-SBx.js +841 -0
- package/dist/TimelineResultsView-C2-TnM71.js +1386 -0
- package/dist/chrome-DPuPeWzV.js +1141 -0
- package/dist/components.js +1 -1
- package/dist/{content-p0tqKkcD.js → content-CtwBcSjU.js} +2 -2
- package/dist/content.js +6 -5
- package/dist/data-CJlLA-Mf.js +38 -0
- package/dist/data-DTbAYdr2.js +40 -0
- package/dist/dxa.js +638 -519
- package/dist/index.js +7 -6
- package/dist/standalone.js +762 -0
- package/dist/{themeSpecs-C_uGarTs.js → themeSpecs-B885l456.js} +3 -2
- package/dist/viewer-layout.css +1 -1
- package/dist/views.js +5 -4
- package/package.json +4 -3
- package/src/dxa/testing.js +37 -14
- package/src/styles/dxa-exhibition.css +25 -1
- package/src/styles/dxa-gallery.css +249 -2
- package/src/tokens.reference.css +78 -0
- package/dist/ItemDetailView-CfUtRLOV.js +0 -284
- package/dist/PageShell-CbJ9lQoQ.js +0 -961
- package/dist/SiteShell-C3OgZO8p.js +0 -154
- package/dist/TimelineEventList-COjkXEzS.js +0 -1487
- package/dist/TimelineResultsView-CmHomvV_.js +0 -1636
- package/dist/data-BfyYB8ff.js +0 -33
- package/dist/data-G8uXeEfE.js +0 -35
|
@@ -0,0 +1,654 @@
|
|
|
1
|
+
import { Fragment as e, computed as t, createBlock as n, createCommentVNode as r, createElementBlock as i, createElementVNode as a, createTextVNode as o, createVNode as s, getCurrentInstance as c, mergeProps as l, normalizeClass as u, onBeforeUnmount as d, openBlock as f, ref as p, renderList as m, renderSlot as h, resolveDynamicComponent as g, toDisplayString as _, unref as v, useSlots as y, watch as b, withCtx as x, withModifiers as S } from "vue";
|
|
2
|
+
import { useI18n as C } from "@museumwnf/viewer-core/i18n";
|
|
3
|
+
import { sourceUrl as w } from "@museumwnf/viewer-core";
|
|
4
|
+
import { useRoute as T } from "vue-router";
|
|
5
|
+
//#region src/content/SmartLink.vue
|
|
6
|
+
var E = [
|
|
7
|
+
"href",
|
|
8
|
+
"target",
|
|
9
|
+
"rel"
|
|
10
|
+
], D = {
|
|
11
|
+
__name: "SmartLink",
|
|
12
|
+
props: {
|
|
13
|
+
to: {
|
|
14
|
+
type: [String, Object],
|
|
15
|
+
default: null
|
|
16
|
+
},
|
|
17
|
+
href: {
|
|
18
|
+
type: String,
|
|
19
|
+
default: ""
|
|
20
|
+
},
|
|
21
|
+
external: {
|
|
22
|
+
type: Boolean,
|
|
23
|
+
default: !1
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
setup(e) {
|
|
27
|
+
let r = e, a = /^[a-z][a-z0-9+.-]*:/i, o = c()?.appContext.components.RouterLink ?? null, s = t(() => typeof r.to == "string" && a.test(r.to)), u = t(() => !!(r.to && o && !s.value)), d = t(() => r.href || (typeof r.to == "string" ? r.to : ""));
|
|
28
|
+
return (t, r) => u.value ? (f(), n(g(v(o)), l({
|
|
29
|
+
key: 0,
|
|
30
|
+
to: e.to
|
|
31
|
+
}, t.$attrs), {
|
|
32
|
+
default: x(() => [h(t.$slots, "default")]),
|
|
33
|
+
_: 3
|
|
34
|
+
}, 16, ["to"])) : (f(), i("a", l({
|
|
35
|
+
key: 1,
|
|
36
|
+
href: d.value || void 0,
|
|
37
|
+
target: e.external ? "_blank" : void 0,
|
|
38
|
+
rel: e.external ? "noopener" : void 0
|
|
39
|
+
}, t.$attrs), [h(t.$slots, "default")], 16, E));
|
|
40
|
+
}
|
|
41
|
+
}, O = ["aria-busy"], k = {
|
|
42
|
+
key: 0,
|
|
43
|
+
class: "mwnf-list__status"
|
|
44
|
+
}, ee = {
|
|
45
|
+
key: 1,
|
|
46
|
+
class: "mwnf-list__rows"
|
|
47
|
+
}, te = { class: "mwnf-list__thumb" }, A = ["src", "alt"], j = { class: "mwnf-list__body" }, M = ["innerHTML"], N = {
|
|
48
|
+
key: 0,
|
|
49
|
+
class: "mwnf-list__meta"
|
|
50
|
+
}, P = {
|
|
51
|
+
key: 0,
|
|
52
|
+
class: "mwnf-list__badge"
|
|
53
|
+
}, F = {
|
|
54
|
+
key: 2,
|
|
55
|
+
class: "mwnf-list__empty"
|
|
56
|
+
}, I = {
|
|
57
|
+
__name: "RecordList",
|
|
58
|
+
props: {
|
|
59
|
+
records: {
|
|
60
|
+
type: Array,
|
|
61
|
+
default: () => []
|
|
62
|
+
},
|
|
63
|
+
loading: {
|
|
64
|
+
type: Boolean,
|
|
65
|
+
default: !1
|
|
66
|
+
},
|
|
67
|
+
loadingText: {
|
|
68
|
+
type: String,
|
|
69
|
+
default: ""
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
setup(t) {
|
|
73
|
+
let n = !!y().empty;
|
|
74
|
+
return (o, c) => (f(), i("div", {
|
|
75
|
+
class: u(["mwnf-list", { "mwnf-list--loading": t.loading }]),
|
|
76
|
+
"aria-busy": t.loading ? "true" : void 0
|
|
77
|
+
}, [t.loading && t.loadingText ? (f(), i("p", k, _(t.loadingText), 1)) : t.records.length ? (f(), i("ul", ee, [(f(!0), i(e, null, m(t.records, (t) => (f(), i("li", {
|
|
78
|
+
key: t.id,
|
|
79
|
+
class: "mwnf-list__row"
|
|
80
|
+
}, [s(D, {
|
|
81
|
+
class: "mwnf-list__link",
|
|
82
|
+
to: t.to,
|
|
83
|
+
href: t.href
|
|
84
|
+
}, {
|
|
85
|
+
default: x(() => [a("span", te, [t.image ? (f(), i("img", {
|
|
86
|
+
key: 0,
|
|
87
|
+
src: t.image,
|
|
88
|
+
alt: t.imageAlt ?? "",
|
|
89
|
+
loading: "lazy"
|
|
90
|
+
}, null, 8, A)) : r("", !0)]), a("span", j, [a("span", {
|
|
91
|
+
class: "mwnf-list__name",
|
|
92
|
+
innerHTML: t.name
|
|
93
|
+
}, null, 8, M), t.meta?.length || t.badge ? (f(), i("span", N, [(f(!0), i(e, null, m(t.meta ?? [], (e, t) => (f(), i("span", {
|
|
94
|
+
key: t,
|
|
95
|
+
class: "mwnf-list__meta-item"
|
|
96
|
+
}, _(e), 1))), 128)), t.badge ? (f(), i("span", P, _(t.badge), 1)) : r("", !0)])) : r("", !0)])]),
|
|
97
|
+
_: 2
|
|
98
|
+
}, 1032, ["to", "href"])]))), 128))])) : v(n) ? (f(), i("div", F, [h(o.$slots, "empty")])) : r("", !0)], 10, O));
|
|
99
|
+
}
|
|
100
|
+
}, L = ["aria-busy"], R = {
|
|
101
|
+
key: 0,
|
|
102
|
+
class: "mwnf-grid__status"
|
|
103
|
+
}, z = {
|
|
104
|
+
key: 1,
|
|
105
|
+
class: "mwnf-grid__tiles"
|
|
106
|
+
}, B = ["onMouseenter", "onFocusin"], V = { class: "mwnf-grid__media" }, H = ["src", "alt"], U = {
|
|
107
|
+
key: 1,
|
|
108
|
+
class: "mwnf-grid__image mwnf-grid__image--empty",
|
|
109
|
+
"aria-hidden": "true"
|
|
110
|
+
}, W = { class: "mwnf-grid__card" }, G = ["src"], K = { class: "mwnf-grid__card-body" }, q = ["innerHTML"], J = {
|
|
111
|
+
key: 0,
|
|
112
|
+
class: "mwnf-grid__badge"
|
|
113
|
+
}, Y = {
|
|
114
|
+
key: 2,
|
|
115
|
+
class: "mwnf-grid__empty"
|
|
116
|
+
}, X = {
|
|
117
|
+
__name: "RecordGrid",
|
|
118
|
+
props: {
|
|
119
|
+
records: {
|
|
120
|
+
type: Array,
|
|
121
|
+
default: () => []
|
|
122
|
+
},
|
|
123
|
+
loading: {
|
|
124
|
+
type: Boolean,
|
|
125
|
+
default: !1
|
|
126
|
+
},
|
|
127
|
+
loadingText: {
|
|
128
|
+
type: String,
|
|
129
|
+
default: ""
|
|
130
|
+
},
|
|
131
|
+
actionLabel: {
|
|
132
|
+
type: String,
|
|
133
|
+
default: ""
|
|
134
|
+
},
|
|
135
|
+
dateCutoff: {
|
|
136
|
+
type: Number,
|
|
137
|
+
default: 80
|
|
138
|
+
}
|
|
139
|
+
},
|
|
140
|
+
setup(t) {
|
|
141
|
+
let n = t, c = !!y().empty, l = p(null);
|
|
142
|
+
function d(e) {
|
|
143
|
+
let t = String(e ?? "");
|
|
144
|
+
return t.length > n.dateCutoff ? `${t.slice(0, n.dateCutoff - 1)}[...]` : t;
|
|
145
|
+
}
|
|
146
|
+
return (n, p) => (f(), i("div", {
|
|
147
|
+
class: u(["mwnf-grid", { "mwnf-grid--loading": t.loading }]),
|
|
148
|
+
"aria-busy": t.loading ? "true" : void 0
|
|
149
|
+
}, [t.loading && t.loadingText ? (f(), i("p", R, _(t.loadingText), 1)) : t.records.length ? (f(), i("ul", z, [(f(!0), i(e, null, m(t.records, (n) => (f(), i("li", {
|
|
150
|
+
key: n.id,
|
|
151
|
+
class: u(["mwnf-grid__tile", { "mwnf-grid__tile--hover": l.value === n.id }]),
|
|
152
|
+
onMouseenter: (e) => l.value = n.id,
|
|
153
|
+
onMouseleave: p[0] ||= (e) => l.value = null,
|
|
154
|
+
onFocusin: (e) => l.value = n.id,
|
|
155
|
+
onFocusout: p[1] ||= (e) => l.value = null
|
|
156
|
+
}, [a("span", V, [n.image ? (f(), i("img", {
|
|
157
|
+
key: 0,
|
|
158
|
+
class: "mwnf-grid__image",
|
|
159
|
+
src: n.image,
|
|
160
|
+
alt: n.imageAlt ?? "",
|
|
161
|
+
loading: "lazy"
|
|
162
|
+
}, null, 8, H)) : (f(), i("span", U))]), a("div", W, [s(D, {
|
|
163
|
+
class: "mwnf-grid__card-media",
|
|
164
|
+
to: n.to,
|
|
165
|
+
href: n.href,
|
|
166
|
+
tabindex: "-1",
|
|
167
|
+
"aria-hidden": "true"
|
|
168
|
+
}, {
|
|
169
|
+
default: x(() => [n.image ? (f(), i("img", {
|
|
170
|
+
key: 0,
|
|
171
|
+
src: n.image,
|
|
172
|
+
alt: ""
|
|
173
|
+
}, null, 8, G)) : r("", !0)]),
|
|
174
|
+
_: 2
|
|
175
|
+
}, 1032, ["to", "href"]), a("div", K, [
|
|
176
|
+
a("p", {
|
|
177
|
+
class: "mwnf-grid__name",
|
|
178
|
+
innerHTML: n.name
|
|
179
|
+
}, null, 8, q),
|
|
180
|
+
(f(!0), i(e, null, m(n.meta ?? [], (e, t) => (f(), i("p", {
|
|
181
|
+
key: t,
|
|
182
|
+
class: "mwnf-grid__meta"
|
|
183
|
+
}, _(d(e)), 1))), 128)),
|
|
184
|
+
n.badge ? (f(), i("p", J, _(n.badge), 1)) : r("", !0),
|
|
185
|
+
s(D, {
|
|
186
|
+
class: "mwnf-grid__action",
|
|
187
|
+
to: n.to,
|
|
188
|
+
href: n.href
|
|
189
|
+
}, {
|
|
190
|
+
default: x(() => [o(_(t.actionLabel || n.name.replace(/<[^>]+>/g, "")) + " › ", 1)]),
|
|
191
|
+
_: 2
|
|
192
|
+
}, 1032, ["to", "href"])
|
|
193
|
+
])])], 42, B))), 128))])) : v(c) ? (f(), i("div", Y, [h(n.$slots, "empty")])) : r("", !0)], 10, L));
|
|
194
|
+
}
|
|
195
|
+
}, Z = ["aria-label"], Q = [
|
|
196
|
+
"aria-pressed",
|
|
197
|
+
"lang",
|
|
198
|
+
"onClick"
|
|
199
|
+
], ne = {
|
|
200
|
+
__name: "RecordLanguages",
|
|
201
|
+
props: {
|
|
202
|
+
languages: {
|
|
203
|
+
type: Array,
|
|
204
|
+
default: () => []
|
|
205
|
+
},
|
|
206
|
+
language: {
|
|
207
|
+
type: String,
|
|
208
|
+
default: ""
|
|
209
|
+
}
|
|
210
|
+
},
|
|
211
|
+
emits: ["select"],
|
|
212
|
+
setup(n, { emit: a }) {
|
|
213
|
+
let o = n, s = a, { t: c } = C(), l = t(() => o.languages.map((e) => typeof e == "string" ? {
|
|
214
|
+
code: e,
|
|
215
|
+
label: e.toUpperCase()
|
|
216
|
+
} : e));
|
|
217
|
+
return (t, a) => l.value.length > 1 ? (f(), i("div", {
|
|
218
|
+
key: 0,
|
|
219
|
+
class: "mwnf-languages",
|
|
220
|
+
role: "group",
|
|
221
|
+
"aria-label": v(c)("record.sheet.languages")
|
|
222
|
+
}, [(f(!0), i(e, null, m(l.value, (e) => (f(), i("button", {
|
|
223
|
+
key: e.code,
|
|
224
|
+
type: "button",
|
|
225
|
+
class: u(["mwnf-languages__button", { "mwnf-languages__button--active": e.code === n.language }]),
|
|
226
|
+
"aria-pressed": e.code === n.language ? "true" : "false",
|
|
227
|
+
lang: e.code,
|
|
228
|
+
onClick: (t) => s("select", e.code)
|
|
229
|
+
}, _(e.label), 11, Q))), 128))], 8, Z)) : r("", !0);
|
|
230
|
+
}
|
|
231
|
+
}, re = ["dir"], ie = { key: 0 }, ae = {
|
|
232
|
+
class: "mwnf-sheet__label",
|
|
233
|
+
scope: "row"
|
|
234
|
+
}, oe = { class: "mwnf-sheet__value" }, se = ["href"], ce = ["innerHTML"], le = {
|
|
235
|
+
key: 0,
|
|
236
|
+
class: "mwnf-sheet__row mwnf-sheet__row--short"
|
|
237
|
+
}, ue = {
|
|
238
|
+
class: "mwnf-sheet__label",
|
|
239
|
+
scope: "row"
|
|
240
|
+
}, de = ["aria-expanded"], fe = { class: "mwnf-sheet__value" }, pe = ["innerHTML"], me = { class: "mwnf-sheet__value" }, he = ["href"], ge = ["innerHTML"], _e = { class: "mwnf-sheet__label mwnf-sheet__label--short" }, ve = ["aria-expanded"], ye = { class: "mwnf-sheet__value" }, be = ["innerHTML"], xe = {
|
|
241
|
+
__name: "RecordSheet",
|
|
242
|
+
props: {
|
|
243
|
+
rows: {
|
|
244
|
+
type: Array,
|
|
245
|
+
default: () => []
|
|
246
|
+
},
|
|
247
|
+
layout: {
|
|
248
|
+
type: String,
|
|
249
|
+
default: "table"
|
|
250
|
+
},
|
|
251
|
+
dir: {
|
|
252
|
+
type: String,
|
|
253
|
+
default: ""
|
|
254
|
+
},
|
|
255
|
+
shortDescription: {
|
|
256
|
+
type: Object,
|
|
257
|
+
default: null
|
|
258
|
+
},
|
|
259
|
+
shortDescriptionAfter: {
|
|
260
|
+
type: String,
|
|
261
|
+
default: "description"
|
|
262
|
+
},
|
|
263
|
+
shortDescriptionOpen: {
|
|
264
|
+
type: Boolean,
|
|
265
|
+
default: !1
|
|
266
|
+
}
|
|
267
|
+
},
|
|
268
|
+
setup(t) {
|
|
269
|
+
let o = t, { t: s } = C(), c = p(o.shortDescriptionOpen);
|
|
270
|
+
b(() => o.shortDescription, () => {
|
|
271
|
+
c.value = o.shortDescriptionOpen;
|
|
272
|
+
});
|
|
273
|
+
let l = (e) => e.render === "custom" || e.render === "link";
|
|
274
|
+
return (o, d) => (f(), i("div", {
|
|
275
|
+
class: u(["mwnf-sheet", `mwnf-sheet--${t.layout}`]),
|
|
276
|
+
dir: t.dir || void 0
|
|
277
|
+
}, [(f(), n(g(t.layout === "list" ? "dl" : "table"), { class: "mwnf-sheet__rows" }, {
|
|
278
|
+
default: x(() => [t.layout === "list" ? (f(!0), i(e, { key: 1 }, m(t.rows, (n) => (f(), i(e, { key: n.key }, [
|
|
279
|
+
a("dt", { class: u(["mwnf-sheet__label", `mwnf-sheet__label--${n.key}`]) }, _(n.label), 3),
|
|
280
|
+
a("dd", me, [l(n) ? h(o.$slots, n.key, { row: n }, () => [n.render === "link" ? (f(), i("a", {
|
|
281
|
+
key: 0,
|
|
282
|
+
href: n.value,
|
|
283
|
+
target: "_blank",
|
|
284
|
+
rel: "noopener"
|
|
285
|
+
}, _(n.value), 9, he)) : r("", !0)], void 0, 0) : (f(), i("span", {
|
|
286
|
+
key: 1,
|
|
287
|
+
class: u(`mwnf-sheet__${n.render}`),
|
|
288
|
+
innerHTML: n.html
|
|
289
|
+
}, null, 10, ge))]),
|
|
290
|
+
t.shortDescription && n.key === t.shortDescriptionAfter ? (f(), i(e, { key: 0 }, [a("dt", _e, [a("button", {
|
|
291
|
+
type: "button",
|
|
292
|
+
class: "mwnf-sheet__toggle",
|
|
293
|
+
"aria-expanded": c.value ? "true" : "false",
|
|
294
|
+
onClick: d[1] ||= (e) => c.value = !c.value
|
|
295
|
+
}, _(c.value ? v(s)("record.action.hideShortDescription") : v(s)("record.action.viewShortDescription")), 9, ve)]), a("dd", ye, [c.value ? (f(), i("div", {
|
|
296
|
+
key: 0,
|
|
297
|
+
class: "mwnf-sheet__block",
|
|
298
|
+
innerHTML: t.shortDescription.html
|
|
299
|
+
}, null, 8, be)) : r("", !0)])], 64)) : r("", !0)
|
|
300
|
+
], 64))), 128)) : (f(), i("tbody", ie, [(f(!0), i(e, null, m(t.rows, (n) => (f(), i(e, { key: n.key }, [a("tr", { class: u(["mwnf-sheet__row", `mwnf-sheet__row--${n.key}`]) }, [a("th", ae, _(n.label), 1), a("td", oe, [l(n) ? h(o.$slots, n.key, { row: n }, () => [n.render === "link" ? (f(), i("a", {
|
|
301
|
+
key: 0,
|
|
302
|
+
href: n.value,
|
|
303
|
+
target: "_blank",
|
|
304
|
+
rel: "noopener"
|
|
305
|
+
}, _(n.value), 9, se)) : r("", !0)], void 0, 0) : (f(), i("span", {
|
|
306
|
+
key: 1,
|
|
307
|
+
class: u(`mwnf-sheet__${n.render}`),
|
|
308
|
+
innerHTML: n.html
|
|
309
|
+
}, null, 10, ce))])], 2), t.shortDescription && n.key === t.shortDescriptionAfter ? (f(), i("tr", le, [a("th", ue, [a("button", {
|
|
310
|
+
type: "button",
|
|
311
|
+
class: "mwnf-sheet__toggle",
|
|
312
|
+
"aria-expanded": c.value ? "true" : "false",
|
|
313
|
+
onClick: d[0] ||= (e) => c.value = !c.value
|
|
314
|
+
}, _(c.value ? v(s)("record.action.hideShortDescription") : v(s)("record.action.viewShortDescription")), 9, de)]), a("td", fe, [c.value ? (f(), i("div", {
|
|
315
|
+
key: 0,
|
|
316
|
+
class: "mwnf-sheet__block",
|
|
317
|
+
innerHTML: t.shortDescription.html
|
|
318
|
+
}, null, 8, pe)) : r("", !0)])])) : r("", !0)], 64))), 128))]))]),
|
|
319
|
+
_: 3
|
|
320
|
+
}))], 10, re));
|
|
321
|
+
}
|
|
322
|
+
}, Se = ["dir"], Ce = {
|
|
323
|
+
key: 0,
|
|
324
|
+
class: "mwnf-sheet-section__heading"
|
|
325
|
+
}, we = ["innerHTML"], Te = {
|
|
326
|
+
__name: "SheetSection",
|
|
327
|
+
props: {
|
|
328
|
+
heading: {
|
|
329
|
+
type: String,
|
|
330
|
+
default: ""
|
|
331
|
+
},
|
|
332
|
+
html: {
|
|
333
|
+
type: String,
|
|
334
|
+
default: ""
|
|
335
|
+
},
|
|
336
|
+
dir: {
|
|
337
|
+
type: String,
|
|
338
|
+
default: ""
|
|
339
|
+
}
|
|
340
|
+
},
|
|
341
|
+
setup(e) {
|
|
342
|
+
return (t, n) => (f(), i("section", {
|
|
343
|
+
class: "mwnf-sheet-section",
|
|
344
|
+
dir: e.dir || void 0
|
|
345
|
+
}, [
|
|
346
|
+
e.heading ? (f(), i("h2", Ce, _(e.heading), 1)) : r("", !0),
|
|
347
|
+
e.html ? (f(), i("div", {
|
|
348
|
+
key: 1,
|
|
349
|
+
class: "mwnf-sheet-section__body mwnf-sheet__block",
|
|
350
|
+
innerHTML: e.html
|
|
351
|
+
}, null, 8, we)) : r("", !0),
|
|
352
|
+
h(t.$slots, "default")
|
|
353
|
+
], 8, Se));
|
|
354
|
+
}
|
|
355
|
+
}, Ee = {
|
|
356
|
+
key: 0,
|
|
357
|
+
class: "mwnf-credits"
|
|
358
|
+
}, De = {
|
|
359
|
+
key: 0,
|
|
360
|
+
class: "mwnf-credits__heading"
|
|
361
|
+
}, Oe = {
|
|
362
|
+
key: 1,
|
|
363
|
+
class: "mwnf-credits__list"
|
|
364
|
+
}, ke = { class: "mwnf-credits__label" }, Ae = { class: "mwnf-credits__value" }, je = {
|
|
365
|
+
key: 2,
|
|
366
|
+
class: "mwnf-credits__number"
|
|
367
|
+
}, Me = {
|
|
368
|
+
key: 0,
|
|
369
|
+
class: "mwnf-credits__label"
|
|
370
|
+
}, Ne = { class: "mwnf-credits__heading" }, Pe = { class: "mwnf-credits__citation" }, Fe = {
|
|
371
|
+
__name: "RecordCredits",
|
|
372
|
+
props: {
|
|
373
|
+
credits: {
|
|
374
|
+
type: Array,
|
|
375
|
+
default: () => []
|
|
376
|
+
},
|
|
377
|
+
workingNumber: {
|
|
378
|
+
type: String,
|
|
379
|
+
default: ""
|
|
380
|
+
},
|
|
381
|
+
workingNumberLabel: {
|
|
382
|
+
type: String,
|
|
383
|
+
default: ""
|
|
384
|
+
},
|
|
385
|
+
citation: {
|
|
386
|
+
type: String,
|
|
387
|
+
default: ""
|
|
388
|
+
},
|
|
389
|
+
heading: {
|
|
390
|
+
type: String,
|
|
391
|
+
default: ""
|
|
392
|
+
},
|
|
393
|
+
citationHeading: {
|
|
394
|
+
type: String,
|
|
395
|
+
default: ""
|
|
396
|
+
}
|
|
397
|
+
},
|
|
398
|
+
setup(n) {
|
|
399
|
+
let o = n, { t: s } = C(), c = t(() => o.credits.length > 0 || o.workingNumber || o.citation);
|
|
400
|
+
return (t, o) => c.value ? (f(), i("section", Ee, [
|
|
401
|
+
n.credits.length || n.workingNumber ? (f(), i("h2", De, _(n.heading || v(s)("record.sheet.credits")), 1)) : r("", !0),
|
|
402
|
+
n.credits.length ? (f(), i("dl", Oe, [(f(!0), i(e, null, m(n.credits, (t) => (f(), i(e, { key: t.label }, [a("dt", ke, _(t.label), 1), a("dd", Ae, _(t.value), 1)], 64))), 128))])) : r("", !0),
|
|
403
|
+
n.workingNumber ? (f(), i("p", je, [n.workingNumberLabel ? (f(), i("span", Me, _(n.workingNumberLabel), 1)) : r("", !0), a("strong", null, _(n.workingNumber), 1)])) : r("", !0),
|
|
404
|
+
n.citation ? (f(), i(e, { key: 3 }, [a("h2", Ne, _(n.citationHeading || v(s)("record.citation.heading")), 1), a("p", Pe, _(n.citation), 1)], 64)) : r("", !0)
|
|
405
|
+
])) : r("", !0);
|
|
406
|
+
}
|
|
407
|
+
}, Ie = {
|
|
408
|
+
key: 0,
|
|
409
|
+
class: "mwnf-source-credit"
|
|
410
|
+
}, Le = { class: "mwnf-source-credit__label" }, Re = ["href"], ze = {
|
|
411
|
+
__name: "SourceCredit",
|
|
412
|
+
props: {
|
|
413
|
+
route: {
|
|
414
|
+
type: [Object, String],
|
|
415
|
+
default: null
|
|
416
|
+
},
|
|
417
|
+
labelEntry: {
|
|
418
|
+
type: String,
|
|
419
|
+
default: "record.source.label"
|
|
420
|
+
}
|
|
421
|
+
},
|
|
422
|
+
setup(e) {
|
|
423
|
+
let n = e, { t: s } = C(), c = T(), l = t(() => w(n.route ?? c));
|
|
424
|
+
return (t, n) => l.value ? (f(), i("p", Ie, [
|
|
425
|
+
a("span", Le, _(v(s)(e.labelEntry)), 1),
|
|
426
|
+
n[0] ||= o(),
|
|
427
|
+
a("a", { href: l.value }, _(l.value), 9, Re)
|
|
428
|
+
])) : r("", !0);
|
|
429
|
+
}
|
|
430
|
+
}, Be = {
|
|
431
|
+
key: 0,
|
|
432
|
+
class: "mwnf-related"
|
|
433
|
+
}, Ve = {
|
|
434
|
+
key: 0,
|
|
435
|
+
class: "mwnf-related__heading"
|
|
436
|
+
}, He = {
|
|
437
|
+
__name: "RelatedRecords",
|
|
438
|
+
props: {
|
|
439
|
+
heading: {
|
|
440
|
+
type: String,
|
|
441
|
+
default: ""
|
|
442
|
+
},
|
|
443
|
+
records: {
|
|
444
|
+
type: Array,
|
|
445
|
+
default: () => []
|
|
446
|
+
},
|
|
447
|
+
variant: {
|
|
448
|
+
type: String,
|
|
449
|
+
default: "list"
|
|
450
|
+
},
|
|
451
|
+
actionLabel: {
|
|
452
|
+
type: String,
|
|
453
|
+
default: ""
|
|
454
|
+
}
|
|
455
|
+
},
|
|
456
|
+
setup(e) {
|
|
457
|
+
return (t, a) => e.records.length || t.$slots.default ? (f(), i("section", Be, [
|
|
458
|
+
e.heading ? (f(), i("h2", Ve, _(e.heading), 1)) : r("", !0),
|
|
459
|
+
e.variant === "grid" ? (f(), n(X, {
|
|
460
|
+
key: 1,
|
|
461
|
+
records: e.records,
|
|
462
|
+
"action-label": e.actionLabel
|
|
463
|
+
}, null, 8, ["records", "action-label"])) : (f(), n(I, {
|
|
464
|
+
key: 2,
|
|
465
|
+
records: e.records
|
|
466
|
+
}, null, 8, ["records"])),
|
|
467
|
+
h(t.$slots, "default")
|
|
468
|
+
])) : r("", !0);
|
|
469
|
+
}
|
|
470
|
+
}, Ue = ["src", "alt"], We = {
|
|
471
|
+
key: 0,
|
|
472
|
+
class: "mwnf-media__caption"
|
|
473
|
+
}, Ge = { key: 0 }, Ke = {
|
|
474
|
+
key: 1,
|
|
475
|
+
class: "mwnf-media__credit"
|
|
476
|
+
}, qe = {
|
|
477
|
+
key: 2,
|
|
478
|
+
class: "mwnf-media__credit"
|
|
479
|
+
}, Je = ["src", "alt"], Ye = {
|
|
480
|
+
key: 0,
|
|
481
|
+
class: "mwnf-media__thumbs"
|
|
482
|
+
}, Xe = [
|
|
483
|
+
"aria-pressed",
|
|
484
|
+
"title",
|
|
485
|
+
"onClick"
|
|
486
|
+
], Ze = ["src", "alt"], Qe = {
|
|
487
|
+
key: 1,
|
|
488
|
+
class: "mwnf-media__caption"
|
|
489
|
+
}, $e = { key: 0 }, et = {
|
|
490
|
+
key: 1,
|
|
491
|
+
class: "mwnf-media__credit"
|
|
492
|
+
}, tt = ["aria-label"], $ = ["aria-label"], nt = ["src", "alt"], rt = ["aria-label"], it = {
|
|
493
|
+
__name: "MediaGallery",
|
|
494
|
+
props: {
|
|
495
|
+
images: {
|
|
496
|
+
type: Array,
|
|
497
|
+
default: () => []
|
|
498
|
+
},
|
|
499
|
+
start: {
|
|
500
|
+
type: Number,
|
|
501
|
+
default: 0
|
|
502
|
+
},
|
|
503
|
+
variant: {
|
|
504
|
+
type: String,
|
|
505
|
+
default: ""
|
|
506
|
+
}
|
|
507
|
+
},
|
|
508
|
+
setup(n) {
|
|
509
|
+
let o = n, { t: s } = C(), c = p(Math.min(o.start, Math.max(0, o.images.length - 1)));
|
|
510
|
+
b(() => o.images, () => {
|
|
511
|
+
c.value = 0;
|
|
512
|
+
});
|
|
513
|
+
let l = t(() => o.images[c.value] ?? null), h = t(() => {
|
|
514
|
+
let e = [];
|
|
515
|
+
return l.value?.photographer && e.push(`${s("record.media.photograph")}: ${l.value.photographer}`), l.value?.copyright && e.push(`© ${l.value.copyright}`), e.join(" — ");
|
|
516
|
+
}), g = p(!1), y = null, x = p(null);
|
|
517
|
+
function w(e) {
|
|
518
|
+
c.value = (e + o.images.length) % o.images.length;
|
|
519
|
+
}
|
|
520
|
+
function T() {
|
|
521
|
+
l.value && (y = document.activeElement, g.value = !0, document.addEventListener("keydown", D), requestAnimationFrame(() => x.value?.focus?.()));
|
|
522
|
+
}
|
|
523
|
+
function E() {
|
|
524
|
+
g.value = !1, document.removeEventListener("keydown", D), y?.focus?.(), y = null;
|
|
525
|
+
}
|
|
526
|
+
function D(e) {
|
|
527
|
+
e.key === "Escape" ? E() : e.key === "ArrowRight" ? w(c.value + 1) : e.key === "ArrowLeft" && w(c.value - 1);
|
|
528
|
+
}
|
|
529
|
+
return d(() => document.removeEventListener("keydown", D)), (t, o) => n.images.length ? (f(), i("div", {
|
|
530
|
+
key: 0,
|
|
531
|
+
class: u(["mwnf-media", n.variant ? `mwnf-media--${n.variant}` : ""])
|
|
532
|
+
}, [n.variant === "row" ? (f(!0), i(e, { key: 0 }, m(n.images, (e, t) => (f(), i("figure", {
|
|
533
|
+
key: e.url ?? t,
|
|
534
|
+
class: "mwnf-media__figure"
|
|
535
|
+
}, [a("img", {
|
|
536
|
+
class: "mwnf-media__image",
|
|
537
|
+
src: e.url,
|
|
538
|
+
alt: e.alt ?? "",
|
|
539
|
+
loading: "lazy"
|
|
540
|
+
}, null, 8, Ue), e.caption || e.photographer || e.copyright ? (f(), i("figcaption", We, [
|
|
541
|
+
e.caption ? (f(), i("span", Ge, _(e.caption), 1)) : r("", !0),
|
|
542
|
+
e.photographer ? (f(), i("span", Ke, _(v(s)("record.media.photograph")) + ": " + _(e.photographer), 1)) : r("", !0),
|
|
543
|
+
e.copyright ? (f(), i("span", qe, "© " + _(e.copyright), 1)) : r("", !0)
|
|
544
|
+
])) : r("", !0)]))), 128)) : (f(), i(e, { key: 1 }, [
|
|
545
|
+
a("button", {
|
|
546
|
+
type: "button",
|
|
547
|
+
class: "mwnf-media__main",
|
|
548
|
+
onClick: T
|
|
549
|
+
}, [a("img", {
|
|
550
|
+
class: "mwnf-media__image",
|
|
551
|
+
src: l.value.url,
|
|
552
|
+
alt: l.value.alt ?? ""
|
|
553
|
+
}, null, 8, Je)]),
|
|
554
|
+
n.images.length > 1 ? (f(), i("ul", Ye, [(f(!0), i(e, null, m(n.images, (e, t) => (f(), i("li", { key: e.url ?? t }, [a("button", {
|
|
555
|
+
type: "button",
|
|
556
|
+
class: u(["mwnf-media__thumb", { "mwnf-media__thumb--active": t === c.value }]),
|
|
557
|
+
"aria-pressed": t === c.value ? "true" : "false",
|
|
558
|
+
title: [e.photographer, e.copyright].filter(Boolean).join(" — ") || void 0,
|
|
559
|
+
onClick: (e) => w(t)
|
|
560
|
+
}, [a("img", {
|
|
561
|
+
src: e.url,
|
|
562
|
+
alt: e.alt ?? "",
|
|
563
|
+
loading: "lazy"
|
|
564
|
+
}, null, 8, Ze)], 10, Xe)]))), 128))])) : r("", !0),
|
|
565
|
+
l.value.caption || h.value ? (f(), i("p", Qe, [l.value.caption ? (f(), i("span", $e, _(l.value.caption), 1)) : r("", !0), h.value ? (f(), i("span", et, _(h.value), 1)) : r("", !0)])) : r("", !0),
|
|
566
|
+
g.value ? (f(), i("div", {
|
|
567
|
+
key: 2,
|
|
568
|
+
class: "mwnf-lightbox",
|
|
569
|
+
role: "dialog",
|
|
570
|
+
"aria-modal": "true",
|
|
571
|
+
onClick: S(E, ["self"])
|
|
572
|
+
}, [
|
|
573
|
+
a("button", {
|
|
574
|
+
ref_key: "closeButton",
|
|
575
|
+
ref: x,
|
|
576
|
+
type: "button",
|
|
577
|
+
class: "mwnf-lightbox__close",
|
|
578
|
+
"aria-label": v(s)("core.action.close"),
|
|
579
|
+
onClick: E
|
|
580
|
+
}, "✕", 8, tt),
|
|
581
|
+
n.images.length > 1 ? (f(), i("button", {
|
|
582
|
+
key: 0,
|
|
583
|
+
type: "button",
|
|
584
|
+
class: "mwnf-lightbox__control mwnf-lightbox__control--previous",
|
|
585
|
+
"aria-label": v(s)("core.pagination.previous"),
|
|
586
|
+
onClick: o[0] ||= S((e) => w(c.value - 1), ["stop"])
|
|
587
|
+
}, "‹", 8, $)) : r("", !0),
|
|
588
|
+
a("img", {
|
|
589
|
+
class: "mwnf-lightbox__image",
|
|
590
|
+
src: l.value.url,
|
|
591
|
+
alt: l.value.alt ?? ""
|
|
592
|
+
}, null, 8, nt),
|
|
593
|
+
n.images.length > 1 ? (f(), i("button", {
|
|
594
|
+
key: 1,
|
|
595
|
+
type: "button",
|
|
596
|
+
class: "mwnf-lightbox__control mwnf-lightbox__control--next",
|
|
597
|
+
"aria-label": v(s)("core.pagination.next"),
|
|
598
|
+
onClick: o[1] ||= S((e) => w(c.value + 1), ["stop"])
|
|
599
|
+
}, "›", 8, rt)) : r("", !0)
|
|
600
|
+
])) : r("", !0)
|
|
601
|
+
], 64))], 2)) : r("", !0);
|
|
602
|
+
}
|
|
603
|
+
}, at = ["aria-label", "dir"], ot = { class: "mwnf-popover__title" }, st = ["aria-label"], ct = { class: "mwnf-popover__body" }, lt = { class: "mwnf-popover__term" }, ut = ["innerHTML"], dt = {
|
|
604
|
+
key: 1,
|
|
605
|
+
class: "mwnf-popover__definition"
|
|
606
|
+
}, ft = {
|
|
607
|
+
__name: "GlossaryPopover",
|
|
608
|
+
props: {
|
|
609
|
+
term: {
|
|
610
|
+
type: Object,
|
|
611
|
+
default: null
|
|
612
|
+
},
|
|
613
|
+
html: {
|
|
614
|
+
type: String,
|
|
615
|
+
default: ""
|
|
616
|
+
},
|
|
617
|
+
dir: {
|
|
618
|
+
type: String,
|
|
619
|
+
default: ""
|
|
620
|
+
}
|
|
621
|
+
},
|
|
622
|
+
emits: ["close"],
|
|
623
|
+
setup(e, { emit: t }) {
|
|
624
|
+
let n = e, o = t, { t: s } = C(), c = p(null), l = null;
|
|
625
|
+
function u() {
|
|
626
|
+
o("close");
|
|
627
|
+
}
|
|
628
|
+
function m(e) {
|
|
629
|
+
e.key === "Escape" && u();
|
|
630
|
+
}
|
|
631
|
+
return b(() => n.term, (e, t) => {
|
|
632
|
+
e && !t ? (l = document.activeElement, document.addEventListener("keydown", m), requestAnimationFrame(() => c.value?.focus?.())) : !e && t && (document.removeEventListener("keydown", m), l?.focus?.(), l = null);
|
|
633
|
+
}, { immediate: !0 }), d(() => document.removeEventListener("keydown", m)), (t, n) => e.term ? (f(), i("aside", {
|
|
634
|
+
key: 0,
|
|
635
|
+
class: "mwnf-popover",
|
|
636
|
+
role: "dialog",
|
|
637
|
+
"aria-label": v(s)("record.glossary.heading"),
|
|
638
|
+
dir: e.dir || void 0
|
|
639
|
+
}, [a("div", ot, [a("span", null, _(v(s)("record.glossary.heading")), 1), a("button", {
|
|
640
|
+
ref_key: "closeButton",
|
|
641
|
+
ref: c,
|
|
642
|
+
type: "button",
|
|
643
|
+
class: "mwnf-popover__close",
|
|
644
|
+
"aria-label": v(s)("record.glossary.close"),
|
|
645
|
+
onClick: u
|
|
646
|
+
}, "✕", 8, st)]), a("div", ct, [a("p", lt, _(e.term.spelling || e.term.word), 1), e.html ? (f(), i("div", {
|
|
647
|
+
key: 0,
|
|
648
|
+
class: "mwnf-popover__definition mwnf-sheet__block",
|
|
649
|
+
innerHTML: e.html
|
|
650
|
+
}, null, 8, ut)) : e.term.definition ? (f(), i("p", dt, _(e.term.definition), 1)) : r("", !0)])], 8, at)) : r("", !0);
|
|
651
|
+
}
|
|
652
|
+
};
|
|
653
|
+
//#endregion
|
|
654
|
+
export { Fe as a, ne as c, D as d, ze as i, X as l, it as n, Te as o, He as r, xe as s, ft as t, I as u };
|