@museumwnf/viewer-layout 3.76.0 → 3.77.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/README.md CHANGED
@@ -23,8 +23,6 @@ all the packages:
23
23
  | `@museumwnf/viewer-layout/standalone` | standalone family layer | the chrome, home page, item sheet, text page and blocks of Discover Islamic Art, Discover Baroque Art and Sharing History | the entries above and `@museumwnf/viewer-core` |
24
24
  | `@museumwnf/viewer-layout/minisite` | mini-site family layer | legacy's virtual exhibitions, one website each: the frame, the home page, the introduction, the exhibition pages, legacy's three windows, the caption rules, `minisiteRoutes` / `minisiteNavigation` / `minisiteSettings` | the entries above and `@museumwnf/viewer-core` |
25
25
  | `@museumwnf/viewer-layout/minisite/testing` | mini-site family layer | the family's smoke test, `describeMinisiteSmoke` | the site's config, settings, texts and chrome, in the site's own Vitest |
26
- | `@museumwnf/viewer-layout/publications` | site layer | the Publications site (legacy books.museumwnf.org): its frame, home page, category and results lists, a publication's page, `publicationsConfig` | the entries above and `@museumwnf/viewer-core` |
27
- | `@museumwnf/viewer-layout/travels` | site layer | the Travels site (legacy travels.museumwnf.org's Exhibition Trails): its frame, the trails' lists, a trail's and an itinerary's pages, `travelsConfig` | the entries above and `@museumwnf/viewer-core` |
28
26
  | `@museumwnf/viewer-layout/style.css` | — | one stylesheet for every entry, the family styles included | — |
29
27
  | `@museumwnf/viewer-layout/tokens.reference.css` | — | every token the package reads, with its fallback | — |
30
28
 
@@ -975,57 +973,11 @@ export default {
975
973
 
976
974
  ## Publications and Travels sites
977
975
 
978
- `@museumwnf/viewer-layout/publications` and `@museumwnf/viewer-layout/travels`
979
- are the pages of two standalone sites, each a product of its own
980
- (inventory-app#2515): Publications replaces books.museumwnf.org, Travels the
981
- Exhibition Trails of travels.museumwnf.org. Their layouts are legacy's, and
982
- they read only their data package (publications-data-package.md,
983
- travels-data-package.md in inventory-app) and their viewer-i18n bundle
984
- (`publications`, `travels`). A site's `dataset.config.js` is one call:
985
-
986
- ```js
987
- import { publicationsConfig } from '@museumwnf/viewer-layout/publications'
988
- const chrome = import.meta.glob('../theme/assets/**/*.{jpg,png,gif,svg}', { eager: true, query: '?url', import: 'default' })
989
- export default publicationsConfig({
990
- datasetPackage: '@museumwnf/publications-data',
991
- origin: 'https://museumwithnofrontiers.github.io/publications',
992
- siteName: 'MWNF Books',
993
- chrome, // legacy/logo-blue.png, legacy/logo-white.png
994
- })
995
- ```
996
-
997
- ```js
998
- import { travelsConfig } from '@museumwnf/viewer-layout/travels'
999
- export default travelsConfig({
1000
- datasetPackage: '@museumwnf/travels-data',
1001
- origin: 'https://museumwithnofrontiers.github.io/travels',
1002
- })
1003
- ```
1004
-
1005
- | Site | Route | Legacy page | Reads |
1006
- | --- | --- | --- | --- |
1007
- | Publications | `/` | HomePage.vue: a band per category | `publications.json`, `editions.json`, `countries`, `languages` |
1008
- | Publications | `/category/:category?page=` | CategoryPage.vue (`/category/<name>/<page>`), legacy's names (`travel-books`, …) | the same |
1009
- | Publications | `/results?title=&author=&isbn=&language=&country=&subject=&type=&publisher=` | ResultsPage.vue | the same, `tags.json` (subjects) |
1010
- | Publications | `/publication/:id/:language?` | BookPage.vue (`/book/<id>/<language>`) | a publication, its editions' covers and `/doc` PDFs, `translations/publications.<lang>.json` |
1011
- | Travels | `/` | travel_et_home.php | `collections.json` (trails), `items.json` (their projects), `countries` |
1012
- | Travels | `/trails?country=` / `?project=` | travel_et_trail.php (`cid` / `tid`) | trails, locations, the trail's `publications` |
1013
- | Travels | `/trail/:id?tab=desc\|its\|cur` | travel_et_trailDetail.php (`fl`) | a trail's texts and `extra` (subtitle, region, curators, photographers), its itineraries and locations |
1014
- | Travels | `/itinerary/:id?tab=des\|vl` | travel_et_itenary.php (`fl`) | an itinerary's texts, its locations' and monuments' pictures |
1015
-
1016
- The Publications site offers English, as legacy did; a publication's page
1017
- reads its labels in the version's language (`tIn`), English where legacy had
1018
- none. The Travels site offers the languages of its trails' texts, labels and
1019
- texts alike, as legacy's trail pages were drawn in the trail's language. A
1020
- trail's book links to its page on the Publications site in the page's
1021
- language (`<url>/<lang>`, legacy's `/book/<id>/<lang>`).
1022
-
1023
- What legacy drew from data the packages do not carry is not drawn: the books'
1024
- stock line ("AVAILABLE"), the "NEW" list (a site may give a `match` for it in
1025
- `publications.categories`), the shop links (D-P8), the publisher popup; the
1026
- Travels pages' tours, "Related Tours" and the itineraries' "AVAILABLE SOON"
1027
- tabs (the tours are out, inventory-app#2515), and the trail's "Starting
1028
- point", which legacy had commented out.
976
+ The Publications site (legacy books.museumwnf.org) and the Travels site (the
977
+ Exhibition Trails of legacy travels.museumwnf.org) keep their pages in their
978
+ own repositories, on Explore's model: each is a single product, so its code
979
+ lives with it (museumwithnofrontiers/publications, museumwithnofrontiers/travels).
980
+ This package's `./publications` and `./travels` entries were removed in 3.77.0.
1029
981
  ## Theming
1030
982
 
1031
983
  Every color, font, spacing, radius comes from a `--mwnf-*` CSS custom property with a neutral fallback. Full list: [`tokens.reference.css`](src/tokens.reference.css) (also exported as `@museumwnf/viewer-layout/tokens.reference.css`) — copy it into your website as `theme/tokens.css` and set values.
@@ -1,6 +1,6 @@
1
1
  import { t as e } from "./GlossaryPopover-DbQKXhx9.js";
2
- import { O as t, c as n, d as r, j as i, u as a, v as o } from "./data-BI5v-QYD.js";
3
- import { n as s } from "./themeSpecs-CKgLOhlP.js";
2
+ import { M as t, c as n, d as r, k as i, u as a, v as o } from "./data-D9H1tB75.js";
3
+ import { n as s } from "./themeSpecs-BJ82RvA1.js";
4
4
  import { Fragment as c, computed as l, createBlock as u, createCommentVNode as d, createElementBlock as f, createElementVNode as p, createTextVNode as m, createVNode as h, nextTick as ee, normalizeClass as g, normalizeStyle as _, onBeforeUnmount as te, onMounted as ne, openBlock as v, ref as y, renderList as b, toDisplayString as x, unref as S, vModelCheckbox as re, watch as ie, withCtx as C, withDirectives as ae } from "vue";
5
5
  import { glossaryEntries as oe, glossaryTermsForText as se, renderBlock as w, renderInline as T, useGlossaryPopup as ce, useI18n as le } from "@museumwnf/viewer-core";
6
6
  import { RouterLink as E, useRoute as ue, useRouter as de } from "vue-router";
@@ -107,7 +107,7 @@ var D = Object.defineProperty, O = (e, t) => {
107
107
  default: !1
108
108
  } },
109
109
  setup(_) {
110
- let D = _, { aboutTheme: O, listedThemes: fe, pictureById: pe, pictureParent: he, romanFor: k, themeByRouteId: _t, themeText: A, useThemePictures: vt } = t, { t: j, locale: M } = le(), N = ue(), yt = de(), P = l(() => D.aboutMode ? O.value : _t(N.params.id)), F = l(() => {
110
+ let D = _, { aboutTheme: O, listedThemes: fe, pictureById: pe, pictureParent: he, romanFor: k, themeByRouteId: _t, themeText: A, useThemePictures: vt } = i, { t: j, locale: M } = le(), N = ue(), yt = de(), P = l(() => D.aboutMode ? O.value : _t(N.params.id)), F = l(() => {
111
111
  let e = N.params.subtheme;
112
112
  if (D.aboutMode || !e || e === "overview") return null;
113
113
  let t = Number(e);
@@ -165,20 +165,20 @@ var D = Object.defineProperty, O = (e, t) => {
165
165
  let jt = y(!1), Y = l(() => {
166
166
  let e = J.value;
167
167
  if (!e) return null;
168
- let t = pe.value.get(e.id), n = t ? he(t) : null, r = n ? i("items", n.id, M.value) : {}, a = Array.isArray(r.materials) ? r.materials.join(", ") : r.materials ?? "";
168
+ let n = pe.value.get(e.id), r = n ? he(n) : null, i = r ? t("items", r.id, M.value) : {}, a = Array.isArray(i.materials) ? i.materials.join(", ") : i.materials ?? "";
169
169
  return {
170
170
  caption: q.value ? "" : e.imageCaption ?? "",
171
171
  name: e.name ?? "",
172
- alsoKnownAs: r.alternate_name ? T(r.alternate_name) : "",
173
- artist: r.artist ? T(r.artist) : "",
172
+ alsoKnownAs: i.alternate_name ? T(i.alternate_name) : "",
173
+ artist: i.artist ? T(i.artist) : "",
174
174
  materials: a ? T(a) : "",
175
- date: r.dates ? T(r.dates) : "",
176
- dynasty: r.dynasty ? T(r.dynasty) : "",
175
+ date: i.dates ? T(i.dates) : "",
176
+ dynasty: i.dynasty ? T(i.dynasty) : "",
177
177
  place: [
178
- r.holder || (n ? o("partners", n.partner_id) : ""),
179
- r.location,
180
- r.province,
181
- n ? o("countries", n.country_id) : ""
178
+ i.holder || (r ? o("partners", r.partner_id) : ""),
179
+ i.location,
180
+ i.province,
181
+ r ? o("countries", r.country_id) : ""
182
182
  ].filter(Boolean).join(", "),
183
183
  to: e.to ?? null
184
184
  };
@@ -186,7 +186,7 @@ var D = Object.defineProperty, O = (e, t) => {
186
186
  if (D.aboutMode) return r(M.value);
187
187
  let e = A(P.value, M.value).title ?? P.value?.internal_name ?? "";
188
188
  return P.value ? `${k(P.value.display_order)} ▪ ${e}` : e;
189
- }), Nt = l(() => D.aboutMode ? a(M.value) : I.value ? A(I.value, M.value).title ?? I.value.internal_name ?? "" : j("exhibition.theme.overview")), Pt = l(() => !L.value?.id || !K.value?.id || q.value ? "" : i("themes", `${L.value.id}/${K.value.id}`, M.value).contextual_description ?? ""), Ft = l(() => I.value ? X.value.quote : X.value.presentation), It = l(() => se([Ft.value, Pt.value].filter(Boolean).join("\n\n"), M.value)), Lt = l(() => oe(It.value)), { active: Rt, onClick: zt, close: Bt } = ce(It), Vt = l(() => Rt.value ? w(Rt.value.definition, { breaks: !0 }) : ""), Ht = l(() => X.value.quote ? T(String(X.value.quote), { glossary: I.value ? Lt.value : [] }) : ""), Ut = l(() => X.value.presentation ? w(String(X.value.presentation), {
189
+ }), Nt = l(() => D.aboutMode ? a(M.value) : I.value ? A(I.value, M.value).title ?? I.value.internal_name ?? "" : j("exhibition.theme.overview")), Pt = l(() => !L.value?.id || !K.value?.id || q.value ? "" : t("themes", `${L.value.id}/${K.value.id}`, M.value).contextual_description ?? ""), Ft = l(() => I.value ? X.value.quote : X.value.presentation), It = l(() => se([Ft.value, Pt.value].filter(Boolean).join("\n\n"), M.value)), Lt = l(() => oe(It.value)), { active: Rt, onClick: zt, close: Bt } = ce(It), Vt = l(() => Rt.value ? w(Rt.value.definition, { breaks: !0 }) : ""), Ht = l(() => X.value.quote ? T(String(X.value.quote), { glossary: I.value ? Lt.value : [] }) : ""), Ut = l(() => X.value.presentation ? w(String(X.value.presentation), {
190
190
  breaks: !0,
191
191
  glossary: I.value ? [] : Lt.value
192
192
  }) : ""), Wt = l(() => Pt.value ? w(String(Pt.value), {
@@ -0,0 +1,98 @@
1
+ import { n as e } from "./chrome-Bv_mLlHM.js";
2
+ import { t } from "./legacyFacets-CQw2NYL4.js";
3
+ import { computed as n } from "vue";
4
+ import { partnerView as r, renderInline as i, useSiteConfig as ee } from "@museumwnf/viewer-core";
5
+ import { useExhibitionCollection as a, useExhibitionData as o, useExhibitionItemDetail as s, useExhibitionPartner as c, useExhibitionThemes as l, useExhibitionTimeline as te } from "@museumwnf/viewer-core/dxa";
6
+ // src/dxa/exhibition/data.js
7
+ var u = o(), d = a(u), f = te(u, d), p = c(u), m = l(u), { itemDetail: h } = s(u, f), { defaultLang: g, tr: _, md: v, mdInline: y, mdStrip: ne, labelOf: b, loadEnglish: x, exhibition: S, relatedContent: C, items: w, itemById: T, countries: E, timelines: re, visiblePartners: D, visiblePartnerById: O, isHiddenPartner: k, itemRoute: A, partnerRoute: j, partnerObjectsRoute: M, countryLabelFromCode: N, exhibitionTitle: P, exhibitionSubtitle: F, exhibitionHeadline: I, bannerCaption: L, projectName: ie } = u;
8
+ function R(t, n = "hi_res") {
9
+ return e(ee().chrome, t) ?? u.chromeImage(t, n);
10
+ }
11
+ var { haystack: z, tile: ae, countryIdForCode: oe } = d, B = t(d.FACETS), V = {
12
+ ...d.collectionResults,
13
+ facets: B
14
+ }, H = (e, t) => String(e ?? "").localeCompare(String(t ?? ""), "en", { sensitivity: "base" });
15
+ function U(e, t) {
16
+ let n = String(e ?? "").split(":"), r = String(t ?? "").split(":");
17
+ for (let e = 0; e < Math.max(n.length, r.length); e++) {
18
+ let t = n[e] ?? "", i = r[e] ?? "";
19
+ if (t !== i) return /^\d+$/.test(t) && /^\d+$/.test(i) ? Number(t) - Number(i) : t.localeCompare(i, "en");
20
+ }
21
+ return 0;
22
+ }
23
+ function W(e, t) {
24
+ return H(b("countries", e.country_id), b("countries", t.country_id)) || H(b("partners", e.partner_id), b("partners", t.partner_id)) || U(e.backward_compatibility, t.backward_compatibility);
25
+ }
26
+ var G = {
27
+ pageSize: 20,
28
+ sort: {
29
+ undated: "first",
30
+ tiebreak: (e, t) => W(e, t)
31
+ }
32
+ };
33
+ function K(e) {
34
+ let t = _("items", e.id, g), n = e.type === "monument" ? "" : t.dates ?? "";
35
+ return {
36
+ id: e.id,
37
+ image: e.images?.[0]?.url ?? "",
38
+ imageAlt: b("items", e.id),
39
+ name: i(t.name ?? e.internal_name ?? ""),
40
+ date: n.length > 80 ? `${n.slice(0, 80)}...` : n,
41
+ partner: b("partners", e.partner_id),
42
+ place: [t.location, b("countries", e.country_id)].filter(Boolean).join(", "),
43
+ project: ie(e, g) ?? "",
44
+ to: A(e)
45
+ };
46
+ }
47
+ var { hasTimeline: q, timelineSpec: J, timelineGallerySpec: Y } = f, { partnerListSpec: X, partnerSheetSpec: Z } = p, se = {
48
+ countryLabel: (e) => b("countries", e),
49
+ md: v,
50
+ mdInline: y,
51
+ route: j,
52
+ objectsRoute: M,
53
+ hidden: k
54
+ }, ce = n(() => {
55
+ let e = /* @__PURE__ */ new Map();
56
+ for (let t of w.value ?? []) t.partner_id && (e.has(t.partner_id) || e.set(t.partner_id, /* @__PURE__ */ new Set()), e.get(t.partner_id).add(t.type));
57
+ return e;
58
+ }), Q = {
59
+ both: "exhibition.action.viewItems",
60
+ monuments: "exhibition.action.viewMonuments",
61
+ objects: "exhibition.action.viewObjects"
62
+ };
63
+ function le(e = []) {
64
+ let t = [...e], n = t.includes("monument"), r = t.some((e) => e !== "monument");
65
+ return n && r ? Q.both : n ? Q.monuments : Q.objects;
66
+ }
67
+ function $(e) {
68
+ return le(ce.value.get(e?.id));
69
+ }
70
+ var ue = {
71
+ spec: {
72
+ ...Z,
73
+ media: () => [],
74
+ sourceCredit: !1
75
+ },
76
+ visible: (e) => !!O(e),
77
+ view: (e, t) => r(e, {
78
+ ..._("partners", e.id, g),
79
+ ...t
80
+ }, se),
81
+ labels: {
82
+ partner: {
83
+ objects: (e) => $(e),
84
+ homepage: "exhibition.partner.homepage"
85
+ },
86
+ institution: {
87
+ objects: (e) => $(e),
88
+ homepage: "exhibition.action.institutionHomepage"
89
+ }
90
+ },
91
+ className: "mwnf-dxa-exhibition-profile",
92
+ media: {
93
+ thumbsFrom: 1,
94
+ creditCaption: !1
95
+ },
96
+ legacyMap: { label: "exhibition.partner.mapLabel" }
97
+ };
98
+ export { Y as A, ue as C, j as D, M as E, _ as M, O as N, C as O, D as P, v as S, X as T, w as _, E as a, K as b, S as c, P as d, q as f, A as g, h, V as i, J as j, m as k, I as l, T as m, L as n, N as o, z as p, R as r, g as s, B as t, F as u, b as v, $ as w, x, G as y };