@museumwnf/viewer-layout 3.53.0 → 3.55.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/views.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { t as e } from "./FeaturedRecord-CTqnQFox.js";
2
2
  import { s as t } from "./TimelineEventList-CTJJOWGh.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-D15BMWZM.js";
4
- import { t as l } from "./RecordView-kkpYLtL_.js";
4
+ import { t as l } from "./RecordView-DEKHp1A3.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.53.0",
3
+ "version": "3.55.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",
@@ -874,6 +874,7 @@
874
874
  /* --mwnf-standalone-banner-title-background: transparent; The title's own strip across the band */
875
875
  /* --mwnf-standalone-banner-title-line-height: 1.1; Its line height */
876
876
  /* --mwnf-standalone-banner-title-padding: 0.5rem 0 0.875rem 4rem; Band title padding */
877
+ /* --mwnf-standalone-banner-title-padding-rtl: 0.5rem 4rem 0.875rem 0; The same on a right-to-left page (from 768px) */
877
878
  /* --mwnf-standalone-menu-background: transparent; Menu cells */
878
879
  /* --mwnf-standalone-menu-alt-background: var(--mwnf-standalone-menu-background); Every other menu cell */
879
880
  /* --mwnf-standalone-menu-link: inherit; Menu link colour */
@@ -898,6 +899,7 @@
898
899
  /* --mwnf-standalone-highlight-paragraph-gap: 0.75rem; Space under each of its paragraphs */
899
900
  /* --mwnf-standalone-highlight-width: none; Its widest, picture and text together */
900
901
  /* --mwnf-standalone-highlight-color: inherit; Its text */
902
+ /* --mwnf-standalone-highlight-action-color: inherit; Its "View description" link */
901
903
  /* --mwnf-standalone-sponsors-background: transparent; The band above the footer */
902
904
  /* --mwnf-standalone-sponsors-padding: 1.25rem; Its padding (top and bottom) */
903
905
  /* --mwnf-standalone-sponsors-gap: 1.5rem; Gap between its columns */
@@ -918,6 +920,11 @@
918
920
  /* --mwnf-standalone-sheet-label-color: #000; The item sheet's labels, a section's heading included */
919
921
  /* --mwnf-standalone-sheet-value-color: #222; The item sheet's values, prose and credits */
920
922
  /* --mwnf-standalone-sheet-link-color: rgb(1 141 206); Their links */
923
+ /* --mwnf-standalone-specials-heading-background: #12376b; A monument's special features: their heading's label */
924
+ /* --mwnf-standalone-specials-heading-color: #fff; Its words */
925
+ /* --mwnf-standalone-specials-heading-weight: 400; Their weight */
926
+ /* --mwnf-standalone-specials-heading-padding: 4px 0; Around them */
927
+ /* --mwnf-standalone-specials-pictures-width: 90%; A feature's pictures, out before the sheet: their box, of the column's width */
921
928
  /* --mwnf-standalone-download-icon: none; The picture before the Related Content column's Download (a url()) */
922
929
  /* --mwnf-standalone-language-bar: transparent; The item sheet's band of record languages */
923
930
  /* --mwnf-standalone-language-color: inherit; Its words */
@@ -976,6 +983,16 @@
976
983
  /* --mwnf-standalone-sp-heading-color: #222; Its heading */
977
984
  /* --mwnf-standalone-sp-text-color: #222; A sponsor's words */
978
985
  /* --mwnf-standalone-sp-link-color: #018dce; Its web address */
986
+ /* --mwnf-standalone-pe-picture: none; The Partners entrance's box: its picture (url(...)) */
987
+ /* --mwnf-standalone-pe-border: 5px solid #fff; Its border */
988
+ /* --mwnf-standalone-pe-name-color: #fff; The project's name on it */
989
+ /* --mwnf-standalone-pe-text-color: #222; The links' lines */
990
+ /* --mwnf-standalone-pe-link-color: #222; The links and About */
991
+ /* --mwnf-standalone-pe-popup: #eec201; About's text: its ground */
992
+ /* --mwnf-standalone-pe-popup-color: #222; Its words */
993
+ /* --mwnf-standalone-pe-bottom: 64px; The space under the last row (legacy's padding and <br/>s) */
994
+ /* --mwnf-standalone-phone-pe-bottom: 58px; The same below 750px */
995
+ /* --mwnf-standalone-phone-pe-border: 0; The box's border below 750px */
979
996
  /* --mwnf-standalone-db-rows: 38px 37px 49px 49px 49px 49px 44px 69px 22px; The Database entrance's row heights */
