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