@museumwnf/viewer-layout 3.8.0 → 3.10.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/{ItemDetailView-CzSe_jZn.js → ItemDetailView-CzIquvf7.js} +9 -4
- package/dist/{OnDisplayIn-BfJoPonn.js → OnDisplayIn-2ctLMfvw.js} +1 -3
- package/dist/RecordView-BvKoAB2j.js +275 -0
- package/dist/{SiteShell-CXMfLqzq.js → SiteShell-DmKiH3jM.js} +1 -1
- package/dist/{Theme-tF4wOaNa.js → Theme-pxrmYfo-.js} +2 -2
- package/dist/{chrome-i1DOEyLS.js → chrome-Co3f_Shw.js} +2 -1
- package/dist/components.js +1 -1
- package/dist/{content-C6oMa4eE.js → content-Cu_44di8.js} +6 -2
- package/dist/content.js +2 -2
- package/dist/{data-CCcDVsTG.js → data-Dz9REf19.js} +1 -1
- package/dist/{data-CGFEbGab.js → data-d30zAska.js} +1 -1
- package/dist/dxa.js +75 -73
- package/dist/index.js +3 -3
- package/dist/standalone.js +233 -230
- package/dist/{themeSpecs-C2Y2abxd.js → themeSpecs-CXVCN8UV.js} +1 -1
- package/dist/views.js +1 -1
- package/package.json +3 -3
- package/dist/RecordView-DovgfTMz.js +0 -263
package/dist/views.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as e } from "./FeaturedRecord-DJfyvfqt.js";
|
|
2
2
|
import { c as t } from "./TimelineEventList-gsoc-SBx.js";
|
|
3
3
|
import { a as n, i as r, n as i, o as a, r as o, s, t as c } from "./TimelineResultsView-C2-TnM71.js";
|
|
4
|
-
import { t as l } from "./RecordView-
|
|
4
|
+
import { t as l } from "./RecordView-BvKoAB2j.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.10.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",
|
|
@@ -42,12 +42,12 @@
|
|
|
42
42
|
"test": "vitest run"
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|
|
45
|
-
"@museumwnf/viewer-core": "^2.
|
|
45
|
+
"@museumwnf/viewer-core": "^2.10.0",
|
|
46
46
|
"vue": "^3.5.0",
|
|
47
47
|
"vue-router": "^4.5.0 || ^5.0.0"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
|
-
"@museumwnf/viewer-core": "^2.
|
|
50
|
+
"@museumwnf/viewer-core": "^2.10.0",
|
|
51
51
|
"@vitejs/plugin-vue": "^6.0.8",
|
|
52
52
|
"@vue/test-utils": "^2.4.11",
|
|
53
53
|
"jsdom": "^30.0.1",
|
|
@@ -1,263 +0,0 @@
|
|
|
1
|
-
import { a as e, c as t, d as n, i as r, n as ee, o as te, r as ne, s as re, t as ie } from "./GlossaryPopover-DcptyNWI.js";
|
|
2
|
-
import { Fragment as i, computed as a, createBlock as o, createCommentVNode as s, createElementBlock as c, createElementVNode as l, createSlots as u, createTextVNode as d, createVNode as f, guardReactiveProps as p, normalizeClass as ae, normalizeProps as m, openBlock as h, renderList as g, renderSlot as _, toDisplayString as v, unref as y, useSlots as b, withCtx as x } from "vue";
|
|
3
|
-
import { NotFoundView as oe, byId as se, citation as ce, entityRef as le, languageLabels as ue, pictureCredits as de, renderBlock as S, renderInline as C, renderPlain as w, sheetRows as T, sourceUrl as fe, useDataPackage as pe, useGlossaryPopup as me, useI18n as he, useProjects as ge, useRecordSheet as _e, useRelatedRecords as ve } from "@museumwnf/viewer-core";
|
|
4
|
-
import { useRoute as ye } from "vue-router";
|
|
5
|
-
//#region src/views/RecordView.vue
|
|
6
|
-
var be = ["dir", "innerHTML"], xe = { class: "mwnf-record__body" }, E = { class: "mwnf-record__main" }, Se = {
|
|
7
|
-
key: 1,
|
|
8
|
-
class: "mwnf-record__status"
|
|
9
|
-
}, D = {
|
|
10
|
-
key: 0,
|
|
11
|
-
class: "mwnf-record__aside"
|
|
12
|
-
}, O = {
|
|
13
|
-
key: 2,
|
|
14
|
-
class: "mwnf-record__status"
|
|
15
|
-
}, k = {
|
|
16
|
-
__name: "RecordView",
|
|
17
|
-
props: {
|
|
18
|
-
spec: {
|
|
19
|
-
type: Object,
|
|
20
|
-
required: !0
|
|
21
|
-
},
|
|
22
|
-
id: {
|
|
23
|
-
type: String,
|
|
24
|
-
required: !0
|
|
25
|
-
},
|
|
26
|
-
entity: {
|
|
27
|
-
type: String,
|
|
28
|
-
default: ""
|
|
29
|
-
}
|
|
30
|
-
},
|
|
31
|
-
setup(k) {
|
|
32
|
-
let A = k, { t: j, locale: Ce } = he(), M = pe(), we = ge(), Te = b(), Ee = ye(), N = A.spec.entity ?? A.entity, P = a(() => A.spec), De = le(N), Oe = se(N), F = a(() => Oe.value.get(A.id) ?? null), ke = a(() => De.value !== null), { language: I, languages: Ae, dir: L, select: R, text: z, ready: B, terms: je, glossary: V, attribution: H } = _e(F, {
|
|
33
|
-
entity: N,
|
|
34
|
-
translations: A.spec.translations ?? [],
|
|
35
|
-
attribution: A.spec.attribution ?? []
|
|
36
|
-
}), U = a(() => ue(Ae.value)), { active: W, onClick: G, close: Me } = me(je), Ne = a(() => W.value ? S(W.value.definition, { breaks: !0 }) : ""), K = (e, t) => M.tr(e, t, I.value, "en"), Pe = (e) => M.translations(e, I.value), q = a(() => ({
|
|
37
|
-
record: F.value,
|
|
38
|
-
text: z.value,
|
|
39
|
-
language: I.value,
|
|
40
|
-
languages: U.value,
|
|
41
|
-
select: R,
|
|
42
|
-
dir: L.value,
|
|
43
|
-
glossary: V.value,
|
|
44
|
-
ready: B.value,
|
|
45
|
-
attribution: H.value,
|
|
46
|
-
t: j,
|
|
47
|
-
tr: K,
|
|
48
|
-
translations: Pe
|
|
49
|
-
}));
|
|
50
|
-
function J(e) {
|
|
51
|
-
return ((typeof e == "function" ? e(q.value) : e) ?? []).map((e) => ({
|
|
52
|
-
...e,
|
|
53
|
-
label: e.label ? j(e.label) : ""
|
|
54
|
-
}));
|
|
55
|
-
}
|
|
56
|
-
let Fe = a(() => F.value ? T(J(P.value.fields), q.value) : []), Ie = a(() => F.value ? T(J(P.value.sections).map((e) => ({
|
|
57
|
-
render: "block",
|
|
58
|
-
...e
|
|
59
|
-
})), q.value) : []), Y = a(() => P.value.shortDescription === !1 ? "" : P.value.shortDescription ?? "short_description"), Le = a(() => {
|
|
60
|
-
let e = Y.value ? z.value[Y.value] : "";
|
|
61
|
-
return e ? { html: S(String(e), {
|
|
62
|
-
breaks: !0,
|
|
63
|
-
glossary: V.value
|
|
64
|
-
}) } : null;
|
|
65
|
-
}), Re = a(() => {
|
|
66
|
-
if (!F.value) return "";
|
|
67
|
-
if (P.value.title) return P.value.title(q.value);
|
|
68
|
-
let e = z.value.name ?? F.value.internal_name ?? F.value.id;
|
|
69
|
-
return C(String(e), { glossary: V.value });
|
|
70
|
-
}), X = a(() => {
|
|
71
|
-
if (!F.value) return [];
|
|
72
|
-
if (P.value.media) return P.value.media(F.value, q.value);
|
|
73
|
-
let e = w(String(z.value.name ?? F.value.internal_name ?? ""));
|
|
74
|
-
return (F.value.images ?? []).map((t) => ({
|
|
75
|
-
url: t.url,
|
|
76
|
-
alt: t.captions?.[I.value] ?? e,
|
|
77
|
-
caption: t.captions?.[I.value] ?? "",
|
|
78
|
-
...de(t, I.value)
|
|
79
|
-
}));
|
|
80
|
-
}), ze = [
|
|
81
|
-
{
|
|
82
|
-
field: "author",
|
|
83
|
-
label: "sheet.field.preparedBy"
|
|
84
|
-
},
|
|
85
|
-
{
|
|
86
|
-
field: "copy_editor",
|
|
87
|
-
label: "sheet.field.copyeditedBy"
|
|
88
|
-
},
|
|
89
|
-
{
|
|
90
|
-
field: "translator",
|
|
91
|
-
label: "sheet.field.translationBy"
|
|
92
|
-
},
|
|
93
|
-
{
|
|
94
|
-
field: "translation_copy_editor",
|
|
95
|
-
label: "sheet.field.translationCopyeditedBy"
|
|
96
|
-
}
|
|
97
|
-
], Be = a(() => (P.value.credits ?? ze).map(({ field: e, label: t }) => ({
|
|
98
|
-
label: j(t),
|
|
99
|
-
value: z.value[e] ?? H.value[e] ?? ""
|
|
100
|
-
})).filter((e) => e.value)), Ve = a(() => String(F.value?.[P.value.workingNumber ?? "mwnf_reference"] ?? "")), He = a(() => {
|
|
101
|
-
let e = P.value.citation;
|
|
102
|
-
if (!F.value || e === !1) return "";
|
|
103
|
-
let t = typeof e?.project == "function" ? null : e?.project ?? F.value.project_id, n = typeof e?.project == "function" ? e.project(F.value, q.value) : we.label(t), r = e?.permalink === !1 ? void 0 : typeof e?.permalink == "string" ? e.permalink : fe(Ee) ?? void 0;
|
|
104
|
-
return ce({
|
|
105
|
-
author: z.value.author ?? H.value.author,
|
|
106
|
-
name: z.value.name ?? F.value.internal_name ?? "",
|
|
107
|
-
project: n,
|
|
108
|
-
permalink: r,
|
|
109
|
-
inWord: j("record.citation.in")
|
|
110
|
-
});
|
|
111
|
-
}), Z = ve(F, {
|
|
112
|
-
entity: N,
|
|
113
|
-
language: I
|
|
114
|
-
}), Q = a(() => P.value.related === !1 ? null : P.value.related ?? {}), $ = a(() => {
|
|
115
|
-
if (!Q.value) return [];
|
|
116
|
-
let e = Q.value.record ?? Ue;
|
|
117
|
-
return Z.value.inPackage.map((t) => e(t, q.value));
|
|
118
|
-
});
|
|
119
|
-
function Ue({ record: e, justification: t }) {
|
|
120
|
-
let n = K(N, e.id).name ?? e.internal_name ?? e.id;
|
|
121
|
-
return {
|
|
122
|
-
id: e.id,
|
|
123
|
-
image: e.images?.[0]?.url ?? "",
|
|
124
|
-
imageAlt: w(String(n)),
|
|
125
|
-
name: C(String(n)),
|
|
126
|
-
meta: t ? [t] : [],
|
|
127
|
-
badge: e.type ?? "",
|
|
128
|
-
to: {
|
|
129
|
-
name: P.value.route ?? (A.entity ? `${A.entity}-detail` : "item"),
|
|
130
|
-
params: { id: e.id }
|
|
131
|
-
}
|
|
132
|
-
};
|
|
133
|
-
}
|
|
134
|
-
let We = /* @__PURE__ */ new Set([
|
|
135
|
-
"header",
|
|
136
|
-
"before-sheet",
|
|
137
|
-
"after-sheet",
|
|
138
|
-
"aside",
|
|
139
|
-
"source",
|
|
140
|
-
"related",
|
|
141
|
-
"after",
|
|
142
|
-
"default"
|
|
143
|
-
]), Ge = a(() => Object.keys(Te).filter((e) => !We.has(e)));
|
|
144
|
-
return (a, b) => ke.value && !F.value ? (h(), o(y(oe), { key: 0 })) : F.value ? (h(), c("article", {
|
|
145
|
-
key: 1,
|
|
146
|
-
class: ae(["mwnf-record", { "mwnf-record--spaced": P.value.spaced }]),
|
|
147
|
-
onClick: b[0] ||= (...e) => y(G) && y(G)(...e)
|
|
148
|
-
}, [
|
|
149
|
-
_(a.$slots, "header", m(p(q.value)), () => [
|
|
150
|
-
P.value.back ? (h(), o(n, {
|
|
151
|
-
key: 0,
|
|
152
|
-
class: "mwnf-record__back",
|
|
153
|
-
to: P.value.back.to,
|
|
154
|
-
href: P.value.back.href
|
|
155
|
-
}, {
|
|
156
|
-
default: x(() => [d("← " + v(y(j)(P.value.back.label)), 1)]),
|
|
157
|
-
_: 1
|
|
158
|
-
}, 8, ["to", "href"])) : s("", !0),
|
|
159
|
-
f(t, {
|
|
160
|
-
languages: U.value,
|
|
161
|
-
language: y(I),
|
|
162
|
-
onSelect: y(R)
|
|
163
|
-
}, null, 8, [
|
|
164
|
-
"languages",
|
|
165
|
-
"language",
|
|
166
|
-
"onSelect"
|
|
167
|
-
]),
|
|
168
|
-
l("h1", {
|
|
169
|
-
class: "mwnf-record__title",
|
|
170
|
-
dir: y(L) || void 0,
|
|
171
|
-
innerHTML: Re.value
|
|
172
|
-
}, null, 8, be)
|
|
173
|
-
]),
|
|
174
|
-
l("div", xe, [l("div", E, [
|
|
175
|
-
X.value.length ? (h(), o(ee, {
|
|
176
|
-
key: 0,
|
|
177
|
-
images: X.value,
|
|
178
|
-
variant: P.value.mediaVariant ?? ""
|
|
179
|
-
}, null, 8, ["images", "variant"])) : s("", !0),
|
|
180
|
-
y(B) ? s("", !0) : (h(), c("p", Se, v(y(j)("core.status.loading")), 1)),
|
|
181
|
-
_(a.$slots, "before-sheet", m(p(q.value))),
|
|
182
|
-
f(re, {
|
|
183
|
-
rows: Fe.value,
|
|
184
|
-
layout: P.value.layout ?? "table",
|
|
185
|
-
dir: y(L),
|
|
186
|
-
"short-description": Le.value,
|
|
187
|
-
"short-description-after": P.value.shortDescriptionAfter ?? "description"
|
|
188
|
-
}, u({ _: 2 }, [g(Ge.value, (e) => ({
|
|
189
|
-
name: e,
|
|
190
|
-
fn: x((t) => [_(a.$slots, e, m(p({
|
|
191
|
-
...t,
|
|
192
|
-
...q.value
|
|
193
|
-
})))])
|
|
194
|
-
}))]), 1032, [
|
|
195
|
-
"rows",
|
|
196
|
-
"layout",
|
|
197
|
-
"dir",
|
|
198
|
-
"short-description",
|
|
199
|
-
"short-description-after"
|
|
200
|
-
]),
|
|
201
|
-
(h(!0), c(i, null, g(Ie.value, (e) => (h(), o(te, {
|
|
202
|
-
key: e.key,
|
|
203
|
-
heading: e.label,
|
|
204
|
-
html: e.html,
|
|
205
|
-
dir: y(L)
|
|
206
|
-
}, null, 8, [
|
|
207
|
-
"heading",
|
|
208
|
-
"html",
|
|
209
|
-
"dir"
|
|
210
|
-
]))), 128)),
|
|
211
|
-
_(a.$slots, "after-sheet", m(p(q.value))),
|
|
212
|
-
f(e, {
|
|
213
|
-
credits: Be.value,
|
|
214
|
-
"working-number": Ve.value,
|
|
215
|
-
"working-number-label": y(j)("sheet.field.workingNumber"),
|
|
216
|
-
citation: He.value,
|
|
217
|
-
"citation-heading": P.value.citation?.heading ? y(j)(P.value.citation.heading) : ""
|
|
218
|
-
}, null, 8, [
|
|
219
|
-
"credits",
|
|
220
|
-
"working-number",
|
|
221
|
-
"working-number-label",
|
|
222
|
-
"citation",
|
|
223
|
-
"citation-heading"
|
|
224
|
-
]),
|
|
225
|
-
_(a.$slots, "source", m(p(q.value)), () => [f(r)]),
|
|
226
|
-
_(a.$slots, "related", m(p({
|
|
227
|
-
...q.value,
|
|
228
|
-
records: $.value,
|
|
229
|
-
outside: y(Z).outside
|
|
230
|
-
})), () => [Q.value ? (h(), o(ne, {
|
|
231
|
-
key: 0,
|
|
232
|
-
heading: y(j)(Q.value.heading ?? "record.related.items"),
|
|
233
|
-
records: $.value,
|
|
234
|
-
variant: Q.value.variant ?? "list",
|
|
235
|
-
"action-label": Q.value.actionLabel ? y(j)(Q.value.actionLabel) : ""
|
|
236
|
-
}, null, 8, [
|
|
237
|
-
"heading",
|
|
238
|
-
"records",
|
|
239
|
-
"variant",
|
|
240
|
-
"action-label"
|
|
241
|
-
])) : s("", !0)])
|
|
242
|
-
]), a.$slots.aside ? (h(), c("aside", D, [_(a.$slots, "aside", m(p({
|
|
243
|
-
...q.value,
|
|
244
|
-
records: $.value,
|
|
245
|
-
outside: y(Z).outside
|
|
246
|
-
})))])) : s("", !0)]),
|
|
247
|
-
_(a.$slots, "after", m(p(q.value))),
|
|
248
|
-
f(ie, {
|
|
249
|
-
term: y(W),
|
|
250
|
-
html: Ne.value,
|
|
251
|
-
dir: y(L),
|
|
252
|
-
onClose: y(Me)
|
|
253
|
-
}, null, 8, [
|
|
254
|
-
"term",
|
|
255
|
-
"html",
|
|
256
|
-
"dir",
|
|
257
|
-
"onClose"
|
|
258
|
-
])
|
|
259
|
-
], 2)) : (h(), c("p", O, v(y(j)("core.status.loading")), 1));
|
|
260
|
-
}
|
|
261
|
-
};
|
|
262
|
-
//#endregion
|
|
263
|
-
export { k as t };
|