980
997
  /* --mwnf-standalone-db-options-rows: 38px 37px 49px 49px 49px 49px 63px 31px 61px 36px; Theirs with an options row */
981
998
  /* --mwnf-standalone-db-heading-color: #222; Its "Enter your criteria" heading */
@@ -988,9 +1005,11 @@
988
1005
  /* --mwnf-standalone-db-padding-top: 18px; Above the form (legacy's <br/>) */
989
1006
  /* --mwnf-standalone-db-padding-bottom: 10px; Under the form */
990
1007
  /* --mwnf-standalone-pc-padding-bottom: 20px; Under the Collections entrance (Baroque Art: its 100px spacer more) */
1008
+ /* --mwnf-standalone-pc-strong-weight: 500; Its text's bold words */
991
1009
  /* --mwnf-standalone-tlr-band: transparent; The Timeline results' band under the banner (its Go and the entrance's: the db-go tokens) */
992
1010
  /* --mwnf-standalone-tlr-select-border: #767676; Its lists' border */
993
1011
  /* --mwnf-standalone-tlr-heading-color: #222; The Date and Country | Description headings */
1012
+ /* --mwnf-standalone-tlr-bottom: 24px; The space under the results (legacy's row margin and section padding) */
994
1013
  /* --mwnf-standalone-tlr-strip: #ccc; An event's date and country strips, and the rule under its date */
995
1014
  /* --mwnf-standalone-tlr-related: transparent; The Related Content column, on to the page's right edge */
996
1015
  /* --mwnf-standalone-tlr-band-color: #222; The band's words */
@@ -1028,11 +1047,15 @@
1028
1047
  /* --mwnf-standalone-hcr-image-ground: #000; Around it, when it is letterboxed */
1029
1048
  /* --mwnf-standalone-window-heading-weight: 600; A window's heading weight */
1030
1049
  /* --mwnf-standalone-window-article: var(--mwnf-standalone-window-header); Its scrolling content's ground */
1031
- /* --mwnf-standalone-page-width: 42rem; Text page column width */
1032
- /* --mwnf-standalone-page-inset: 16.666%; Text page column inset */
1033
- /* --mwnf-standalone-page-padding: 1.25rem 1.875rem; Text page padding (top, bottom) */
1050
+ /* --mwnf-standalone-page-width: calc((100% + 30px) * 3 / 4 - 30px); Text page column width (legacy's col-md-9) */
1051
+ /* --mwnf-standalone-page-narrow-width: calc((100% + 30px) / 2 - 30px); A narrow text page's (a col-md-8 in it) */
1052
+ /* --mwnf-standalone-page-inset: calc((100% + 30px) / 6); Text page column inset (an empty col-md-2) */
1053
+ /* --mwnf-standalone-page-padding: 0 10px; Text page padding (top, bottom) */
1054
+ /* --mwnf-standalone-phone-page-padding: 5px; Its sides below 768px, where it takes the full width */
1055
+ /* --mwnf-standalone-page-color: #222; Its text */
1034
1056
  /* --mwnf-standalone-page-heading-size: 1.1875rem; Text page headings */
1035
- /* --mwnf-standalone-page-subheading-size: 1rem; Text page subheadings */
1057
+ /* --mwnf-standalone-page-subheading-size: 15px; Text page subheadings */
1058
+ /* --mwnf-standalone-page-subheading-color: #000; Their colour */
1036
1059
  /* --mwnf-standalone-drop-cap-size: 3.5em; Drop cap size */
1037
1060
  /* --mwnf-standalone-drop-cap-color: inherit; Drop cap colour */
1038
1061
  /* --mwnf-standalone-subnav-border: 1px solid currentColor; Tab strip rule */
