@museumwnf/viewer-layout 2.17.0 → 3.0.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.
@@ -0,0 +1,319 @@
1
+ import { s as e, y as t } from "./TimelineEventList-BhkWyY5-.js";
2
+ import { o as n } from "./TimelineResultsView-CgGVsJcp.js";
3
+ import { A as r, F as i, h as a, m as o } from "./data-BfyYB8ff.js";
4
+ import { n as s, r as c, t as l } from "./themeSpecs-Bgn-K6R6.js";
5
+ import { Fragment as u, computed as d, createBlock as f, createCommentVNode as p, createElementBlock as m, createElementVNode as h, createTextVNode as g, createVNode as _, normalizeClass as v, onMounted as ee, openBlock as y, ref as b, renderList as x, toDisplayString as S, unref as C, vModelCheckbox as w, watch as T, withCtx as E, withDirectives as D } from "vue";
6
+ import { renderBlock as O, useI18n as k } from "@museumwnf/viewer-core";
7
+ import { RouterLink as A, useRoute as te, useRouter as ne } from "vue-router";
8
+ //#region \0rolldown/runtime.js
9
+ var j = Object.defineProperty, M = (e, t) => {
10
+ let n = {};
11
+ for (var r in e) j(n, r, {
12
+ get: e[r],
13
+ enumerable: !0
14
+ });
15
+ return t || j(n, Symbol.toStringTag, { value: "Module" }), n;
16
+ }, N = { class: "mwnf-picture-gallery" }, re = {
17
+ key: 0,
18
+ class: "mwnf-picture-gallery__selected"
19
+ }, P = { class: "mwnf-picture-gallery__image" }, F = ["src", "alt"], I = { class: "mwnf-picture-gallery__details" }, L = { class: "mwnf-picture-gallery__detail mwnf-picture-gallery__detail--title" }, R = { key: 0 }, z = ["innerHTML"], B = {
20
+ key: 0,
21
+ class: "mwnf-picture-gallery__label"
22
+ }, V = ["innerHTML"], H = {
23
+ key: 0,
24
+ class: "mwnf-picture-gallery__detail"
25
+ }, U = {
26
+ key: 2,
27
+ class: "mwnf-picture-gallery__unresolved"
28
+ }, W = {
29
+ key: 1,
30
+ class: "mwnf-picture-gallery__empty"
31
+ }, G = {
32
+ key: 2,
33
+ class: "mwnf-picture-gallery__strip"
34
+ }, K = { class: "mwnf-picture-gallery__thumbs" }, q = ["onClick"], J = ["src", "alt"], Y = { class: "mwnf-picture-gallery__thumb-text" }, X = { key: 0 }, Z = ["innerHTML"], Q = { key: 1 }, ie = {
35
+ key: 0,
36
+ class: "mwnf-picture-gallery__toggle"
37
+ }, ae = {
38
+ __name: "PictureGallery",
39
+ props: {
40
+ pictures: {
41
+ type: Array,
42
+ default: () => []
43
+ },
44
+ selectedId: {
45
+ type: [String, Number],
46
+ default: null
47
+ },
48
+ seeItemEntry: {
49
+ type: String,
50
+ default: "exhibition.theme.seeItemEntry"
51
+ },
52
+ unresolvedEntry: {
53
+ type: String,
54
+ default: "exhibition.theme.recordNotInSite"
55
+ },
56
+ emptyEntry: {
57
+ type: String,
58
+ default: "exhibition.theme.additionalContent"
59
+ },
60
+ addRelatedEntry: {
61
+ type: String,
62
+ default: "exhibition.theme.addRelatedWorks"
63
+ },
64
+ hideRelatedEntry: {
65
+ type: String,
66
+ default: "exhibition.theme.hideRelatedWorks"
67
+ }
68
+ },
69
+ emits: ["update:selectedId"],
70
+ setup(e, { emit: n }) {
71
+ let r = e, i = n, { t: a } = k(), o = d(() => r.pictures.find((e) => e.id === r.selectedId) ?? null), s = d(() => r.pictures.some((e) => e.backRelated?.length)), c = b(!1);
72
+ T(() => r.pictures, () => {
73
+ c.value = !1;
74
+ });
75
+ let l = d(() => c.value ? r.pictures : r.pictures.filter((e) => !e.backRelated?.length));
76
+ function _(e) {
77
+ i("update:selectedId", e.id);
78
+ }
79
+ return (n, r) => (y(), m("div", N, [o.value ? (y(), m("div", re, [h("div", P, [h("img", {
80
+ src: o.value.image,
81
+ alt: o.value.imageAlt ?? ""
82
+ }, null, 8, F)]), h("div", I, [
83
+ h("div", L, [o.value.imageCaption ? (y(), m("span", R, S(o.value.imageCaption) + ", ", 1)) : p("", !0), h("span", { innerHTML: o.value.name }, null, 8, z)]),
84
+ (y(!0), m(u, null, x(o.value.fields ?? [], (e, t) => (y(), m("div", {
85
+ key: t,
86
+ class: "mwnf-picture-gallery__detail"
87
+ }, [e.label ? (y(), m("span", B, S(e.label), 1)) : p("", !0), h("span", { innerHTML: e.value }, null, 8, V)]))), 128)),
88
+ o.value.detail ? (y(), m("div", H, S(o.value.detail), 1)) : p("", !0),
89
+ o.value.to ? (y(), f(t, {
90
+ key: 1,
91
+ class: "mwnf-picture-gallery__link",
92
+ to: o.value.to
93
+ }, {
94
+ default: E(() => [g(S(C(a)(e.seeItemEntry)) + " →", 1)]),
95
+ _: 1
96
+ }, 8, ["to"])) : (y(), m("div", U, S(C(a)(e.unresolvedEntry)), 1))
97
+ ])])) : (y(), m("div", W, S(C(a)(e.emptyEntry)), 1)), e.pictures.length ? (y(), m("div", G, [h("ul", K, [(y(!0), m(u, null, x(l.value, (t) => (y(), m("li", {
98
+ key: t.id,
99
+ class: v(["mwnf-picture-gallery__thumb", {
100
+ "mwnf-picture-gallery__thumb--active": t.id === e.selectedId,
101
+ "mwnf-picture-gallery__thumb--related": t.backRelated?.length
102
+ }])
103
+ }, [h("button", {
104
+ type: "button",
105
+ onClick: (e) => _(t)
106
+ }, [h("img", {
107
+ src: t.image,
108
+ alt: t.imageAlt ?? "",
109
+ loading: "lazy"
110
+ }, null, 8, J)], 8, q), h("div", Y, [
111
+ t.imageCaption ? (y(), m("span", X, S(t.imageCaption) + ", ", 1)) : p("", !0),
112
+ h("span", {
113
+ class: "mwnf-picture-gallery__thumb-name",
114
+ innerHTML: t.name
115
+ }, null, 8, Z),
116
+ t.detail ? (y(), m("span", Q, ", " + S(t.detail), 1)) : p("", !0)
117
+ ])], 2))), 128))]), s.value ? (y(), m("label", ie, [D(h("input", {
118
+ "onUpdate:modelValue": r[0] ||= (e) => c.value = e,
119
+ type: "checkbox"
120
+ }, null, 512), [[w, c.value]]), h("span", null, S(c.value ? C(a)(e.hideRelatedEntry) : C(a)(e.addRelatedEntry)), 1)])) : p("", !0)])) : p("", !0)]));
121
+ }
122
+ }, $ = {
123
+ key: 0,
124
+ class: "mwnf-picture-narrative"
125
+ }, oe = ["innerHTML"], se = {
126
+ key: 1,
127
+ class: "mwnf-picture-narrative__related"
128
+ }, ce = { class: "mwnf-picture-narrative__heading" }, le = { class: "mwnf-picture-narrative__images" }, ue = { class: "mwnf-picture-narrative__image mwnf-picture-narrative__image--main" }, de = ["src", "alt"], fe = { class: "mwnf-picture-narrative__thumb-text" }, pe = ["innerHTML"], me = { key: 0 }, he = ["onClick"], ge = ["src", "alt"], _e = { class: "mwnf-picture-narrative__thumb-text" }, ve = ["innerHTML"], ye = { key: 0 }, be = {
129
+ key: 0,
130
+ class: "mwnf-picture-narrative__relation"
131
+ }, xe = {
132
+ key: 2,
133
+ class: "mwnf-picture-narrative__related"
134
+ }, Se = { class: "mwnf-picture-narrative__heading" }, Ce = { class: "mwnf-picture-narrative__text mwnf-picture-narrative__text--reciprocal" }, we = { class: "mwnf-picture-narrative__image" }, Te = ["src", "alt"], Ee = { class: "mwnf-picture-narrative__thumb-text" }, De = ["innerHTML"], Oe = { key: 0 }, ke = {
135
+ __name: "PictureNarrative",
136
+ props: {
137
+ picture: {
138
+ type: Object,
139
+ default: null
140
+ },
141
+ contextualDescription: {
142
+ type: String,
143
+ default: ""
144
+ },
145
+ relatedHeadingEntry: {
146
+ type: String,
147
+ default: "exhibition.related.items"
148
+ },
149
+ reciprocalFallbackEntry: {
150
+ type: String,
151
+ default: "exhibition.related.reciprocal"
152
+ }
153
+ },
154
+ emits: ["select"],
155
+ setup(e, { emit: t }) {
156
+ let n = e, r = t, { t: i } = k(), a = d(() => n.contextualDescription ? O(n.contextualDescription, { breaks: !0 }) : ""), o = d(() => n.picture?.related ?? []), s = d(() => n.picture?.backRelated?.[0] ?? null);
157
+ function c(e) {
158
+ r("select", e.id);
159
+ }
160
+ return (t, n) => e.picture ? (y(), m("div", $, [
161
+ a.value ? (y(), m("div", {
162
+ key: 0,
163
+ class: "mwnf-picture-narrative__text mwnf-sheet__block",
164
+ innerHTML: a.value
165
+ }, null, 8, oe)) : p("", !0),
166
+ o.value.length ? (y(), m("div", se, [h("div", ce, S(C(i)(e.relatedHeadingEntry)), 1), h("div", le, [h("div", ue, [h("img", {
167
+ src: e.picture.image,
168
+ alt: e.picture.imageAlt ?? ""
169
+ }, null, 8, de), h("div", fe, [h("span", { innerHTML: e.picture.name }, null, 8, pe), e.picture.detail ? (y(), m("span", me, ", " + S(e.picture.detail), 1)) : p("", !0)])]), (y(!0), m(u, null, x(o.value, (e) => (y(), m("div", {
170
+ key: e.picture.id,
171
+ class: "mwnf-picture-narrative__image"
172
+ }, [
173
+ h("button", {
174
+ type: "button",
175
+ onClick: (t) => c(e.picture)
176
+ }, [h("img", {
177
+ src: e.picture.image,
178
+ alt: e.picture.imageAlt ?? ""
179
+ }, null, 8, ge)], 8, he),
180
+ h("div", _e, [h("span", { innerHTML: e.picture.name }, null, 8, ve), e.picture.detail ? (y(), m("span", ye, ", " + S(e.picture.detail), 1)) : p("", !0)]),
181
+ e.text ? (y(), m("div", be, S(e.text), 1)) : p("", !0)
182
+ ]))), 128))])])) : p("", !0),
183
+ s.value ? (y(), m("div", xe, [
184
+ h("div", Se, S(C(i)(e.relatedHeadingEntry)), 1),
185
+ h("p", Ce, S(s.value.reciprocalText || C(i)(e.reciprocalFallbackEntry)), 1),
186
+ h("div", we, [h("button", {
187
+ type: "button",
188
+ onClick: n[0] ||= (e) => c(s.value.picture)
189
+ }, [h("img", {
190
+ src: s.value.picture.image,
191
+ alt: s.value.picture.imageAlt ?? ""
192
+ }, null, 8, Te)]), h("div", Ee, [h("span", { innerHTML: s.value.picture.name }, null, 8, De), s.value.picture.detail ? (y(), m("span", Oe, ", " + S(s.value.picture.detail), 1)) : p("", !0)])])
193
+ ])) : p("", !0)
194
+ ])) : p("", !0);
195
+ }
196
+ }, Ae = /* @__PURE__ */ M({ default: () => He }), je = { class: "mwnf-dxa-theme__heading" }, Me = {
197
+ key: 0,
198
+ class: "mwnf-dxa-theme__numeral"
199
+ }, Ne = { class: "mwnf-dxa-theme__subheading" }, Pe = { class: "mwnf-dxa-theme__tour" }, Fe = { key: 1 }, Ie = {
200
+ key: 0,
201
+ class: "mwnf-dxa-theme__subthemes"
202
+ }, Le = { class: "mwnf-dxa-theme__subthemes-label" }, Re = { class: "mwnf-dxa-theme__subtheme" }, ze = {
203
+ key: 0,
204
+ class: "mwnf-dxa-theme__tour"
205
+ }, Be = {
206
+ key: 1,
207
+ class: "mwnf-loader"
208
+ }, Ve = "→", He = {
209
+ __name: "Theme",
210
+ props: { aboutMode: {
211
+ type: Boolean,
212
+ default: !1
213
+ } },
214
+ setup(t) {
215
+ let w = t, { aboutTheme: D, owningTheme: O, romanFor: j, themeByRouteId: M, themeText: N, useThemePictures: re } = r, { t: P, locale: F } = k(), I = te(), L = ne(), R = d(() => w.aboutMode ? D.value : M(I.params.id)), z = d(() => {
216
+ let e = I.params.subtheme;
217
+ if (w.aboutMode || !e || e === "overview") return null;
218
+ let t = Number(e);
219
+ return Number.isInteger(t) && t >= 1 ? t : null;
220
+ }), B = d(() => z.value === null ? null : (R.value?.sub_themes ?? [])[z.value - 1] ?? null), V = d(() => B.value ?? R.value), H = d(() => w.aboutMode ? l : c), U = re(V), W = b(null);
221
+ function G() {
222
+ let e = Number(I.params.image);
223
+ return (U.value.find((t) => t.displayOrder === e) ?? U.value[0])?.id ?? null;
224
+ }
225
+ function K() {
226
+ W.value = G();
227
+ }
228
+ ee(K), T(() => [
229
+ I.params.id,
230
+ I.params.subtheme,
231
+ w.aboutMode
232
+ ], K);
233
+ let q = d(() => U.value.find((e) => e.id === W.value) ?? null);
234
+ function J(e) {
235
+ if (W.value = e, w.aboutMode) return;
236
+ let t = U.value.find((t) => t.id === e);
237
+ t && L.replace({
238
+ name: "theme",
239
+ params: {
240
+ id: I.params.id,
241
+ subtheme: I.params.subtheme ?? "overview",
242
+ image: String(t.displayOrder)
243
+ }
244
+ });
245
+ }
246
+ let Y = d(() => N(R.value, F.value).title ?? R.value?.internal_name ?? ""), X = d(() => w.aboutMode ? a(F.value) : Y.value), Z = d(() => w.aboutMode ? o(F.value) : B.value ? N(B.value, F.value).title ?? B.value.internal_name ?? "" : P("exhibition.theme.overview")), Q = d(() => j(O(R.value)?.display_order ?? 1)), ie = d(() => !V.value?.id || !q.value?.id ? "" : i("themes", `${V.value.id}/${q.value.id}`, F.value).contextual_description ?? ""), $ = d(() => (R.value?.sub_themes ?? []).map((e, t) => ({
247
+ index: t + 1,
248
+ title: N(e, F.value).title ?? e.internal_name ?? "",
249
+ to: s(e)
250
+ }))), oe = d(() => R.value ? s(R.value) : null);
251
+ return (r, i) => V.value ? (y(), f(n, {
252
+ key: 0,
253
+ spec: H.value,
254
+ id: V.value.id,
255
+ class: v(["mwnf-dxa-theme", { "mwnf-dxa-theme--about": t.aboutMode }])
256
+ }, {
257
+ header: E(() => [h("div", je, [Q.value ? (y(), m("span", Me, S(C(P)("exhibition.theme.romanLabel")) + " " + S(Q.value) + " ▪ ", 1)) : p("", !0), g(S(X.value), 1)]), h("div", Ne, S(Z.value), 1)]),
258
+ panel: E(() => [_(ae, {
259
+ pictures: C(U),
260
+ "selected-id": W.value,
261
+ "onUpdate:selectedId": J
262
+ }, null, 8, ["pictures", "selected-id"])]),
263
+ "after-body": E(() => [t.aboutMode ? p("", !0) : (y(), f(ke, {
264
+ key: 0,
265
+ picture: q.value,
266
+ "contextual-description": ie.value,
267
+ onSelect: J
268
+ }, null, 8, ["picture", "contextual-description"]))]),
269
+ navigation: E(({ previous: e, next: t }) => [h("div", Pe, [e ? (y(), f(C(A), {
270
+ key: 0,
271
+ to: C(s)(e),
272
+ class: "mwnf-dxa-theme__tour-link"
273
+ }, {
274
+ default: E(() => [g("← " + S(C(P)("exhibition.theme.previous")), 1)]),
275
+ _: 1
276
+ }, 8, ["to"])) : (y(), m("span", Fe)), t ? (y(), f(C(A), {
277
+ key: 2,
278
+ to: C(s)(t),
279
+ class: "mwnf-dxa-theme__tour-link"
280
+ }, {
281
+ default: E(() => [g(S(C(P)("exhibition.theme.next")) + " " + S(Ve), 1)]),
282
+ _: 1
283
+ }, 8, ["to"])) : p("", !0)]), $.value.length ? (y(), m("div", Ie, [
284
+ h("div", Le, S(C(P)("exhibition.theme.inThisTheme")), 1),
285
+ h("div", Re, [_(C(A), {
286
+ to: oe.value,
287
+ class: v({ "mwnf-dxa-theme__subtheme--current": z.value === null })
288
+ }, {
289
+ default: E(() => [g(S(C(P)("exhibition.theme.overview")), 1)]),
290
+ _: 1
291
+ }, 8, ["to", "class"])]),
292
+ (y(!0), m(u, null, x($.value, (e) => (y(), m("div", {
293
+ key: e.index,
294
+ class: "mwnf-dxa-theme__subtheme"
295
+ }, [_(C(A), {
296
+ to: e.to,
297
+ class: v({ "mwnf-dxa-theme__subtheme--current": z.value === e.index })
298
+ }, {
299
+ default: E(() => [g(S(e.index) + ". " + S(e.title), 1)]),
300
+ _: 2
301
+ }, 1032, ["to", "class"])]))), 128))
302
+ ])) : p("", !0)]),
303
+ after: E(({ next: n }) => [t.aboutMode && n ? (y(), m("div", ze, [i[0] ||= h("span", null, null, -1), _(C(A), {
304
+ to: C(s)(n),
305
+ class: "mwnf-dxa-theme__tour-link"
306
+ }, {
307
+ default: E(() => [g(S(C(P)("exhibition.theme.next")) + " " + S(Ve), 1)]),
308
+ _: 1
309
+ }, 8, ["to"])])) : p("", !0), _(e)]),
310
+ _: 1
311
+ }, 8, [
312
+ "spec",
313
+ "id",
314
+ "class"
315
+ ])) : (y(), m("div", Be, S(C(P)("exhibition.theme.notInExhibition")), 1));
316
+ }
317
+ };
318
+ //#endregion
319
+ export { M as a, ae as i, He as n, ke as r, Ae as t };