@museumwnf/viewer-layout 2.12.0 → 2.14.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.
@@ -1,446 +0,0 @@
1
- import { v as e } from "./TimelineEventList-59g_1ksf.js";
2
- import { Fragment as t, computed as n, createBlock as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, createTextVNode as s, normalizeClass as c, normalizeStyle as l, onBeforeUnmount as u, onMounted as d, openBlock as f, ref as p, renderList as m, toDisplayString as h, unref as g, vModelText as _, vShow as v, withCtx as y, withDirectives as b, withKeys as x } from "vue";
3
- import { useI18n as S } from "@museumwnf/viewer-core/i18n";
4
- import { md as C, mdInline as w, renderInline as T, searchGlossary as ee } from "@museumwnf/viewer-core";
5
- import { useRouter as E } from "vue-router";
6
- //#region src/content/PartnerMap.vue
7
- var D = {
8
- key: 0,
9
- class: "mwnf-partner-map"
10
- }, O = { class: "mwnf-partner-map__title" }, k = ["src", "title"], A = { class: "mwnf-partner-map__link" }, te = ["href"], ne = {
11
- __name: "PartnerMap",
12
- props: {
13
- latitude: {
14
- type: Number,
15
- default: null
16
- },
17
- longitude: {
18
- type: Number,
19
- default: null
20
- },
21
- zoom: {
22
- type: Number,
23
- default: 15
24
- },
25
- mapTitleEntry: {
26
- type: String,
27
- default: "partner.map.map"
28
- },
29
- mapOfEntry: {
30
- type: String,
31
- default: "partner.map.mapOf"
32
- },
33
- openMapLinkEntry: {
34
- type: String,
35
- default: "partner.map.openInOpenStreetMap"
36
- },
37
- label: {
38
- type: String,
39
- default: ""
40
- }
41
- },
42
- setup(e) {
43
- let t = e, r = n(() => Number.isFinite(t.latitude) && Number.isFinite(t.longitude)), s = n(() => {
44
- let e = 360 / 2 ** Math.max(1, Math.min(19, t.zoom || 15)), [n, r] = [t.latitude, t.longitude];
45
- return [
46
- r - e,
47
- n - e / 2,
48
- r + e,
49
- n + e / 2
50
- ].join("%2C");
51
- }), c = n(() => `https://www.openstreetmap.org/export/embed.html?bbox=${s.value}&layer=mapnik&marker=${t.latitude}%2C${t.longitude}`), l = n(() => `https://www.openstreetmap.org/?mlat=${t.latitude}&mlon=${t.longitude}#map=${t.zoom || 15}/${t.latitude}/${t.longitude}`);
52
- return (t, n) => r.value ? (f(), a("div", D, [
53
- o("p", O, h(t.$t(e.mapTitleEntry)), 1),
54
- o("iframe", {
55
- src: c.value,
56
- title: e.label ? t.$t(e.mapOfEntry, { label: e.label }) : t.$t(e.mapTitleEntry),
57
- loading: "lazy",
58
- referrerpolicy: "no-referrer",
59
- class: "mwnf-partner-map__embed"
60
- }, null, 8, k),
61
- o("p", A, [o("a", {
62
- href: l.value,
63
- target: "_blank",
64
- rel: "noopener"
65
- }, "↗ " + h(t.$t(e.openMapLinkEntry)), 9, te)])
66
- ])) : i("", !0);
67
- }
68
- }, j = {
69
- key: 0,
70
- class: "mwnf-featured-partners"
71
- }, M = { class: "mwnf-featured-partners__heading" }, N = { class: "mwnf-featured-partners__carousel" }, P = {
72
- key: 0,
73
- class: "mwnf-featured-partners__image"
74
- }, F = ["src", "alt"], I = { class: "mwnf-featured-partners__body" }, L = { class: "mwnf-featured-partners__name" }, R = { class: "mwnf-featured-partners__location" }, z = { key: 0 }, B = { class: "mwnf-featured-partners__description" }, V = {
75
- key: 0,
76
- class: "mwnf-featured-partners__controls"
77
- }, H = ["aria-label", "onClick"], U = 8e3, W = {
78
- __name: "FeaturedPartners",
79
- props: {
80
- records: {
81
- type: Array,
82
- default: () => []
83
- },
84
- headingEntry: {
85
- type: String,
86
- default: "partner.featured"
87
- }
88
- },
89
- setup(n) {
90
- let l = n, g = p(0), _ = null;
91
- function x(e) {
92
- g.value = e, S();
93
- }
94
- function S() {
95
- _ && clearInterval(_), l.records.length > 0 && (_ = setInterval(() => {
96
- g.value = (g.value + 1) % l.records.length;
97
- }, U));
98
- }
99
- return d(S), u(() => _ && clearInterval(_)), (l, u) => n.records.length ? (f(), a("section", j, [
100
- o("h2", M, h(l.$t(n.headingEntry)), 1),
101
- o("div", N, [(f(!0), a(t, null, m(n.records, (t, n) => b((f(), r(e, {
102
- key: t.id,
103
- to: t.route,
104
- class: "mwnf-featured-partners__card"
105
- }, {
106
- default: y(() => [t.logo ? (f(), a("span", P, [o("img", {
107
- src: t.logo,
108
- alt: t.name,
109
- class: "mwnf-featured-partners__logo"
110
- }, null, 8, F)])) : i("", !0), o("span", I, [
111
- o("span", L, h(t.name), 1),
112
- o("span", R, [t.city ? (f(), a("span", z, h(t.city) + ", ", 1)) : i("", !0), s(h(t.country), 1)]),
113
- o("span", B, h(t.description), 1)
114
- ])]),
115
- _: 2
116
- }, 1032, ["to"])), [[v, n === g.value]])), 128))]),
117
- n.records.length > 1 ? (f(), a("div", V, [(f(!0), a(t, null, m(n.records, (e, t) => (f(), a("button", {
118
- key: e.id,
119
- class: c(["mwnf-featured-partners__bullet", { "mwnf-featured-partners__bullet--active": t === g.value }]),
120
- "aria-label": `${l.$t("core.action.show")} ${e.name}`,
121
- onClick: (e) => x(t)
122
- }, null, 10, H))), 128))])) : i("", !0)
123
- ])) : i("", !0);
124
- }
125
- }, G = { class: "mwnf-sibling-galleries" }, K = {
126
- key: 0,
127
- class: "mwnf-sibling-galleries__galleries"
128
- }, q = { class: "mwnf-sibling-galleries__header" }, J = { class: "mwnf-sibling-galleries__heading" }, Y = ["href"], X = { class: "mwnf-sibling-galleries__grid" }, Z = {
129
- key: 0,
130
- class: "mwnf-sibling-galleries__image"
131
- }, re = ["src", "alt"], ie = {
132
- key: 1,
133
- class: "mwnf-sibling-galleries__image mwnf-sibling-galleries__image--empty"
134
- }, ae = { class: "mwnf-sibling-galleries__name" }, oe = {
135
- key: 1,
136
- class: "mwnf-sibling-galleries__museums"
137
- }, se = { class: "mwnf-sibling-galleries__heading" }, ce = { class: "mwnf-sibling-galleries__museums-grid" }, le = ["href"], ue = { class: "mwnf-sibling-galleries__museum-image" }, de = { class: "mwnf-sibling-galleries__museum-name" }, fe = {
138
- __name: "SiblingGalleries",
139
- props: {
140
- galleries: {
141
- type: Array,
142
- default: () => []
143
- },
144
- museums: {
145
- type: Array,
146
- default: () => []
147
- },
148
- galleriesHeadingEntry: {
149
- type: String,
150
- default: "sibling.galleries"
151
- },
152
- seeMoreGalleriesEntry: {
153
- type: String,
154
- default: "sibling.seeMoreGalleries"
155
- },
156
- seeMoreGalleriesHref: {
157
- type: String,
158
- default: ""
159
- },
160
- museumsHeadingEntry: {
161
- type: String,
162
- default: "sibling.otherVirtualMuseums"
163
- }
164
- },
165
- setup(n) {
166
- return (s, u) => (f(), a("section", G, [n.galleries.length ? (f(), a("div", K, [o("div", q, [o("p", J, h(s.$t(n.galleriesHeadingEntry)), 1), n.seeMoreGalleriesHref ? (f(), a("a", {
167
- key: 0,
168
- href: n.seeMoreGalleriesHref,
169
- target: "_blank",
170
- rel: "noopener",
171
- class: "mwnf-sibling-galleries__see-more"
172
- }, h(s.$t(n.seeMoreGalleriesEntry)) + " » ", 9, Y)) : i("", !0)]), o("div", X, [(f(!0), a(t, null, m(n.galleries, (t) => (f(), r(e, {
173
- key: t.id,
174
- to: t.route,
175
- class: c(["mwnf-sibling-galleries__gallery", { "mwnf-sibling-galleries__gallery--no-link": !t.route }])
176
- }, {
177
- default: y(() => [t.image ? (f(), a("span", Z, [o("img", {
178
- src: t.image,
179
- alt: t.name
180
- }, null, 8, re)])) : (f(), a("span", ie)), o("p", ae, h(t.name), 1)]),
181
- _: 2
182
- }, 1032, ["to", "class"]))), 128))])])) : i("", !0), n.museums.length ? (f(), a("div", oe, [o("div", se, h(s.$t(n.museumsHeadingEntry)), 1), o("div", ce, [(f(!0), a(t, null, m(n.museums, (e) => (f(), a("a", {
183
- key: e.name,
184
- href: e.href || e.to,
185
- target: "_blank",
186
- rel: "noopener",
187
- class: "mwnf-sibling-galleries__museum",
188
- style: l({
189
- "--mwnf-museum-bg": e.accent || "var(--mwnf-color-border)",
190
- "--mwnf-museum-text": e.textColor || "inherit"
191
- })
192
- }, [o("div", ue, h(e.name.split(" ").map((e) => e[0]).join("")), 1), o("p", de, h(e.name), 1)], 12, le))), 128))])])) : i("", !0)]));
193
- }
194
- }, pe = {
195
- key: 0,
196
- class: "mwnf-popup-logo"
197
- }, me = ["aria-label"], he = ["innerHTML"], ge = ["innerHTML"], _e = {
198
- __name: "PopupLogo",
199
- props: {
200
- content: {
201
- type: String,
202
- default: ""
203
- },
204
- rawHtml: {
205
- type: Boolean,
206
- default: !1
207
- },
208
- enabled: {
209
- type: Boolean,
210
- default: !0
211
- },
212
- closeLabel: {
213
- type: String,
214
- default: "core.action.close"
215
- }
216
- },
217
- setup(e) {
218
- let t = e, r = p(!1), s = n(() => t.rawHtml ? t.content : T(t.content)), c = n(() => t.enabled && !!t.content && !r.value);
219
- return (t, n) => c.value ? (f(), a("div", pe, [o("button", {
220
- class: "mwnf-popup-logo__close",
221
- "aria-label": t.$t(e.closeLabel),
222
- onClick: n[0] ||= (e) => r.value = !0
223
- }, "✕", 8, me), e.rawHtml ? (f(), a("div", {
224
- key: 0,
225
- class: "mwnf-popup-logo__content",
226
- innerHTML: s.value
227
- }, null, 8, he)) : (f(), a("div", {
228
- key: 1,
229
- class: "mwnf-popup-logo__content",
230
- innerHTML: s.value
231
- }, null, 8, ge))])) : i("", !0);
232
- }
233
- }, ve = { class: "mwnf-back-link" }, ye = {
234
- __name: "BackLink",
235
- props: {
236
- label: {
237
- type: String,
238
- default: "core.action.back"
239
- },
240
- to: {
241
- type: [String, Object],
242
- default: null
243
- },
244
- href: {
245
- type: String,
246
- default: ""
247
- }
248
- },
249
- setup(t) {
250
- let n = E();
251
- function i() {
252
- return window.history.length > 1;
253
- }
254
- function o(e) {
255
- i() && (e.preventDefault(), n.back());
256
- }
257
- return (n, c) => (f(), a("div", ve, [!i() && (t.to || t.href) ? (f(), r(e, {
258
- key: 0,
259
- to: t.to,
260
- href: t.href,
261
- class: "mwnf-back-link__button"
262
- }, {
263
- default: y(() => [s(" ↩ " + h(n.$t(t.label)), 1)]),
264
- _: 1
265
- }, 8, ["to", "href"])) : (f(), a("button", {
266
- key: 1,
267
- class: "mwnf-back-link__button",
268
- onClick: o
269
- }, " ↩ " + h(n.$t(t.label)), 1))]));
270
- }
271
- }, be = ["dir"], xe = { class: "mwnf-glossary-tool__toggle" }, Se = { class: "mwnf-glossary-tool__panel" }, Ce = { class: "mwnf-glossary-tool__heading" }, we = { class: "mwnf-glossary-tool__instructions" }, Te = ["aria-expanded", "aria-label"], Ee = {
272
- key: 0,
273
- class: "mwnf-glossary-tool__hits",
274
- role: "listbox"
275
- }, De = [
276
- "aria-selected",
277
- "onClick",
278
- "onKeydown"
279
- ], Oe = {
280
- key: 1,
281
- class: "mwnf-glossary-tool__no-results"
282
- }, ke = {
283
- key: 2,
284
- class: "mwnf-glossary-tool__definition"
285
- }, Ae = { class: "mwnf-glossary-tool__definition-label" }, je = ["innerHTML"], Me = {
286
- __name: "GlossaryTool",
287
- props: {
288
- language: {
289
- type: String,
290
- default: ""
291
- },
292
- entity: {
293
- type: String,
294
- default: "glossary"
295
- },
296
- labels: {
297
- type: Object,
298
- default: () => ({})
299
- },
300
- dir: {
301
- type: String,
302
- default: ""
303
- }
304
- },
305
- setup(e) {
306
- let r = e, s = {
307
- tool: "record.glossary.tool",
308
- heading: "record.glossary.heading",
309
- instructions: "record.glossary.instructions",
310
- definition: "record.glossary.definition",
311
- close: "record.glossary.close",
312
- ...r.labels
313
- }, { t: l } = S(), u = p(""), d = p(null), v = p(-1), y = n(() => u.value.trim() ? ee(u.value, r.language, { entity: r.entity }) : []), w = n(() => y.value.length > 0 && !d.value), T = n(() => d.value ? C(d.value.definition) : ""), E = n(() => s.noResults ? l(s.noResults) : ""), D = n(() => !!E.value && u.value.trim() && !d.value && y.value.length === 0);
314
- function O() {
315
- d.value = null, v.value = -1;
316
- }
317
- function k(e) {
318
- d.value = e, u.value = e.spelling, v.value = -1;
319
- }
320
- function A(e) {
321
- w.value && (e.key === "ArrowDown" ? (e.preventDefault(), v.value = (v.value + 1) % y.value.length) : e.key === "ArrowUp" ? (e.preventDefault(), v.value = (v.value - 1 + y.value.length) % y.value.length) : e.key === "Enter" && v.value >= 0 ? (e.preventDefault(), k(y.value[v.value])) : e.key === "Escape" && (v.value = -1));
322
- }
323
- return (n, r) => (f(), a("details", {
324
- class: "mwnf-glossary-tool",
325
- dir: e.dir || void 0
326
- }, [o("summary", xe, h(g(l)(s.tool)), 1), o("div", Se, [
327
- o("p", Ce, h(g(l)(s.heading)), 1),
328
- o("p", we, h(g(l)(s.instructions)), 1),
329
- b(o("input", {
330
- "onUpdate:modelValue": r[0] ||= (e) => u.value = e,
331
- type: "text",
332
- class: "mwnf-glossary-tool__input",
333
- role: "combobox",
334
- "aria-autocomplete": "list",
335
- "aria-expanded": w.value,
336
- "aria-label": g(l)(s.heading),
337
- onInput: O,
338
- onKeydown: A
339
- }, null, 40, Te), [[_, u.value]]),
340
- w.value ? (f(), a("ul", Ee, [(f(!0), a(t, null, m(y.value, (e, t) => (f(), a("li", {
341
- key: e.id,
342
- role: "option",
343
- "aria-selected": t === v.value,
344
- tabindex: "0",
345
- class: c(["mwnf-glossary-tool__hit", { "mwnf-glossary-tool__hit--active": t === v.value }]),
346
- onClick: (t) => k(e),
347
- onKeydown: x((t) => k(e), ["enter"])
348
- }, h(e.spelling), 43, De))), 128))])) : D.value ? (f(), a("p", Oe, h(E.value), 1)) : i("", !0),
349
- d.value ? (f(), a("div", ke, [o("p", Ae, h(g(l)(s.definition)), 1), o("div", {
350
- class: "mwnf-sheet__block",
351
- innerHTML: T.value
352
- }, null, 8, je)])) : i("", !0)
353
- ])], 8, be));
354
- }
355
- }, Ne = ["dir"], Pe = ["innerHTML"], Fe = { class: "mwnf-dynasty__body" }, Q = { class: "mwnf-dynasty__eyebrow" }, Ie = {
356
- key: 0,
357
- class: "mwnf-dynasty__field"
358
- }, Le = { class: "mwnf-dynasty__label" }, Re = {
359
- key: 1,
360
- class: "mwnf-dynasty__field"
361
- }, ze = { class: "mwnf-dynasty__label" }, Be = {
362
- key: 2,
363
- class: "mwnf-dynasty__dates"
364
- }, Ve = {
365
- key: 3,
366
- class: "mwnf-dynasty__history"
367
- }, He = { class: "mwnf-dynasty__label" }, Ue = ["innerHTML"], $ = {
368
- __name: "DynastyPopout",
369
- props: {
370
- dynasty: {
371
- type: Object,
372
- required: !0
373
- },
374
- text: {
375
- type: Object,
376
- default: () => ({})
377
- },
378
- dir: {
379
- type: String,
380
- default: ""
381
- }
382
- },
383
- setup(e) {
384
- let t = e, { t: r } = S(), c = n(() => {
385
- let { from_ad: e, to_ad: n, from_ah: r, to_ah: i } = t.dynasty ?? {};
386
- return e == null && n == null ? "" : `${r != null || i != null ? `AH ${r ?? "?"}–${i ?? "?"} / ` : ""}AD ${e ?? "?"}–${n ?? "?"}`;
387
- });
388
- return (t, n) => (f(), a("details", {
389
- class: "mwnf-dynasty",
390
- dir: e.dir || void 0
391
- }, [o("summary", {
392
- class: "mwnf-dynasty__summary",
393
- innerHTML: g(w)(e.text.name || e.dynasty.id)
394
- }, null, 8, Pe), o("div", Fe, [
395
- o("p", Q, h(g(r)("record.dynasty.heading")), 1),
396
- e.text.also_known_as ? (f(), a("p", Ie, [o("span", Le, h(g(r)("sheet.field.alsoKnownAs")) + ":", 1), s(" " + h(e.text.also_known_as), 1)])) : i("", !0),
397
- e.text.area ? (f(), a("p", Re, [o("span", ze, h(g(r)("sheet.field.area")) + ":", 1), s(" " + h(e.text.area), 1)])) : i("", !0),
398
- c.value ? (f(), a("p", Be, h(c.value), 1)) : i("", !0),
399
- e.text.history ? (f(), a("div", Ve, [o("p", He, h(g(r)("sheet.field.history")), 1), o("div", {
400
- class: "mwnf-sheet__block",
401
- innerHTML: g(C)(e.text.history)
402
- }, null, 8, Ue)])) : i("", !0)
403
- ])], 8, Ne));
404
- }
405
- }, We = ["dir"], Ge = {
406
- key: 0,
407
- class: "mwnf-dynasty-list__heading"
408
- }, Ke = {
409
- __name: "DynastyList",
410
- props: {
411
- heading: {
412
- type: String,
413
- default: ""
414
- },
415
- dynasties: {
416
- type: Array,
417
- default: () => []
418
- },
419
- tr: {
420
- type: Function,
421
- default: null
422
- },
423
- dir: {
424
- type: String,
425
- default: ""
426
- }
427
- },
428
- setup(e) {
429
- return (n, o) => e.dynasties.length ? (f(), a("section", {
430
- key: 0,
431
- class: "mwnf-dynasty-list",
432
- dir: e.dir || void 0
433
- }, [e.heading ? (f(), a("h2", Ge, h(e.heading), 1)) : i("", !0), (f(!0), a(t, null, m(e.dynasties, (t) => (f(), r($, {
434
- key: t.id,
435
- dynasty: t,
436
- text: e.tr ? e.tr(t) : t,
437
- dir: e.dir
438
- }, null, 8, [
439
- "dynasty",
440
- "text",
441
- "dir"
442
- ]))), 128))], 8, We)) : i("", !0);
443
- }
444
- };
445
- //#endregion
446
- export { _e as a, ne as c, ye as i, $ as n, fe as o, Me as r, W as s, Ke as t };