@museumwnf/viewer-layout 3.83.0 → 3.85.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@museumwnf/viewer-layout",
3
- "version": "3.83.0",
3
+ "version": "3.85.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",
@@ -43,7 +43,9 @@ const FAMILIES = {
43
43
  * - `namespace` — its own texts' namespace (package.json `viewerI18n.namespace`).
44
44
  */
45
45
  export function describeMinisiteSmoke({ config, exhibition, sharedTexts, ownTexts, sources, namespace }) {
46
- const family = exhibition.family ?? config.minisite?.family ?? 'ISL'
46
+ // A family's neutral name reads as its earlier code here (FAMILY_CODES).
47
+ const named = exhibition.family ?? config.minisite?.family ?? 'ISL'
48
+ const family = { islamicart: 'ISL', baroqueart: 'BAR', sharinghistory: 'SH', artintro: 'GAI' }[named] ?? named
47
49
  const marks = FAMILIES[family]
48
50
  if (!marks) throw new Error(`describeMinisiteSmoke: unknown family "${family}" in minisite.json.`)
49
51
  const messages = mergeMessages(sharedTexts, { en: ownTexts })
@@ -1,418 +0,0 @@
1
- import { d as e, o as t } from "./PartnerMap-DdyMLtgH.js";
2
- import { Fragment as n, computed as r, createBlock as i, createCommentVNode as a, createElementBlock as o, createElementVNode as s, createTextVNode as c, createVNode as l, mergeProps as u, normalizeClass as d, openBlock as f, ref as p, renderList as m, renderSlot as h, resolveDynamicComponent as g, toDisplayString as _, unref as v, vModelSelect as y, vModelText as b, watch as x, withCtx as S, withDirectives as C, withKeys as w } from "vue";
3
- import { useI18n as T } from "@museumwnf/viewer-core/i18n";
4
- import { md as E, mdInline as D, renderInline as O, searchGlossary as ee } from "@museumwnf/viewer-core";
5
- import { useRouter as k } from "vue-router";
6
- // src/content/BackLink.vue
7
- var A = ["href"], te = {
8
- class: "mwnf-back-bar__arrow",
9
- "aria-hidden": "true"
10
- }, ne = {
11
- key: 1,
12
- class: "mwnf-back-link"
13
- }, j = {
14
- __name: "BackLink",
15
- props: {
16
- label: {
17
- type: String,
18
- default: "core.action.back"
19
- },
20
- to: {
21
- type: [String, Object],
22
- default: null
23
- },
24
- href: {
25
- type: String,
26
- default: ""
27
- },
28
- variant: {
29
- type: String,
30
- default: "button",
31
- validator: (e) => ["button", "bar"].includes(e)
32
- },
33
- arrow: {
34
- type: String,
35
- default: "←"
36
- }
37
- },
38
- setup(t) {
39
- let n = k(), a = t, l = r(() => !!(a.to || a.href));
40
- function u() {
41
- return window.history.state?.back != null || !l.value && window.history.length > 1;
42
- }
43
- function d() {
44
- u() && n.back();
45
- }
46
- let p = r(() => a.to && n ? n.resolve(a.to).href : a.href || (typeof a.to == "string" ? a.to : "") || "#");
47
- function m(e) {
48
- e.button !== 0 || e.metaKey || e.ctrlKey || e.shiftKey || e.altKey || (u() ? (e.preventDefault(), n.back()) : a.to && n ? (e.preventDefault(), n.push(a.to)) : l.value || e.preventDefault());
49
- }
50
- return (n, r) => t.variant === "bar" ? (f(), o("a", {
51
- key: 0,
52
- href: p.value,
53
- class: "mwnf-back-bar mwnf-back-bar--link",
54
- onClick: m
55
- }, [
56
- s("span", te, _(t.arrow), 1),
57
- r[0] ||= c(),
58
- h(n.$slots, "default", {}, () => [c(_(n.$t(t.label)), 1)])
59
- ], 8, A)) : (f(), o("div", ne, [l.value && !u() ? (f(), i(e, {
60
- key: 0,
61
- to: t.to,
62
- href: t.href,
63
- class: "mwnf-back-link__button"
64
- }, {
65
- default: S(() => [r[1] ||= s("span", {
66
- class: "mwnf-back-link__arrow",
67
- "aria-hidden": "true"
68
- }, "↩", -1), c(_(n.$t(t.label)), 1)]),
69
- _: 1
70
- }, 8, ["to", "href"])) : (f(), o("button", {
71
- key: 1,
72
- class: "mwnf-back-link__button",
73
- onClick: d
74
- }, [r[2] ||= s("span", {
75
- class: "mwnf-back-link__arrow",
76
- "aria-hidden": "true"
77
- }, "↩", -1), c(_(n.$t(t.label)), 1)]))]));
78
- }
79
- }, M = ["dir"], N = { class: "mwnf-glossary-tool__toggle" }, P = { class: "mwnf-glossary-tool__panel" }, F = { class: "mwnf-glossary-tool__heading" }, I = { class: "mwnf-glossary-tool__instructions" }, L = ["aria-expanded", "aria-label"], R = {
80
- key: 0,
81
- class: "mwnf-glossary-tool__hits",
82
- role: "listbox"
83
- }, z = [
84
- "aria-selected",
85
- "onClick",
86
- "onKeydown"
87
- ], B = {
88
- key: 1,
89
- class: "mwnf-glossary-tool__no-results"
90
- }, V = {
91
- key: 2,
92
- class: "mwnf-glossary-tool__definition"
93
- }, H = { class: "mwnf-glossary-tool__definition-label" }, U = ["innerHTML"], W = {
94
- __name: "GlossaryTool",
95
- props: {
96
- language: {
97
- type: String,
98
- default: ""
99
- },
100
- entity: {
101
- type: String,
102
- default: "glossary"
103
- },
104
- labels: {
105
- type: Object,
106
- default: () => ({})
107
- },
108
- dir: {
109
- type: String,
110
- default: ""
111
- }
112
- },
113
- setup(e) {
114
- let t = e, i = {
115
- tool: "record.glossary.tool",
116
- heading: "record.glossary.heading",
117
- instructions: "record.glossary.instructions",
118
- definition: "record.glossary.definition",
119
- close: "record.glossary.close",
120
- ...t.labels
121
- }, { t: c } = T(), l = p(""), u = p(null), h = p(-1), g = r(() => l.value.trim() ? ee(l.value, t.language, { entity: t.entity }) : []), y = r(() => g.value.length > 0 && !u.value), x = r(() => u.value ? E(u.value.definition) : ""), S = r(() => i.noResults ? c(i.noResults) : ""), D = r(() => !!S.value && l.value.trim() && !u.value && g.value.length === 0);
122
- function O() {
123
- u.value = null, h.value = -1;
124
- }
125
- function k(e) {
126
- u.value = e, l.value = e.spelling, h.value = -1;
127
- }
128
- function A(e) {
129
- y.value && (e.key === "ArrowDown" ? (e.preventDefault(), h.value = (h.value + 1) % g.value.length) : e.key === "ArrowUp" ? (e.preventDefault(), h.value = (h.value - 1 + g.value.length) % g.value.length) : e.key === "Enter" && h.value >= 0 ? (e.preventDefault(), k(g.value[h.value])) : e.key === "Escape" && (h.value = -1));
130
- }
131
- return (t, r) => (f(), o("details", {
132
- class: "mwnf-glossary-tool",
133
- dir: e.dir || void 0
134
- }, [s("summary", N, _(v(c)(i.tool)), 1), s("div", P, [
135
- s("p", F, _(v(c)(i.heading)), 1),
136
- s("p", I, _(v(c)(i.instructions)), 1),
137
- C(s("input", {
138
- "onUpdate:modelValue": r[0] ||= (e) => l.value = e,
139
- type: "text",
140
- class: "mwnf-glossary-tool__input",
141
- role: "combobox",
142
- "aria-autocomplete": "list",
143
- "aria-expanded": y.value,
144
- "aria-label": v(c)(i.heading),
145
- onInput: O,
146
- onKeydown: A
147
- }, null, 40, L), [[b, l.value]]),
148
- y.value ? (f(), o("ul", R, [(f(!0), o(n, null, m(g.value, (e, t) => (f(), o("li", {
149
- key: e.id,
150
- role: "option",
151
- "aria-selected": t === h.value,
152
- tabindex: "0",
153
- class: d(["mwnf-glossary-tool__hit", { "mwnf-glossary-tool__hit--active": t === h.value }]),
154
- onClick: (t) => k(e),
155
- onKeydown: w((t) => k(e), ["enter"])
156
- }, _(e.spelling), 43, z))), 128))])) : D.value ? (f(), o("p", B, _(S.value), 1)) : a("", !0),
157
- u.value ? (f(), o("div", V, [s("p", H, _(v(c)(i.definition)), 1), s("div", {
158
- class: "mwnf-sheet__block",
159
- innerHTML: x.value
160
- }, null, 8, U)])) : a("", !0)
161
- ])], 8, M));
162
- }
163
- }, G = ["dir"], K = ["innerHTML"], q = { class: "mwnf-dynasty__body" }, J = { class: "mwnf-dynasty__eyebrow" }, Y = {
164
- key: 0,
165
- class: "mwnf-dynasty__field"
166
- }, X = { class: "mwnf-dynasty__label" }, Z = {
167
- key: 1,
168
- class: "mwnf-dynasty__field"
169
- }, re = { class: "mwnf-dynasty__label" }, ie = {
170
- key: 2,
171
- class: "mwnf-dynasty__dates"
172
- }, ae = {
173
- key: 3,
174
- class: "mwnf-dynasty__history"
175
- }, oe = { class: "mwnf-dynasty__label" }, se = ["innerHTML"], Q = {
176
- __name: "DynastyPopout",
177
- props: {
178
- dynasty: {
179
- type: Object,
180
- required: !0
181
- },
182
- text: {
183
- type: Object,
184
- default: () => ({})
185
- },
186
- dir: {
187
- type: String,
188
- default: ""
189
- }
190
- },
191
- setup(e) {
192
- let t = e, { t: n } = T(), i = r(() => {
193
- let { from_ad: e, to_ad: n, from_ah: r, to_ah: i } = t.dynasty ?? {};
194
- return e == null && n == null ? "" : `${r != null || i != null ? `AH ${r ?? "?"}–${i ?? "?"} / ` : ""}AD ${e ?? "?"}–${n ?? "?"}`;
195
- });
196
- return (t, r) => (f(), o("details", {
197
- class: "mwnf-dynasty",
198
- dir: e.dir || void 0
199
- }, [s("summary", {
200
- class: "mwnf-dynasty__summary",
201
- innerHTML: v(D)(e.text.name || e.dynasty.id)
202
- }, null, 8, K), s("div", q, [
203
- s("p", J, _(v(n)("record.dynasty.heading")), 1),
204
- e.text.also_known_as ? (f(), o("p", Y, [s("span", X, _(v(n)("sheet.field.alsoKnownAs")) + ":", 1), c(" " + _(e.text.also_known_as), 1)])) : a("", !0),
205
- e.text.area ? (f(), o("p", Z, [s("span", re, _(v(n)("sheet.field.area")) + ":", 1), c(" " + _(e.text.area), 1)])) : a("", !0),
206
- i.value ? (f(), o("p", ie, _(i.value), 1)) : a("", !0),
207
- e.text.history ? (f(), o("div", ae, [s("p", oe, _(v(n)("sheet.field.history")), 1), s("div", {
208
- class: "mwnf-sheet__block",
209
- innerHTML: v(E)(e.text.history)
210
- }, null, 8, se)])) : a("", !0)
211
- ])], 8, G));
212
- }
213
- }, ce = ["dir"], le = {
214
- key: 0,
215
- class: "mwnf-dynasty-list__heading"
216
- }, ue = {
217
- __name: "DynastyList",
218
- props: {
219
- heading: {
220
- type: String,
221
- default: ""
222
- },
223
- dynasties: {
224
- type: Array,
225
- default: () => []
226
- },
227
- tr: {
228
- type: Function,
229
- default: null
230
- },
231
- dir: {
232
- type: String,
233
- default: ""
234
- }
235
- },
236
- setup(e) {
237
- return (t, r) => e.dynasties.length ? (f(), o("section", {
238
- key: 0,
239
- class: "mwnf-dynasty-list",
240
- dir: e.dir || void 0
241
- }, [e.heading ? (f(), o("h2", le, _(e.heading), 1)) : a("", !0), (f(!0), o(n, null, m(e.dynasties, (t) => (f(), i(Q, {
242
- key: t.id,
243
- dynasty: t,
244
- text: e.tr ? e.tr(t) : t,
245
- dir: e.dir
246
- }, null, 8, [
247
- "dynasty",
248
- "text",
249
- "dir"
250
- ]))), 128))], 8, ce)) : a("", !0);
251
- }
252
- }, de = { class: "mwnf-sheet-timeline" }, fe = {
253
- key: 0,
254
- class: "mwnf-sheet-timeline__popout",
255
- dir: "ltr"
256
- }, pe = ["aria-label"], me = { class: "mwnf-sheet-timeline__title" }, he = { class: "mwnf-sheet-timeline__option" }, ge = ["value"], _e = { class: "mwnf-sheet-timeline__scroll" }, ve = { class: "mwnf-sheet-timeline__subheader" }, ye = {
257
- key: 0,
258
- class: "mwnf-sheet-timeline__empty"
259
- }, be = { class: "mwnf-sheet-timeline__date" }, $ = ["innerHTML"], xe = {
260
- __name: "TimelineLookup",
261
- props: { info: {
262
- type: Object,
263
- required: !0
264
- } },
265
- setup(t) {
266
- let i = t, { t: u } = T(), d = p(!1), h = p(i.info.defaultCountry ? i.info.defaultCountry() : "all");
267
- x(() => i.info, (e) => {
268
- h.value = e.defaultCountry ? e.defaultCountry() : "all";
269
- });
270
- let g = r(() => i.info.range ?? [null, null]), b = r(() => i.info.events(h.value)), w = r(() => i.info.countries.find((e) => e.value === h.value)?.label ?? ""), D = (e) => i.info.era ? i.info.era(e) : String(e ?? "");
271
- return (r, i) => (f(), o("div", de, [s("p", {
272
- class: "mwnf-sheet-timeline__trigger",
273
- onClick: i[0] ||= (e) => d.value = !d.value
274
- }, "➤ " + _(v(u)(t.info.trigger ?? "record.related.timelineForItem")), 1), d.value ? (f(), o("div", fe, [
275
- s("button", {
276
- type: "button",
277
- class: "mwnf-sheet-timeline__close",
278
- "aria-label": v(u)("core.action.close"),
279
- onClick: i[1] ||= (e) => d.value = !1
280
- }, "✕", 8, pe),
281
- s("p", me, _(v(u)(t.info.heading)), 1),
282
- s("div", he, [C(s("select", {
283
- "onUpdate:modelValue": i[2] ||= (e) => h.value = e,
284
- class: "mwnf-sheet-timeline__select"
285
- }, [(f(!0), o(n, null, m(t.info.countries, (e) => (f(), o("option", {
286
- key: e.value,
287
- value: e.value
288
- }, _(e.label), 9, ge))), 128))], 512), [[y, h.value]]), l(e, {
289
- class: "mwnf-sheet-timeline__link",
290
- to: t.info.searchTo(h.value, g.value)
291
- }, {
292
- default: S(() => [c("➤ " + _(v(u)("timeline.action.beginFullSearch")), 1)]),
293
- _: 1
294
- }, 8, ["to"])]),
295
- s("div", _e, [
296
- s("p", ve, _(w.value) + ", " + _(D(g.value[0])) + " – " + _(D(g.value[1])), 1),
297
- b.value.length ? a("", !0) : (f(), o("p", ye, _(v(u)("timeline.results.noEvents")), 1)),
298
- (f(!0), o(n, null, m(b.value, (e, t) => (f(), o("div", {
299
- key: e.id ?? t,
300
- class: "mwnf-sheet-timeline__event"
301
- }, [s("div", be, _(D(e.year_from)), 1), s("div", {
302
- class: "mwnf-sheet-timeline__description",
303
- innerHTML: v(E)(e.text.description)
304
- }, null, 8, $)]))), 128))
305
- ])
306
- ])) : a("", !0)]));
307
- }
308
- }, Se = ["href"], Ce = {
309
- key: 0,
310
- class: "mwnf-related-media__description"
311
- }, we = {
312
- __name: "RelatedMedia",
313
- props: {
314
- media: {
315
- type: Array,
316
- default: () => []
317
- },
318
- language: {
319
- type: String,
320
- default: ""
321
- },
322
- descriptions: {
323
- type: Boolean,
324
- default: !0
325
- },
326
- heading: {
327
- type: String,
328
- default: "record.related.audioVideo"
329
- },
330
- dir: {
331
- type: String,
332
- default: ""
333
- }
334
- },
335
- setup(e) {
336
- let c = e, { t: l } = T(), u = r(() => {
337
- let e = c.media.filter((e) => e?.url);
338
- return c.language ? e.filter((e) => !e.language || e.language === c.language) : e;
339
- });
340
- return (r, c) => u.value.length ? (f(), i(t, {
341
- key: 0,
342
- heading: e.heading ? v(l)(e.heading) : "",
343
- dir: e.dir,
344
- class: "mwnf-related-media"
345
- }, {
346
- default: S(() => [(f(!0), o(n, null, m(u.value, (t) => (f(), o("div", {
347
- key: t.url,
348
- class: "mwnf-related-media__entry"
349
- }, [s("a", {
350
- href: t.url,
351
- target: "_blank",
352
- rel: "noopener",
353
- class: "mwnf-related-media__link"
354
- }, "↗ " + _(t.title || t.url), 9, Se), e.descriptions && t.description ? (f(), o("p", Ce, _(t.description), 1)) : a("", !0)]))), 128))]),
355
- _: 1
356
- }, 8, ["heading", "dir"])) : a("", !0);
357
- }
358
- }, Te = ["innerHTML"], Ee = ["innerHTML"], De = { class: "mwnf-on-display__list" }, Oe = ["innerHTML"], ke = ["innerHTML"], Ae = { class: "mwnf-on-display__pending" }, je = {
359
- __name: "OnDisplayIn",
360
- props: {
361
- groups: {
362
- type: Array,
363
- default: () => []
364
- },
365
- heading: {
366
- type: String,
367
- default: "record.related.onDisplayIn"
368
- },
369
- pendingLabel: {
370
- type: String,
371
- default: ""
372
- },
373
- dir: {
374
- type: String,
375
- default: ""
376
- }
377
- },
378
- setup(l) {
379
- let d = l, { t: p } = T(), h = (e) => (e.sections ?? [{ links: e.links ?? [] }]).filter((e) => e.links?.length), y = r(() => d.groups.map((e) => ({
380
- ...e,
381
- parts: h(e)
382
- })).filter((e) => e.parts.length));
383
- return (r, d) => y.value.length ? (f(), i(g(l.heading ? t : "div"), u({ key: 0 }, l.heading ? { heading: v(p)(l.heading) } : {}, {
384
- dir: l.dir || void 0,
385
- class: "mwnf-on-display"
386
- }), {
387
- default: S(() => [(f(!0), o(n, null, m(y.value, (t, r) => (f(), o("div", {
388
- key: t.heading ?? r,
389
- class: "mwnf-on-display__group"
390
- }, [t.heading ? (f(), o("p", {
391
- key: 0,
392
- class: "mwnf-on-display__subheading",
393
- innerHTML: v(O)(v(p)(t.heading))
394
- }, null, 8, Te)) : a("", !0), (f(!0), o(n, null, m(t.parts, (t, r) => (f(), o(n, { key: r }, [t.caption ? (f(), o("p", {
395
- key: 0,
396
- class: "mwnf-on-display__caption",
397
- innerHTML: t.caption
398
- }, null, 8, Ee)) : a("", !0), s("ul", De, [(f(!0), o(n, null, m(t.links, (t, r) => (f(), o("li", {
399
- key: t.id ?? r,
400
- class: "mwnf-on-display__item"
401
- }, [t.to || t.href ? (f(), i(e, {
402
- key: 0,
403
- to: t.to,
404
- href: t.href,
405
- external: !!t.external
406
- }, {
407
- default: S(() => [t.external ? (f(), o(n, { key: 0 }, [c("↗ ")], 64)) : a("", !0), s("span", { innerHTML: t.label }, null, 8, Oe)]),
408
- _: 2
409
- }, 1032, [
410
- "to",
411
- "href",
412
- "external"
413
- ])) : (f(), o(n, { key: 1 }, [s("span", { innerHTML: t.label }, null, 8, ke), l.pendingLabel ? (f(), o(n, { key: 0 }, [d[0] ||= c(_(" "), -1), s("span", Ae, _(v(p)(l.pendingLabel)), 1)], 64)) : a("", !0)], 64))]))), 128))])], 64))), 128))]))), 128))]),
414
- _: 1
415
- }, 16, ["dir"])) : a("", !0);
416
- }
417
- };
418
- export { Q as a, ue as i, we as n, W as o, xe as r, j as s, je as t };