@@ -1,344 +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-BIKd-AGP.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, loadEntities as me, pictureCredits as he, picturesInLanguage as ge, renderBlock as C, renderInline as w, renderPlain as T, sheetRows as E, 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 D = ["dir"], Te = ["aria-expanded"], O = ["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, Te), r.value ? (m(), l("div", {
33
- key: 0,
34
- class: "mwnf-sheet__block",
35
- innerHTML: e.html
36
- }, null, 8, O)) : c("", !0)], 8, D));
37
- }
38
- };
39
- //#endregion
40
- //#region src/views/pictureLimit.js
41
- function k(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
- }, A = {
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, tIn: D, locale: Te } = be(), O = ve(), A = xe(), Ne = se(), Pe = we(), j = b.spec.entity ?? b.entity, M = o(() => b.spec), Fe = fe(j), Ie = le(j), N = o(() => Ie.value.get(b.id) ?? null), Le = o(() => Fe.value !== null), P = b.spec.creditPeople ? b.spec.creditPeople.entity ?? "authors" : null;
74
- P && me([P]).catch(() => {});
75
- let F = P ? le(P) : null, { language: I, languages: Re, dir: L, select: R, text: z, ready: B, terms: ze, glossary: V, attribution: H } = Se(N, {
76
- entity: j,
77
- translations: [...b.spec.translations ?? [], ...P ? [P] : []],
78
- attribution: b.spec.attribution ?? []
79
- }), U = o(() => pe(Re.value)), { active: W, onClick: G, close: Be } = ye(ze), Ve = o(() => W.value ? C(W.value.definition, { breaks: !0 }) : ""), He = (e, t) => O.tr(e, t, I.value, "en"), Ue = (e) => O.translations(e, I.value), K = o(() => ({
80
- record: N.value,
81
- text: z.value,
82
- language: I.value,
83
- languages: U.value,
84
- select: R,
85
- dir: L.value,
86
- glossary: V.value,
87
- ready: B.value,
88
- attribution: H.value,
89
- t: S,
90
- tIn: (e) => D ? D(I.value, e) : S(e),
91
- tr: He,
92
- translations: Ue
93
- })), q = (e) => M.value.labelsInRecordLanguage && D ? D(I.value, e) : S(e);
94
- function We(e) {
95
- return ((typeof e == "function" ? e(K.value) : e) ?? []).map((e) => ({
96
- ...e,
97
- label: e.label ? q(e.label) : ""
98
- }));
99
- }
100
- let Ge = o(() => N.value ? E(We(M.value.fields), K.value) : []), Ke = o(() => N.value ? E(We(M.value.sections).map((e) => ({
101
- render: "block",
102
- ...e
103
- })), K.value) : []), J = o(() => M.value.shortDescriptionAfter ?? "description"), qe = o(() => !Ge.value.some((e) => e.key === J.value) && Ke.value.some((e) => e.key === J.value)), Je = o(() => M.value.shortDescription === !1 ? "" : M.value.shortDescription ?? "short_description"), Y = o(() => {
104
- let e = Je.value ? z.value[Je.value] : "";
105
- return e ? { html: C(String(e), {
106
- breaks: !0,
107
- glossary: V.value
108
- }) } : null;
109
- }), Ye = o(() => {
110
- if (!N.value) return "";
111
- if (M.value.title) return M.value.title(K.value);
112
- let e = z.value.name ?? N.value.internal_name ?? N.value.id;
113
- return w(String(e), { glossary: V.value });
114
- }), Xe = o(() => N.value ? k(Ze(), M.value.pictureLimit, K.value) : []);
115
- function Ze() {
116
- if (M.value.media) return M.value.media(N.value, K.value);
117
- let e = T(String(z.value.name ?? N.value.internal_name ?? ""));
118
- return ge(N.value.images, I.value).map((t) => ({
119
- url: t.url,
120
- alt: t.captions?.[I.value] ?? e,
121
- caption: t.captions?.[I.value] ?? "",
122
- ...he(t, I.value)
123
- }));
124
- }
125
- let Qe = [
126
- {
127
- field: "author",
128
- label: "sheet.field.preparedBy"
129
- },
130
- {
131
- field: "copy_editor",
132
- label: "sheet.field.copyeditedBy"
133
- },
134
- {
135
- field: "translator",
136
- label: "sheet.field.translationBy"
137
- },
138
- {
139
- field: "translation_copy_editor",
140
- label: "sheet.field.translationCopyeditedBy"
141
- }
142
- ];
143
- function $e(e) {
144
- let t = M.value.creditNames ? z.value.credit_names?.[e] : null;
145
- return t?.length ? de(t) : z.value[e] ?? H.value[e] ?? "";
146
- }
147
- function et(e) {
148
- let t = F ? z.value.credit_ids?.[e] : null;
149
- if (!t?.length) return null;
150
- let n = Ue(P), r = t.map((e) => {
151
- let t = F.value.get(e);
152
- if (!t) return null;
153
- let r = t.name ?? "";
154
- return {
155
- name: I.value === "ar" && t.originalname ? t.originalname : r,
156
- heading: [t.firstname, t.lastname].filter(Boolean).join(" ") || r,
157
- biography: n?.[e]?.curriculum ?? ""
158
- };
159
- });
160
- return r.every(Boolean) ? r : null;
161
- }
162
- let tt = o(() => (M.value.credits ?? Qe).map(({ field: e, label: t }) => ({
163
- label: q(t),
164
- value: $e(e),
165
- people: et(e)
166
- })).filter((e) => e.value)), nt = o(() => String(N.value?.[M.value.workingNumber ?? "mwnf_reference"] ?? ""));
167
- function X(e) {
168
- if (e?.permalink !== !1) return typeof e?.permalink == "string" ? e.permalink : _e(Pe) ?? void 0;
169
- }
170
- let rt = o(() => {
171
- let e = M.value.citation;
172
- return !N.value || typeof e?.format != "function" ? "" : e.format(K.value, {
173
- permalink: X(e),
174
- year: (/* @__PURE__ */ new Date()).getFullYear()
175
- });
176
- }), it = o(() => {
177
- let e = M.value.citation;
178
- if (!N.value || e === !1 || typeof e?.format == "function") return "";
179
- let t = typeof e?.project == "function" ? null : e?.project ?? N.value.project_id, n = typeof e?.project == "function" ? e.project(N.value, K.value) : A.label(t);
180
- return ue({
181
- author: $e("author") || void 0,
182
- name: z.value.name ?? N.value.internal_name ?? "",
183
- project: n,
184
- permalink: X(e),
185
- inWord: S("record.citation.in")
186
- });
187
- }), Z = Ce(N, {
188
- entity: j,
189
- language: I
190
- }), Q = o(() => M.value.related === !1 ? null : M.value.related ?? {}), $ = o(() => {
191
- if (!Q.value) return [];
192
- let e = Q.value.record ?? at;
193
- return Z.value.inPackage.map((t) => e(t, K.value));
194
- });
195
- function at({ record: e, justification: t }) {
196
- let n = He(j, e.id).name ?? e.internal_name ?? e.id;
197
- return {
198
- id: e.id,
199
- image: e.images?.[0]?.url ?? "",
200
- imageAlt: T(String(n)),
201
- name: w(String(n)),
202
- meta: t ? [t] : [],
203
- badge: e.type ?? "",
204
- to: {
205
- name: M.value.route ?? (b.entity ? `${b.entity}-detail` : "item"),
206
- params: { id: e.id }
207
- }
208
- };
209
- }
210
- let ot = /* @__PURE__ */ new Set([
211
- "header",
212
- "before-sheet",
213
- "after-sheet",
214
- "aside",
215
- "source",
216
- "related",
217
- "after",
218
- "default"
219
- ]), st = o(() => Object.keys(Ne).filter((e) => !ot.has(e)));
220
- return (o, h) => Le.value && !N.value ? (m(), s(y(ce), { key: 0 })) : N.value ? (m(), l("article", {
221
- key: 1,
222
- class: oe(["mwnf-record", { "mwnf-record--spaced": M.value.spaced }]),
223
- onClick: h[0] ||= (...e) => y(G) && y(G)(...e)
224
- }, [
225
- _(o.$slots, "header", p(f(K.value)), () => [
226
- M.value.back ? (m(), s(n, {
227
- key: 0,
228
- class: "mwnf-record__back",
229
- to: M.value.back.to,
230
- href: M.value.back.href
231
- }, {
232
- default: x(() => [ae("← " + v(y(S)(M.value.back.label)), 1)]),
233
- _: 1
234
- }, 8, ["to", "href"])) : c("", !0),
235
- d(t, {
236
- languages: U.value,
237
- language: y(I),
238
- onSelect: y(R)
239
- }, null, 8, [
240
- "languages",
241
- "language",
242
- "onSelect"
243
- ]),
244
- u("h1", {
245
- class: "mwnf-record__title",
246
- dir: y(L) || void 0,
247
- innerHTML: Ye.value
248
- }, null, 8, De)
249
- ]),
250
- u("div", Oe, [u("div", ke, [
251
- Xe.value.length ? (m(), s(i, {
252
- key: 0,
253
- images: Xe.value,
254
- variant: M.value.mediaVariant ?? ""
255
- }, null, 8, ["images", "variant"])) : c("", !0),
256
- y(B) ? c("", !0) : (m(), l("p", Ae, v(y(S)("core.status.loading")), 1)),
257
- _(o.$slots, "before-sheet", p(f(K.value))),
258
- d(ne, {
259
- rows: Ge.value,
260
- layout: M.value.layout ?? "table",
261
- dir: y(L),
262
- "short-description": Y.value,
263
- "short-description-after": J.value
264
- }, ie({ _: 2 }, [g(st.value, (e) => ({
265
- name: e,
266
- fn: x((t) => [_(o.$slots, e, p(f({
267
- ...t,
268
- ...K.value
269
- })))])
270
- }))]), 1032, [
271
- "rows",
272
- "layout",
273
- "dir",
274
- "short-description",
275
- "short-description-after"
276
- ]),
277
- (m(!0), l(a, null, g(Ke.value, (e) => (m(), l(a, { key: e.key }, [d(ee, {
278
- heading: e.label,
279
- html: e.html,
280
- dir: y(L)
281
- }, null, 8, [
282
- "heading",
283
- "html",
284
- "dir"
285
- ]), Y.value && qe.value && e.key === J.value ? (m(), s(Ee, {
286
- key: 0,
287
- html: Y.value.html,
288
- dir: y(L)
289
- }, null, 8, ["html", "dir"])) : c("", !0)], 64))), 128)),
290
- _(o.$slots, "after-sheet", p(f(K.value))),
291
- d(e, {
292
- credits: tt.value,
293
- "working-number": nt.value,
294
- "working-number-label": q(M.value.workingNumberLabel ?? "sheet.field.workingNumber"),
295
- citation: it.value,
296
- "citation-html": rt.value,
297
- "citation-heading": M.value.citation?.heading ? q(M.value.citation.heading) : ""
298
- }, null, 8, [
299
- "credits",
300
- "working-number",
301
- "working-number-label",
302
- "citation",
303
- "citation-html",
304
- "citation-heading"
305
- ]),
306
- _(o.$slots, "source", p(f(K.value)), () => [d(r)]),
307
- _(o.$slots, "related", p(f({
308
- ...K.value,
309
- records: $.value,
310
- outside: y(Z).outside
311
- })), () => [Q.value ? (m(), s(te, {
312
- key: 0,
313
- heading: y(S)(Q.value.heading ?? "record.related.items"),
314
- records: $.value,
315
- variant: Q.value.variant ?? "list",
316
- "action-label": Q.value.actionLabel ? y(S)(Q.value.actionLabel) : ""
317
- }, null, 8, [
318
- "heading",
319
- "records",
320
- "variant",
321
- "action-label"
322
- ])) : c("", !0)])
323
- ]), o.$slots.aside ? (m(), l("aside", je, [_(o.$slots, "aside", p(f({
324
- ...K.value,
325
- records: $.value,
326
- outside: y(Z).outside
327
- })))])) : c("", !0)]),
328
- _(o.$slots, "after", p(f(K.value))),
329
- d(re, {
330
- term: y(W),
331
- html: Ve.value,
332
- dir: y(L),
333
- onClose: y(Be)
334
- }, null, 8, [
335
- "term",
336
- "html",
337
- "dir",
338
- "onClose"
339
- ])
340
- ], 2)) : (m(), l("p", Me, v(y(S)("core.status.loading")), 1));
341
- }
342
- };
343
- //#endregion
344
- export { k as n, A as t };