@museumwnf/viewer-layout 3.17.1 → 3.18.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-BUvwk7N3.js → FeaturedRecord-MjTQmZFW.js} +1 -1
- package/dist/{ItemDetailView-D-JU7YtR.js → ItemDetailView-B5hE3Oof.js} +4 -4
- package/dist/{MediaGallery-CR-LDrnJ.js → MediaGallery-DeXLadYl.js} +2 -2
- package/dist/{OnDisplayIn-6rySfGfg.js → OnDisplayIn-zdKWIPTZ.js} +1 -1
- package/dist/RecordView-GckO9PmG.js +313 -0
- package/dist/{Theme-Cp33Wfl-.js → Theme-DL9vKuSD.js} +2 -2
- package/dist/{TimelineEventList-DUxaMPx5.js → TimelineEventList-QLk6KLMq.js} +1 -1
- package/dist/{TimelineResultsView-ByYMSCoC.js → TimelineResultsView-COoWXGu4.js} +2 -2
- package/dist/{content-D0P7YuAo.js → content-CzCospyc.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 +5 -3
- package/dist/viewer-layout.css +1 -1
- package/dist/views.js +4 -4
- package/package.json +1 -1
- package/src/tokens.reference.css +7 -0
- package/dist/RecordView-BVwiCyYi.js +0 -276
package/dist/views.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { t as e } from "./FeaturedRecord-
|
|
2
|
-
import { c 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-MjTQmZFW.js";
|
|
2
|
+
import { c as t } from "./TimelineEventList-QLk6KLMq.js";
|
|
3
|
+
import { a as n, i as r, n as i, o as a, r as o, s, t as c } from "./TimelineResultsView-COoWXGu4.js";
|
|
4
|
+
import { t as l } from "./RecordView-GckO9PmG.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.18.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
|
@@ -875,6 +875,13 @@
|
|
|
875
875
|
/* --mwnf-standalone-related-background: transparent; Related Content column */
|
|
876
876
|
/* --mwnf-standalone-related-text: inherit; Its text */
|
|
877
877
|
/* --mwnf-standalone-related-link: inherit; Its links */
|
|
878
|
+
/* --mwnf-standalone-sheet-label-color: #000; The item sheet's labels, a section's heading included */
|
|
879
|
+
/* --mwnf-standalone-sheet-value-color: #222; The item sheet's values, prose and credits */
|
|
880
|
+
/* --mwnf-standalone-sheet-link-color: rgb(1 141 206); Their links */
|
|
881
|
+
/* --mwnf-standalone-download-icon: none; The picture before the Related Content column's Download (a url()) */
|
|
882
|
+
/* --mwnf-standalone-language-bar: transparent; The item sheet's band of record languages */
|
|
883
|
+
/* --mwnf-standalone-language-color: inherit; Its words */
|
|
884
|
+
/* --mwnf-standalone-language-active: transparent; The shown language's ground, and the rule between words */
|
|
878
885
|
/* --mwnf-standalone-related-padding: 0 1.25rem 1.875rem; Its padding */
|
|
879
886
|
/* --mwnf-standalone-related-heading-offset: 1.75rem; Space above its heading */
|
|
880
887
|
/* --mwnf-standalone-related-thumb-size: 3.75rem; Related record thumbnail size */
|
|
@@ -1,276 +0,0 @@
|
|
|
1
|
-
import { a as e, i as t, n, o as r, r as ee, s as te, t as ne, u as re } from "./MediaGallery-CR-LDrnJ.js";
|
|
2
|
-
import { t as ie } from "./GlossaryPopover-B7E6BsjS.js";
|
|
3
|
-
import { Fragment as ae, computed as i, createBlock as a, createCommentVNode as o, createElementBlock as s, createElementVNode as c, createSlots as oe, createTextVNode as se, createVNode as l, guardReactiveProps as u, normalizeClass as ce, normalizeProps as d, openBlock as f, renderList as p, renderSlot as m, toDisplayString as h, unref as g, useSlots as _, withCtx as v } from "vue";
|
|
4
|
-
import { NotFoundView as le, byId as ue, citation as de, creditLine as fe, entityRef as pe, languageLabels as me, pictureCredits as he, picturesInLanguage as ge, renderBlock as y, renderInline as b, renderPlain as x, sheetRows as S, 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";
|
|
5
|
-
import { useRoute as we } from "vue-router";
|
|
6
|
-
//#region src/views/pictureLimit.js
|
|
7
|
-
function C(e, t, n) {
|
|
8
|
-
let r = typeof t == "function" ? t(n) : t;
|
|
9
|
-
return Number.isInteger(r) && r > 0 ? e.slice(0, r) : e;
|
|
10
|
-
}
|
|
11
|
-
//#endregion
|
|
12
|
-
//#region src/views/RecordView.vue
|
|
13
|
-
var Te = ["dir", "innerHTML"], Ee = { class: "mwnf-record__body" }, De = { class: "mwnf-record__main" }, w = {
|
|
14
|
-
key: 1,
|
|
15
|
-
class: "mwnf-record__status"
|
|
16
|
-
}, T = {
|
|
17
|
-
key: 0,
|
|
18
|
-
class: "mwnf-record__aside"
|
|
19
|
-
}, E = {
|
|
20
|
-
key: 2,
|
|
21
|
-
class: "mwnf-record__status"
|
|
22
|
-
}, D = {
|
|
23
|
-
__name: "RecordView",
|
|
24
|
-
props: {
|
|
25
|
-
spec: {
|
|
26
|
-
type: Object,
|
|
27
|
-
required: !0
|
|
28
|
-
},
|
|
29
|
-
id: {
|
|
30
|
-
type: String,
|
|
31
|
-
required: !0
|
|
32
|
-
},
|
|
33
|
-
entity: {
|
|
34
|
-
type: String,
|
|
35
|
-
default: ""
|
|
36
|
-
}
|
|
37
|
-
},
|
|
38
|
-
setup(D) {
|
|
39
|
-
let O = D, { t: k, locale: Oe } = be(), A = ve(), ke = xe(), Ae = _(), je = we(), j = O.spec.entity ?? O.entity, M = i(() => O.spec), Me = pe(j), Ne = ue(j), N = i(() => Ne.value.get(O.id) ?? null), Pe = i(() => Me.value !== null), { language: P, languages: Fe, dir: F, select: I, text: L, ready: R, terms: Ie, glossary: z, attribution: B } = Se(N, {
|
|
40
|
-
entity: j,
|
|
41
|
-
translations: O.spec.translations ?? [],
|
|
42
|
-
attribution: O.spec.attribution ?? []
|
|
43
|
-
}), V = i(() => me(Fe.value)), { active: H, onClick: U, close: Le } = ye(Ie), Re = i(() => H.value ? y(H.value.definition, { breaks: !0 }) : ""), W = (e, t) => A.tr(e, t, P.value, "en"), ze = (e) => A.translations(e, P.value), G = i(() => ({
|
|
44
|
-
record: N.value,
|
|
45
|
-
text: L.value,
|
|
46
|
-
language: P.value,
|
|
47
|
-
languages: V.value,
|
|
48
|
-
select: I,
|
|
49
|
-
dir: F.value,
|
|
50
|
-
glossary: z.value,
|
|
51
|
-
ready: R.value,
|
|
52
|
-
attribution: B.value,
|
|
53
|
-
t: k,
|
|
54
|
-
tr: W,
|
|
55
|
-
translations: ze
|
|
56
|
-
}));
|
|
57
|
-
function K(e) {
|
|
58
|
-
return ((typeof e == "function" ? e(G.value) : e) ?? []).map((e) => ({
|
|
59
|
-
...e,
|
|
60
|
-
label: e.label ? k(e.label) : ""
|
|
61
|
-
}));
|
|
62
|
-
}
|
|
63
|
-
let Be = i(() => N.value ? S(K(M.value.fields), G.value) : []), Ve = i(() => N.value ? S(K(M.value.sections).map((e) => ({
|
|
64
|
-
render: "block",
|
|
65
|
-
...e
|
|
66
|
-
})), G.value) : []), q = i(() => M.value.shortDescription === !1 ? "" : M.value.shortDescription ?? "short_description"), He = i(() => {
|
|
67
|
-
let e = q.value ? L.value[q.value] : "";
|
|
68
|
-
return e ? { html: y(String(e), {
|
|
69
|
-
breaks: !0,
|
|
70
|
-
glossary: z.value
|
|
71
|
-
}) } : null;
|
|
72
|
-
}), Ue = i(() => {
|
|
73
|
-
if (!N.value) return "";
|
|
74
|
-
if (M.value.title) return M.value.title(G.value);
|
|
75
|
-
let e = L.value.name ?? N.value.internal_name ?? N.value.id;
|
|
76
|
-
return b(String(e), { glossary: z.value });
|
|
77
|
-
}), J = i(() => N.value ? C(We(), M.value.pictureLimit, G.value) : []);
|
|
78
|
-
function We() {
|
|
79
|
-
if (M.value.media) return M.value.media(N.value, G.value);
|
|
80
|
-
let e = x(String(L.value.name ?? N.value.internal_name ?? ""));
|
|
81
|
-
return ge(N.value.images, P.value).map((t) => ({
|
|
82
|
-
url: t.url,
|
|
83
|
-
alt: t.captions?.[P.value] ?? e,
|
|
84
|
-
caption: t.captions?.[P.value] ?? "",
|
|
85
|
-
...he(t, P.value)
|
|
86
|
-
}));
|
|
87
|
-
}
|
|
88
|
-
let Ge = [
|
|
89
|
-
{
|
|
90
|
-
field: "author",
|
|
91
|
-
label: "sheet.field.preparedBy"
|
|
92
|
-
},
|
|
93
|
-
{
|
|
94
|
-
field: "copy_editor",
|
|
95
|
-
label: "sheet.field.copyeditedBy"
|
|
96
|
-
},
|
|
97
|
-
{
|
|
98
|
-
field: "translator",
|
|
99
|
-
label: "sheet.field.translationBy"
|
|
100
|
-
},
|
|
101
|
-
{
|
|
102
|
-
field: "translation_copy_editor",
|
|
103
|
-
label: "sheet.field.translationCopyeditedBy"
|
|
104
|
-
}
|
|
105
|
-
];
|
|
106
|
-
function Y(e) {
|
|
107
|
-
let t = M.value.creditNames ? L.value.credit_names?.[e] : null;
|
|
108
|
-
return t?.length ? fe(t) : L.value[e] ?? B.value[e] ?? "";
|
|
109
|
-
}
|
|
110
|
-
let Ke = i(() => (M.value.credits ?? Ge).map(({ field: e, label: t }) => ({
|
|
111
|
-
label: k(t),
|
|
112
|
-
value: Y(e)
|
|
113
|
-
})).filter((e) => e.value)), qe = i(() => String(N.value?.[M.value.workingNumber ?? "mwnf_reference"] ?? "")), X = i(() => {
|
|
114
|
-
let e = M.value.citation;
|
|
115
|
-
if (!N.value || e === !1) return "";
|
|
116
|
-
let t = typeof e?.project == "function" ? null : e?.project ?? N.value.project_id, n = typeof e?.project == "function" ? e.project(N.value, G.value) : ke.label(t), r = e?.permalink === !1 ? void 0 : typeof e?.permalink == "string" ? e.permalink : _e(je) ?? void 0;
|
|
117
|
-
return de({
|
|
118
|
-
author: Y("author") || void 0,
|
|
119
|
-
name: L.value.name ?? N.value.internal_name ?? "",
|
|
120
|
-
project: n,
|
|
121
|
-
permalink: r,
|
|
122
|
-
inWord: k("record.citation.in")
|
|
123
|
-
});
|
|
124
|
-
}), Z = Ce(N, {
|
|
125
|
-
entity: j,
|
|
126
|
-
language: P
|
|
127
|
-
}), Q = i(() => M.value.related === !1 ? null : M.value.related ?? {}), $ = i(() => {
|
|
128
|
-
if (!Q.value) return [];
|
|
129
|
-
let e = Q.value.record ?? Je;
|
|
130
|
-
return Z.value.inPackage.map((t) => e(t, G.value));
|
|
131
|
-
});
|
|
132
|
-
function Je({ record: e, justification: t }) {
|
|
133
|
-
let n = W(j, e.id).name ?? e.internal_name ?? e.id;
|
|
134
|
-
return {
|
|
135
|
-
id: e.id,
|
|
136
|
-
image: e.images?.[0]?.url ?? "",
|
|
137
|
-
imageAlt: x(String(n)),
|
|
138
|
-
name: b(String(n)),
|
|
139
|
-
meta: t ? [t] : [],
|
|
140
|
-
badge: e.type ?? "",
|
|
141
|
-
to: {
|
|
142
|
-
name: M.value.route ?? (O.entity ? `${O.entity}-detail` : "item"),
|
|
143
|
-
params: { id: e.id }
|
|
144
|
-
}
|
|
145
|
-
};
|
|
146
|
-
}
|
|
147
|
-
let Ye = /* @__PURE__ */ new Set([
|
|
148
|
-
"header",
|
|
149
|
-
"before-sheet",
|
|
150
|
-
"after-sheet",
|
|
151
|
-
"aside",
|
|
152
|
-
"source",
|
|
153
|
-
"related",
|
|
154
|
-
"after",
|
|
155
|
-
"default"
|
|
156
|
-
]), Xe = i(() => Object.keys(Ae).filter((e) => !Ye.has(e)));
|
|
157
|
-
return (i, _) => Pe.value && !N.value ? (f(), a(g(le), { key: 0 })) : N.value ? (f(), s("article", {
|
|
158
|
-
key: 1,
|
|
159
|
-
class: ce(["mwnf-record", { "mwnf-record--spaced": M.value.spaced }]),
|
|
160
|
-
onClick: _[0] ||= (...e) => g(U) && g(U)(...e)
|
|
161
|
-
}, [
|
|
162
|
-
m(i.$slots, "header", d(u(G.value)), () => [
|
|
163
|
-
M.value.back ? (f(), a(re, {
|
|
164
|
-
key: 0,
|
|
165
|
-
class: "mwnf-record__back",
|
|
166
|
-
to: M.value.back.to,
|
|
167
|
-
href: M.value.back.href
|
|
168
|
-
}, {
|
|
169
|
-
default: v(() => [se("← " + h(g(k)(M.value.back.label)), 1)]),
|
|
170
|
-
_: 1
|
|
171
|
-
}, 8, ["to", "href"])) : o("", !0),
|
|
172
|
-
l(te, {
|
|
173
|
-
languages: V.value,
|
|
174
|
-
language: g(P),
|
|
175
|
-
onSelect: g(I)
|
|
176
|
-
}, null, 8, [
|
|
177
|
-
"languages",
|
|
178
|
-
"language",
|
|
179
|
-
"onSelect"
|
|
180
|
-
]),
|
|
181
|
-
c("h1", {
|
|
182
|
-
class: "mwnf-record__title",
|
|
183
|
-
dir: g(F) || void 0,
|
|
184
|
-
innerHTML: Ue.value
|
|
185
|
-
}, null, 8, Te)
|
|
186
|
-
]),
|
|
187
|
-
c("div", Ee, [c("div", De, [
|
|
188
|
-
J.value.length ? (f(), a(ne, {
|
|
189
|
-
key: 0,
|
|
190
|
-
images: J.value,
|
|
191
|
-
variant: M.value.mediaVariant ?? ""
|
|
192
|
-
}, null, 8, ["images", "variant"])) : o("", !0),
|
|
193
|
-
g(R) ? o("", !0) : (f(), s("p", w, h(g(k)("core.status.loading")), 1)),
|
|
194
|
-
m(i.$slots, "before-sheet", d(u(G.value))),
|
|
195
|
-
l(r, {
|
|
196
|
-
rows: Be.value,
|
|
197
|
-
layout: M.value.layout ?? "table",
|
|
198
|
-
dir: g(F),
|
|
199
|
-
"short-description": He.value,
|
|
200
|
-
"short-description-after": M.value.shortDescriptionAfter ?? "description"
|
|
201
|
-
}, oe({ _: 2 }, [p(Xe.value, (e) => ({
|
|
202
|
-
name: e,
|
|
203
|
-
fn: v((t) => [m(i.$slots, e, d(u({
|
|
204
|
-
...t,
|
|
205
|
-
...G.value
|
|
206
|
-
})))])
|
|
207
|
-
}))]), 1032, [
|
|
208
|
-
"rows",
|
|
209
|
-
"layout",
|
|
210
|
-
"dir",
|
|
211
|
-
"short-description",
|
|
212
|
-
"short-description-after"
|
|
213
|
-
]),
|
|
214
|
-
(f(!0), s(ae, null, p(Ve.value, (t) => (f(), a(e, {
|
|
215
|
-
key: t.key,
|
|
216
|
-
heading: t.label,
|
|
217
|
-
html: t.html,
|
|
218
|
-
dir: g(F)
|
|
219
|
-
}, null, 8, [
|
|
220
|
-
"heading",
|
|
221
|
-
"html",
|
|
222
|
-
"dir"
|
|
223
|
-
]))), 128)),
|
|
224
|
-
m(i.$slots, "after-sheet", d(u(G.value))),
|
|
225
|
-
l(t, {
|
|
226
|
-
credits: Ke.value,
|
|
227
|
-
"working-number": qe.value,
|
|
228
|
-
"working-number-label": g(k)("sheet.field.workingNumber"),
|
|
229
|
-
citation: X.value,
|
|
230
|
-
"citation-heading": M.value.citation?.heading ? g(k)(M.value.citation.heading) : ""
|
|
231
|
-
}, null, 8, [
|
|
232
|
-
"credits",
|
|
233
|
-
"working-number",
|
|
234
|
-
"working-number-label",
|
|
235
|
-
"citation",
|
|
236
|
-
"citation-heading"
|
|
237
|
-
]),
|
|
238
|
-
m(i.$slots, "source", d(u(G.value)), () => [l(ee)]),
|
|
239
|
-
m(i.$slots, "related", d(u({
|
|
240
|
-
...G.value,
|
|
241
|
-
records: $.value,
|
|
242
|
-
outside: g(Z).outside
|
|
243
|
-
})), () => [Q.value ? (f(), a(n, {
|
|
244
|
-
key: 0,
|
|
245
|
-
heading: g(k)(Q.value.heading ?? "record.related.items"),
|
|
246
|
-
records: $.value,
|
|
247
|
-
variant: Q.value.variant ?? "list",
|
|
248
|
-
"action-label": Q.value.actionLabel ? g(k)(Q.value.actionLabel) : ""
|
|
249
|
-
}, null, 8, [
|
|
250
|
-
"heading",
|
|
251
|
-
"records",
|
|
252
|
-
"variant",
|
|
253
|
-
"action-label"
|
|
254
|
-
])) : o("", !0)])
|
|
255
|
-
]), i.$slots.aside ? (f(), s("aside", T, [m(i.$slots, "aside", d(u({
|
|
256
|
-
...G.value,
|
|
257
|
-
records: $.value,
|
|
258
|
-
outside: g(Z).outside
|
|
259
|
-
})))])) : o("", !0)]),
|
|
260
|
-
m(i.$slots, "after", d(u(G.value))),
|
|
261
|
-
l(ie, {
|
|
262
|
-
term: g(H),
|
|
263
|
-
html: Re.value,
|
|
264
|
-
dir: g(F),
|
|
265
|
-
onClose: g(Le)
|
|
266
|
-
}, null, 8, [
|
|
267
|
-
"term",
|
|
268
|
-
"html",
|
|
269
|
-
"dir",
|
|
270
|
-
"onClose"
|
|
271
|
-
])
|
|
272
|
-
], 2)) : (f(), s("p", E, h(g(k)("core.status.loading")), 1));
|
|
273
|
-
}
|
|
274
|
-
};
|
|
275
|
-
//#endregion
|
|
276
|
-
export { C as n, D as t };
|