@museumwnf/viewer-layout 3.22.1 → 3.24.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/dist/{FeaturedRecord-CNRUaZBY.js → FeaturedRecord-B7lsvwkg.js} +1 -1
- package/dist/{ItemDetailView-5t8skbHY.js → ItemDetailView-C6SA1n2H.js} +4 -4
- package/dist/{OnDisplayIn-DdqVmd4F.js → OnDisplayIn-CNcO6eW1.js} +1 -1
- package/dist/{PartnerMap-BozCpzY8.js → PartnerMap-CXbA_EFo.js} +73 -44
- package/dist/RecordView-CF_bGx8F.js +343 -0
- package/dist/{Theme-CUxHnUlI.js → Theme-D0eDKMW2.js} +2 -2
- package/dist/{TimelineEventList-B_lhlQOG.js → TimelineEventList-hN-ewFEl.js} +1 -1
- package/dist/{TimelineResultsView-D63r1Vjq.js → TimelineResultsView-BHJm5lkm.js} +2 -2
- package/dist/{content-DzEj-kdq.js → content-D-dzl72f.js} +2 -2
- package/dist/content.js +5 -5
- package/dist/dxa.js +8 -8
- package/dist/index.js +5 -5
- package/dist/standalone.js +2 -2
- package/dist/viewer-layout.css +1 -1
- package/dist/views.js +4 -4
- package/package.json +1 -1
- package/src/tokens.reference.css +9 -0
- package/dist/RecordView-Bi53L29_.js +0 -313
package/dist/views.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { t as e } from "./FeaturedRecord-
|
|
2
|
-
import { s as t } from "./TimelineEventList-
|
|
3
|
-
import { a as n, i as r, n as i, o as a, r as o, s, t as c } from "./TimelineResultsView-
|
|
4
|
-
import { t as l } from "./RecordView-
|
|
1
|
+
import { t as e } from "./FeaturedRecord-B7lsvwkg.js";
|
|
2
|
+
import { s as t } from "./TimelineEventList-hN-ewFEl.js";
|
|
3
|
+
import { a as n, i as r, n as i, o as a, r as o, s, t as c } from "./TimelineResultsView-BHJm5lkm.js";
|
|
4
|
+
import { t as l } from "./RecordView-CF_bGx8F.js";
|
|
5
5
|
import { computed as u, createBlock as d, createCommentVNode as f, createElementBlock as p, createVNode as m, mergeProps as h, normalizeClass as g, openBlock as _, renderSlot as v, toDisplayString as y, unref as b } from "vue";
|
|
6
6
|
import { I18nText as x, renderInline as S, renderPlain as C, useDataPackage as w, useFeaturedRecord as T, useI18n as E, useSiteConfig as D } from "@museumwnf/viewer-core";
|
|
7
7
|
//#region src/views/HomeView.vue
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@museumwnf/viewer-layout",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.24.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",
|
package/src/tokens.reference.css
CHANGED
|
@@ -332,6 +332,15 @@
|
|
|
332
332
|
/* --mwnf-credits-size: 0.75rem; Credits text size */
|
|
333
333
|
/* --mwnf-credits-color: #555555; Credits text color */
|
|
334
334
|
/* --mwnf-credits-gap: 0.25rem 1rem; Gap in the credits list */
|
|
335
|
+
/* --mwnf-credits-biography-width: 25rem; A credited person's biography box: its width */
|
|
336
|
+
/* --mwnf-credits-biography-height: auto; Its height (it scrolls past it) */
|
|
337
|
+
/* --mwnf-credits-biography-padding: 1rem; Its padding */
|
|
338
|
+
/* --mwnf-credits-biography-size: inherit; Its text size */
|
|
339
|
+
/* --mwnf-credits-biography-weight: 400; Its text weight */
|
|
340
|
+
/* --mwnf-credits-biography-line-height: 1.4; Its line height */
|
|
341
|
+
/* --mwnf-credits-biography-text: inherit; Its text colour */
|
|
342
|
+
/* --mwnf-credits-biography-background: background colour; Its ground */
|
|
343
|
+
/* --mwnf-credits-biography-border: 1px solid #dddddd; Its border */
|
|
335
344
|
|
|
336
345
|
/* ---------- Content: ItemDetailView (the DXA item sheet's own blocks) ---------- */
|
|
337
346
|
/* --mwnf-sheet-museum-gap: 0.25rem; Holder text to partner summary */
|
|
@@ -1,313 +0,0 @@
|
|
|
1
|
-
import { a as e, c as t, d as n, i as r, n as i, o as ee, r as te, s as ne } from "./PartnerMap-BozCpzY8.js";
|
|
2
|
-
import { t as re } from "./GlossaryPopover-B7E6BsjS.js";
|
|
3
|
-
import { Fragment as a, computed as o, createBlock as s, createCommentVNode as c, createElementBlock as l, createElementVNode as u, createSlots as ie, createTextVNode as ae, createVNode as d, guardReactiveProps as f, normalizeClass as oe, normalizeProps as p, openBlock as m, ref as h, renderList as g, renderSlot as _, toDisplayString as v, unref as y, useSlots as se, watch as b, withCtx as x } from "vue";
|
|
4
|
-
import { useI18n as S } from "@museumwnf/viewer-core/i18n";
|
|
5
|
-
import { NotFoundView as ce, byId as le, citation as ue, creditLine as de, entityRef as fe, languageLabels as pe, pictureCredits as me, picturesInLanguage as he, renderBlock as ge, renderInline as C, renderPlain as w, sheetRows as T, sourceUrl as _e, useDataPackage as ve, useGlossaryPopup as ye, useI18n as be, useProjects as xe, useRecordSheet as Se, useRelatedRecords as Ce } from "@museumwnf/viewer-core";
|
|
6
|
-
import { useRoute as we } from "vue-router";
|
|
7
|
-
//#region src/content/ShortDescription.vue
|
|
8
|
-
var Te = ["dir"], E = ["aria-expanded"], D = ["innerHTML"], Ee = {
|
|
9
|
-
__name: "ShortDescription",
|
|
10
|
-
props: {
|
|
11
|
-
html: {
|
|
12
|
-
type: String,
|
|
13
|
-
required: !0
|
|
14
|
-
},
|
|
15
|
-
dir: {
|
|
16
|
-
type: String,
|
|
17
|
-
default: void 0
|
|
18
|
-
}
|
|
19
|
-
},
|
|
20
|
-
setup(e) {
|
|
21
|
-
let t = e, { t: n } = S(), r = h(!1);
|
|
22
|
-
return b(() => t.html, () => {
|
|
23
|
-
r.value = !1;
|
|
24
|
-
}), (t, i) => (m(), l("div", {
|
|
25
|
-
class: "mwnf-sheet__short",
|
|
26
|
-
dir: e.dir
|
|
27
|
-
}, [u("button", {
|
|
28
|
-
type: "button",
|
|
29
|
-
class: "mwnf-sheet__toggle",
|
|
30
|
-
"aria-expanded": r.value ? "true" : "false",
|
|
31
|
-
onClick: i[0] ||= (e) => r.value = !r.value
|
|
32
|
-
}, v(r.value ? y(n)("record.action.hideShortDescription") : y(n)("record.action.viewShortDescription")), 9, E), r.value ? (m(), l("div", {
|
|
33
|
-
key: 0,
|
|
34
|
-
class: "mwnf-sheet__block",
|
|
35
|
-
innerHTML: e.html
|
|
36
|
-
}, null, 8, D)) : c("", !0)], 8, Te));
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
|
-
//#endregion
|
|
40
|
-
//#region src/views/pictureLimit.js
|
|
41
|
-
function O(e, t, n) {
|
|
42
|
-
let r = typeof t == "function" ? t(n) : t;
|
|
43
|
-
return Number.isInteger(r) && r > 0 ? e.slice(0, r) : e;
|
|
44
|
-
}
|
|
45
|
-
//#endregion
|
|
46
|
-
//#region src/views/RecordView.vue
|
|
47
|
-
var De = ["dir", "innerHTML"], Oe = { class: "mwnf-record__body" }, ke = { class: "mwnf-record__main" }, Ae = {
|
|
48
|
-
key: 1,
|
|
49
|
-
class: "mwnf-record__status"
|
|
50
|
-
}, je = {
|
|
51
|
-
key: 0,
|
|
52
|
-
class: "mwnf-record__aside"
|
|
53
|
-
}, Me = {
|
|
54
|
-
key: 2,
|
|
55
|
-
class: "mwnf-record__status"
|
|
56
|
-
}, k = {
|
|
57
|
-
__name: "RecordView",
|
|
58
|
-
props: {
|
|
59
|
-
spec: {
|
|
60
|
-
type: Object,
|
|
61
|
-
required: !0
|
|
62
|
-
},
|
|
63
|
-
id: {
|
|
64
|
-
type: String,
|
|
65
|
-
required: !0
|
|
66
|
-
},
|
|
67
|
-
entity: {
|
|
68
|
-
type: String,
|
|
69
|
-
default: ""
|
|
70
|
-
}
|
|
71
|
-
},
|
|
72
|
-
setup(h) {
|
|
73
|
-
let b = h, { t: S, locale: Te } = be(), E = ve(), D = xe(), k = se(), Ne = we(), A = b.spec.entity ?? b.entity, j = o(() => b.spec), Pe = fe(A), Fe = le(A), M = o(() => Fe.value.get(b.id) ?? null), Ie = o(() => Pe.value !== null), { language: N, languages: Le, dir: P, select: F, text: I, ready: L, terms: Re, glossary: R, attribution: z } = Se(M, {
|
|
74
|
-
entity: A,
|
|
75
|
-
translations: b.spec.translations ?? [],
|
|
76
|
-
attribution: b.spec.attribution ?? []
|
|
77
|
-
}), B = o(() => pe(Le.value)), { active: V, onClick: H, close: ze } = ye(Re), Be = o(() => V.value ? ge(V.value.definition, { breaks: !0 }) : ""), U = (e, t) => E.tr(e, t, N.value, "en"), Ve = (e) => E.translations(e, N.value), W = o(() => ({
|
|
78
|
-
record: M.value,
|
|
79
|
-
text: I.value,
|
|
80
|
-
language: N.value,
|
|
81
|
-
languages: B.value,
|
|
82
|
-
select: F,
|
|
83
|
-
dir: P.value,
|
|
84
|
-
glossary: R.value,
|
|
85
|
-
ready: L.value,
|
|
86
|
-
attribution: z.value,
|
|
87
|
-
t: S,
|
|
88
|
-
tr: U,
|
|
89
|
-
translations: Ve
|
|
90
|
-
}));
|
|
91
|
-
function G(e) {
|
|
92
|
-
return ((typeof e == "function" ? e(W.value) : e) ?? []).map((e) => ({
|
|
93
|
-
...e,
|
|
94
|
-
label: e.label ? S(e.label) : ""
|
|
95
|
-
}));
|
|
96
|
-
}
|
|
97
|
-
let K = o(() => M.value ? T(G(j.value.fields), W.value) : []), q = o(() => M.value ? T(G(j.value.sections).map((e) => ({
|
|
98
|
-
render: "block",
|
|
99
|
-
...e
|
|
100
|
-
})), W.value) : []), J = o(() => j.value.shortDescriptionAfter ?? "description"), He = o(() => !K.value.some((e) => e.key === J.value) && q.value.some((e) => e.key === J.value)), Ue = o(() => j.value.shortDescription === !1 ? "" : j.value.shortDescription ?? "short_description"), Y = o(() => {
|
|
101
|
-
let e = Ue.value ? I.value[Ue.value] : "";
|
|
102
|
-
return e ? { html: ge(String(e), {
|
|
103
|
-
breaks: !0,
|
|
104
|
-
glossary: R.value
|
|
105
|
-
}) } : null;
|
|
106
|
-
}), We = o(() => {
|
|
107
|
-
if (!M.value) return "";
|
|
108
|
-
if (j.value.title) return j.value.title(W.value);
|
|
109
|
-
let e = I.value.name ?? M.value.internal_name ?? M.value.id;
|
|
110
|
-
return C(String(e), { glossary: R.value });
|
|
111
|
-
}), Ge = o(() => M.value ? O(Ke(), j.value.pictureLimit, W.value) : []);
|
|
112
|
-
function Ke() {
|
|
113
|
-
if (j.value.media) return j.value.media(M.value, W.value);
|
|
114
|
-
let e = w(String(I.value.name ?? M.value.internal_name ?? ""));
|
|
115
|
-
return he(M.value.images, N.value).map((t) => ({
|
|
116
|
-
url: t.url,
|
|
117
|
-
alt: t.captions?.[N.value] ?? e,
|
|
118
|
-
caption: t.captions?.[N.value] ?? "",
|
|
119
|
-
...me(t, N.value)
|
|
120
|
-
}));
|
|
121
|
-
}
|
|
122
|
-
let qe = [
|
|
123
|
-
{
|
|
124
|
-
field: "author",
|
|
125
|
-
label: "sheet.field.preparedBy"
|
|
126
|
-
},
|
|
127
|
-
{
|
|
128
|
-
field: "copy_editor",
|
|
129
|
-
label: "sheet.field.copyeditedBy"
|
|
130
|
-
},
|
|
131
|
-
{
|
|
132
|
-
field: "translator",
|
|
133
|
-
label: "sheet.field.translationBy"
|
|
134
|
-
},
|
|
135
|
-
{
|
|
136
|
-
field: "translation_copy_editor",
|
|
137
|
-
label: "sheet.field.translationCopyeditedBy"
|
|
138
|
-
}
|
|
139
|
-
];
|
|
140
|
-
function X(e) {
|
|
141
|
-
let t = j.value.creditNames ? I.value.credit_names?.[e] : null;
|
|
142
|
-
return t?.length ? de(t) : I.value[e] ?? z.value[e] ?? "";
|
|
143
|
-
}
|
|
144
|
-
let Je = o(() => (j.value.credits ?? qe).map(({ field: e, label: t }) => ({
|
|
145
|
-
label: S(t),
|
|
146
|
-
value: X(e)
|
|
147
|
-
})).filter((e) => e.value)), Ye = o(() => String(M.value?.[j.value.workingNumber ?? "mwnf_reference"] ?? "")), Xe = o(() => {
|
|
148
|
-
let e = j.value.citation;
|
|
149
|
-
if (!M.value || e === !1) return "";
|
|
150
|
-
let t = typeof e?.project == "function" ? null : e?.project ?? M.value.project_id, n = typeof e?.project == "function" ? e.project(M.value, W.value) : D.label(t), r = e?.permalink === !1 ? void 0 : typeof e?.permalink == "string" ? e.permalink : _e(Ne) ?? void 0;
|
|
151
|
-
return ue({
|
|
152
|
-
author: X("author") || void 0,
|
|
153
|
-
name: I.value.name ?? M.value.internal_name ?? "",
|
|
154
|
-
project: n,
|
|
155
|
-
permalink: r,
|
|
156
|
-
inWord: S("record.citation.in")
|
|
157
|
-
});
|
|
158
|
-
}), Z = Ce(M, {
|
|
159
|
-
entity: A,
|
|
160
|
-
language: N
|
|
161
|
-
}), Q = o(() => j.value.related === !1 ? null : j.value.related ?? {}), $ = o(() => {
|
|
162
|
-
if (!Q.value) return [];
|
|
163
|
-
let e = Q.value.record ?? Ze;
|
|
164
|
-
return Z.value.inPackage.map((t) => e(t, W.value));
|
|
165
|
-
});
|
|
166
|
-
function Ze({ record: e, justification: t }) {
|
|
167
|
-
let n = U(A, e.id).name ?? e.internal_name ?? e.id;
|
|
168
|
-
return {
|
|
169
|
-
id: e.id,
|
|
170
|
-
image: e.images?.[0]?.url ?? "",
|
|
171
|
-
imageAlt: w(String(n)),
|
|
172
|
-
name: C(String(n)),
|
|
173
|
-
meta: t ? [t] : [],
|
|
174
|
-
badge: e.type ?? "",
|
|
175
|
-
to: {
|
|
176
|
-
name: j.value.route ?? (b.entity ? `${b.entity}-detail` : "item"),
|
|
177
|
-
params: { id: e.id }
|
|
178
|
-
}
|
|
179
|
-
};
|
|
180
|
-
}
|
|
181
|
-
let Qe = /* @__PURE__ */ new Set([
|
|
182
|
-
"header",
|
|
183
|
-
"before-sheet",
|
|
184
|
-
"after-sheet",
|
|
185
|
-
"aside",
|
|
186
|
-
"source",
|
|
187
|
-
"related",
|
|
188
|
-
"after",
|
|
189
|
-
"default"
|
|
190
|
-
]), $e = o(() => Object.keys(k).filter((e) => !Qe.has(e)));
|
|
191
|
-
return (o, h) => Ie.value && !M.value ? (m(), s(y(ce), { key: 0 })) : M.value ? (m(), l("article", {
|
|
192
|
-
key: 1,
|
|
193
|
-
class: oe(["mwnf-record", { "mwnf-record--spaced": j.value.spaced }]),
|
|
194
|
-
onClick: h[0] ||= (...e) => y(H) && y(H)(...e)
|
|
195
|
-
}, [
|
|
196
|
-
_(o.$slots, "header", p(f(W.value)), () => [
|
|
197
|
-
j.value.back ? (m(), s(n, {
|
|
198
|
-
key: 0,
|
|
199
|
-
class: "mwnf-record__back",
|
|
200
|
-
to: j.value.back.to,
|
|
201
|
-
href: j.value.back.href
|
|
202
|
-
}, {
|
|
203
|
-
default: x(() => [ae("← " + v(y(S)(j.value.back.label)), 1)]),
|
|
204
|
-
_: 1
|
|
205
|
-
}, 8, ["to", "href"])) : c("", !0),
|
|
206
|
-
d(t, {
|
|
207
|
-
languages: B.value,
|
|
208
|
-
language: y(N),
|
|
209
|
-
onSelect: y(F)
|
|
210
|
-
}, null, 8, [
|
|
211
|
-
"languages",
|
|
212
|
-
"language",
|
|
213
|
-
"onSelect"
|
|
214
|
-
]),
|
|
215
|
-
u("h1", {
|
|
216
|
-
class: "mwnf-record__title",
|
|
217
|
-
dir: y(P) || void 0,
|
|
218
|
-
innerHTML: We.value
|
|
219
|
-
}, null, 8, De)
|
|
220
|
-
]),
|
|
221
|
-
u("div", Oe, [u("div", ke, [
|
|
222
|
-
Ge.value.length ? (m(), s(i, {
|
|
223
|
-
key: 0,
|
|
224
|
-
images: Ge.value,
|
|
225
|
-
variant: j.value.mediaVariant ?? ""
|
|
226
|
-
}, null, 8, ["images", "variant"])) : c("", !0),
|
|
227
|
-
y(L) ? c("", !0) : (m(), l("p", Ae, v(y(S)("core.status.loading")), 1)),
|
|
228
|
-
_(o.$slots, "before-sheet", p(f(W.value))),
|
|
229
|
-
d(ne, {
|
|
230
|
-
rows: K.value,
|
|
231
|
-
layout: j.value.layout ?? "table",
|
|
232
|
-
dir: y(P),
|
|
233
|
-
"short-description": Y.value,
|
|
234
|
-
"short-description-after": J.value
|
|
235
|
-
}, ie({ _: 2 }, [g($e.value, (e) => ({
|
|
236
|
-
name: e,
|
|
237
|
-
fn: x((t) => [_(o.$slots, e, p(f({
|
|
238
|
-
...t,
|
|
239
|
-
...W.value
|
|
240
|
-
})))])
|
|
241
|
-
}))]), 1032, [
|
|
242
|
-
"rows",
|
|
243
|
-
"layout",
|
|
244
|
-
"dir",
|
|
245
|
-
"short-description",
|
|
246
|
-
"short-description-after"
|
|
247
|
-
]),
|
|
248
|
-
(m(!0), l(a, null, g(q.value, (e) => (m(), l(a, { key: e.key }, [d(ee, {
|
|
249
|
-
heading: e.label,
|
|
250
|
-
html: e.html,
|
|
251
|
-
dir: y(P)
|
|
252
|
-
}, null, 8, [
|
|
253
|
-
"heading",
|
|
254
|
-
"html",
|
|
255
|
-
"dir"
|
|
256
|
-
]), Y.value && He.value && e.key === J.value ? (m(), s(Ee, {
|
|
257
|
-
key: 0,
|
|
258
|
-
html: Y.value.html,
|
|
259
|
-
dir: y(P)
|
|
260
|
-
}, null, 8, ["html", "dir"])) : c("", !0)], 64))), 128)),
|
|
261
|
-
_(o.$slots, "after-sheet", p(f(W.value))),
|
|
262
|
-
d(e, {
|
|
263
|
-
credits: Je.value,
|
|
264
|
-
"working-number": Ye.value,
|
|
265
|
-
"working-number-label": y(S)(j.value.workingNumberLabel ?? "sheet.field.workingNumber"),
|
|
266
|
-
citation: Xe.value,
|
|
267
|
-
"citation-heading": j.value.citation?.heading ? y(S)(j.value.citation.heading) : ""
|
|
268
|
-
}, null, 8, [
|
|
269
|
-
"credits",
|
|
270
|
-
"working-number",
|
|
271
|
-
"working-number-label",
|
|
272
|
-
"citation",
|
|
273
|
-
"citation-heading"
|
|
274
|
-
]),
|
|
275
|
-
_(o.$slots, "source", p(f(W.value)), () => [d(r)]),
|
|
276
|
-
_(o.$slots, "related", p(f({
|
|
277
|
-
...W.value,
|
|
278
|
-
records: $.value,
|
|
279
|
-
outside: y(Z).outside
|
|
280
|
-
})), () => [Q.value ? (m(), s(te, {
|
|
281
|
-
key: 0,
|
|
282
|
-
heading: y(S)(Q.value.heading ?? "record.related.items"),
|
|
283
|
-
records: $.value,
|
|
284
|
-
variant: Q.value.variant ?? "list",
|
|
285
|
-
"action-label": Q.value.actionLabel ? y(S)(Q.value.actionLabel) : ""
|
|
286
|
-
}, null, 8, [
|
|
287
|
-
"heading",
|
|
288
|
-
"records",
|
|
289
|
-
"variant",
|
|
290
|
-
"action-label"
|
|
291
|
-
])) : c("", !0)])
|
|
292
|
-
]), o.$slots.aside ? (m(), l("aside", je, [_(o.$slots, "aside", p(f({
|
|
293
|
-
...W.value,
|
|
294
|
-
records: $.value,
|
|
295
|
-
outside: y(Z).outside
|
|
296
|
-
})))])) : c("", !0)]),
|
|
297
|
-
_(o.$slots, "after", p(f(W.value))),
|
|
298
|
-
d(re, {
|
|
299
|
-
term: y(V),
|
|
300
|
-
html: Be.value,
|
|
301
|
-
dir: y(P),
|
|
302
|
-
onClose: y(ze)
|
|
303
|
-
}, null, 8, [
|
|
304
|
-
"term",
|
|
305
|
-
"html",
|
|
306
|
-
"dir",
|
|
307
|
-
"onClose"
|
|
308
|
-
])
|
|
309
|
-
], 2)) : (m(), l("p", Me, v(y(S)("core.status.loading")), 1));
|
|
310
|
-
}
|
|
311
|
-
};
|
|
312
|
-
//#endregion
|
|
313
|
-
export { O as n, k as t };
|