@museumwnf/viewer-layout 3.82.0 → 3.83.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/minisite.js CHANGED
@@ -2280,7 +2280,7 @@ function Wa(e) {
2280
2280
  }));
2281
2281
  }
2282
2282
  function Ga(e, t, n) {
2283
- return !e || e.type === "object" && n?.partners?.includes(e.partner_id) || e.type === "monument" && n?.monuments?.includes(e.mwnf_reference) ? "" : t(e);
2283
+ return e ? typeof e.show_country == "boolean" ? e.show_country ? t(e) : "" : e.type === "object" && n?.partners?.includes(e.partner_id) || e.type === "monument" && n?.monuments?.includes(e.mwnf_reference) ? "" : t(e) : "";
2284
2284
  }
2285
2285
  function Ka(e, t, n, r) {
2286
2286
  return [
@@ -2373,7 +2373,7 @@ function no() {
2373
2373
  let f = r.root, p = n(() => f.value ? r.children(f.value.id) : []), m = n(() => xe(p.value, r.children));
2374
2374
  function h(t) {
2375
2375
  let n = e.translations("collections", d.value)[t] ?? {};
2376
- return ye.test(n.title ?? "") ? {
2376
+ return n.title_placeholder ?? ye.test(n.title ?? "") ? {
2377
2377
  ...n,
2378
2378
  title: ""
2379
2379
  } : n;
@@ -2461,7 +2461,10 @@ var ro = { class: "mwnf-baroqueart-home" }, io = { class: "mwnf-baroqueart-home_
2461
2461
  partnerName: (e) => h.tr("partners", e, p.value).name,
2462
2462
  partnerCountry: (e) => h.partnerById.value.get(e)?.country_id,
2463
2463
  countryName: (e) => h.tr("countries", e, p.value).name
2464
- }), F = (e) => Ne(e, E.partnerHref), I = n(() => y.value ? w(y.value.id).extra?.exhibition_credits ?? "" : ""), L = n(() => E.design ?? null), R = n(() => D(E.banner)), z = n(() => D(p.value === "ar" ? "legacy/home_bg_ar.jpg" : "legacy/home_bg.jpg"));
2464
+ }), F = (e) => Ne(e, E.partnerHref), I = n(() => {
2465
+ let e = y.value ? w(y.value.id) : {};
2466
+ return e.exhibition_credits ?? e.extra?.exhibition_credits ?? "";
2467
+ }), L = n(() => E.design ?? null), R = n(() => D(E.banner)), z = n(() => D(p.value === "ar" ? "legacy/home_bg_ar.jpg" : "legacy/home_bg.jpg"));
2465
2468
  return b([T, p], () => {
2466
2469
  document.title = [f("identity.windowTitle"), T.value].filter(Boolean).join(" | ");
2467
2470
  }, { immediate: !0 }), (n, l) => {
@@ -2589,35 +2592,35 @@ var ro = { class: "mwnf-baroqueart-home" }, io = { class: "mwnf-baroqueart-home_
2589
2592
  }, ko = { class: "mwnf-baroqueart-intro__title" }, Ao = { class: "mwnf-baroqueart-intro__nav mwnf-baroqueart-intro__nav--start" }, jo = { class: "mwnf-baroqueart-intro__nav mwnf-baroqueart-intro__nav--end" }, Mo = { class: "mwnf-baroqueart-intro__table" }, No = ["innerHTML"], Po = ["innerHTML"], Fo = { class: "mwnf-baroqueart-intro__side" }, Io = ["href", "onClick"], Lo = ["src"], Ro = { key: 0 }, zo = ["innerHTML"], Bo = ["innerHTML"], Vo = {
2590
2593
  __name: "Introduction",
2591
2594
  setup(t) {
2592
- let { label: l, lang: f, data: p, root: h, text: y, title: S, settings: w, picture: T, href: E, introCaption: D, slots: O, glossaryFor: k } = no(), A = n(() => h.value ? y(h.value.id) : {}), j = n(() => h.value ? k(h.value.id) : []), M = n(() => p.md(A.value.extra?.intro_text, { glossary: j.value })), N = n(() => p.mdInline(A.value.extra?.intro_header ?? "")), P = n(() => O(h.value).flatMap((e) => e.variants).map(({ entry: e, image: t }) => ({
2595
+ let { label: l, lang: f, data: p, root: h, text: y, title: S, settings: w, picture: T, href: E, introCaption: D, slots: O, glossaryFor: k } = no(), A = n(() => h.value ? y(h.value.id) : {}), j = n(() => h.value ? k(h.value.id) : []), M = n(() => A.value.intro_text ?? A.value.extra?.intro_text ?? ""), N = n(() => A.value.intro_header ?? A.value.extra?.intro_header ?? ""), P = n(() => p.md(M.value, { glossary: j.value })), F = n(() => p.mdInline(N.value)), I = n(() => O(h.value).flatMap((e) => e.variants).map(({ entry: e, image: t }) => ({
2593
2596
  entry: e,
2594
2597
  image: t,
2595
2598
  lines: D(e)
2596
2599
  })));
2597
- function F(e) {
2600
+ function L(e) {
2598
2601
  Z(E({
2599
2602
  name: "zoom",
2600
2603
  query: { img: e }
2601
2604
  }), to.introZoom);
2602
2605
  }
2603
- let I = ee(j);
2604
- function L() {
2606
+ let R = ee(j);
2607
+ function z() {
2605
2608
  rt({
2606
2609
  documentTitle: w.documentTitle,
2607
2610
  title: S.value,
2608
- header: A.value.extra?.intro_header ?? "",
2609
- text: A.value.extra?.intro_text ?? "",
2610
- captions: P.value.map((e) => e.lines)
2611
+ header: N.value,
2612
+ text: M.value,
2613
+ captions: I.value.map((e) => e.lines)
2611
2614
  });
2612
2615
  }
2613
- let R = n(() => T(f.value === "ar" ? "legacy/intro_bg_ar.jpg" : "legacy/intro_bg.jpg"));
2616
+ let B = n(() => T(f.value === "ar" ? "legacy/intro_bg_ar.jpg" : "legacy/intro_bg.jpg"));
2614
2617
  return b([S, f], () => {
2615
2618
  document.title = [l("identity.windowTitle"), S.value].filter(Boolean).join(" | ");
2616
2619
  }, { immediate: !0 }), (t, n) => {
2617
2620
  let f = g("router-link");
2618
2621
  return d(), a("div", {
2619
2622
  class: "mwnf-baroqueart-intro",
2620
- style: u({ backgroundImage: R.value ? `url(${R.value})` : "none" })
2623
+ style: u({ backgroundImage: B.value ? `url(${B.value})` : "none" })
2621
2624
  }, [
2622
2625
  o("div", ko, _(v(S)), 1),
2623
2626
  o("div", Ao, [n[1] ||= s(" < ", -1), c(f, { to: { name: "home" } }, {
@@ -2645,18 +2648,18 @@ var ro = { class: "mwnf-baroqueart-home" }, io = { class: "mwnf-baroqueart-home_
2645
2648
  ]),
2646
2649
  o("div", Mo, [o("div", {
2647
2650
  class: "mwnf-baroqueart-intro__text",
2648
- onClick: n[0] ||= (...e) => v(I).onClick && v(I).onClick(...e)
2651
+ onClick: n[0] ||= (...e) => v(R).onClick && v(R).onClick(...e)
2649
2652
  }, [
2650
2653
  o("div", {
2651
2654
  class: "mwnf-baroqueart-intro__header",
2652
- innerHTML: N.value
2655
+ innerHTML: F.value
2653
2656
  }, null, 8, No),
2654
2657
  o("div", {
2655
2658
  class: "mwnf-baroqueart-intro__content",
2656
- innerHTML: M.value
2659
+ innerHTML: P.value
2657
2660
  }, null, 8, Po),
2658
- c(Oo, { word: L })
2659
- ]), o("div", Fo, [(d(!0), a(e, null, m(P.value, (t) => (d(), a("div", {
2661
+ c(Oo, { word: z })
2662
+ ]), o("div", Fo, [(d(!0), a(e, null, m(I.value, (t) => (d(), a("div", {
2660
2663
  key: `${t.entry.id}-${t.entry.variant_order}`,
2661
2664
  class: "mwnf-baroqueart-intro-item"
2662
2665
  }, [t.image ? (d(), a(e, { key: 0 }, [o("a", {
@@ -2664,7 +2667,7 @@ var ro = { class: "mwnf-baroqueart-home" }, io = { class: "mwnf-baroqueart-home_
2664
2667
  name: "zoom",
2665
2668
  query: { img: t.image }
2666
2669
  }),
2667
- onClick: C((e) => F(t.image), ["prevent"])
2670
+ onClick: C((e) => L(t.image), ["prevent"])
2668
2671
  }, [o("img", {
2669
2672
  class: "mwnf-baroqueart-intro-item__image",
2670
2673
  src: t.image,
@@ -2676,11 +2679,11 @@ var ro = { class: "mwnf-baroqueart-home" }, io = { class: "mwnf-baroqueart-home_
2676
2679
  key: 2,
2677
2680
  innerHTML: v(p).mdInline(n)
2678
2681
  }, null, 8, Bo))], 64))), 128))]))), 128))])]),
2679
- v(I).active.value ? (d(), r(te, {
2682
+ v(R).active.value ? (d(), r(te, {
2680
2683
  key: 0,
2681
- term: v(I).active.value,
2682
- html: v(p).md(v(I).active.value.definition),
2683
- onClose: v(I).close
2684
+ term: v(R).active.value,
2685
+ html: v(p).md(v(R).active.value.definition),
2686
+ onClose: v(R).close
2684
2687
  }, null, 8, [
2685
2688
  "term",
2686
2689
  "html",
@@ -3288,7 +3291,11 @@ function fc(e, t) {
3288
3291
  let n = String(e ?? "").replace(/\/+$/, "");
3289
3292
  return `${n.slice(0, n.lastIndexOf("/"))}/${t}`;
3290
3293
  }
3291
- function pc({ datasetPackage: e, origin: t, siteName: n, chrome: r = {} }, i) {
3294
+ function pc() {
3295
+ let e = z().manifest.site?.parent?.url;
3296
+ return typeof e == "string" && e ? e.replace(/\/?#\/?$/, "").replace(/\/+$/, "") : null;
3297
+ }
3298
+ function mc({ datasetPackage: e, origin: t, siteName: n, chrome: r = {} }, i) {
3292
3299
  let { manifest: a } = z();
3293
3300
  return {
3294
3301
  datasetPackage: e,
@@ -3300,10 +3307,10 @@ function pc({ datasetPackage: e, origin: t, siteName: n, chrome: r = {} }, i) {
3300
3307
  legacyRoutes: []
3301
3308
  };
3302
3309
  }
3303
- function mc({ exhibition: e = {}, ...t }) {
3310
+ function hc({ exhibition: e = {}, ...t }) {
3304
3311
  let n = N({ entity: "collections" }), r = fc(t.origin, "islamicart");
3305
3312
  return {
3306
- ...pc(t, n),
3313
+ ...mc(t, n),
3307
3314
  shell: _e,
3308
3315
  navigation: hn({
3309
3316
  languages: k(n),
@@ -3325,10 +3332,10 @@ function mc({ exhibition: e = {}, ...t }) {
3325
3332
  extraViews: pn(I())
3326
3333
  };
3327
3334
  }
3328
- function hc({ exhibition: e = {}, ...t }) {
3335
+ function gc({ exhibition: e = {}, ...t }) {
3329
3336
  let n = N({ entity: "collections" }), r = fc(t.origin, "islamicart");
3330
3337
  return {
3331
- ...pc(t, n),
3338
+ ...mc(t, n),
3332
3339
  shell: _e,
3333
3340
  navigation: uc({
3334
3341
  languages: k(n),
@@ -3344,10 +3351,10 @@ function hc({ exhibition: e = {}, ...t }) {
3344
3351
  extraViews: lc(I())
3345
3352
  };
3346
3353
  }
3347
- function gc({ exhibition: e = {}, ...t }) {
3348
- let n = N(), r = fc(t.origin, "baroqueart");
3354
+ function _c({ exhibition: e = {}, ...t }) {
3355
+ let n = N(), r = pc() ?? fc(t.origin, "baroqueart");
3349
3356
  return {
3350
- ...pc(t, n),
3357
+ ...mc(t, n),
3351
3358
  shell: Ha,
3352
3359
  navigation: Cs({
3353
3360
  languages: k(n),
@@ -3366,10 +3373,10 @@ function gc({ exhibition: e = {}, ...t }) {
3366
3373
  extraViews: bs(I())
3367
3374
  };
3368
3375
  }
3369
- function _c({ exhibition: e = {}, ...t }) {
3376
+ function vc({ exhibition: e = {}, ...t }) {
3370
3377
  let n = N(), r = fc(t.origin, "sharinghistory");
3371
3378
  return {
3372
- ...pc(t, n),
3379
+ ...mc(t, n),
3373
3380
  shell: Ln,
3374
3381
  navigation: wa({
3375
3382
  languages: k(n),
@@ -3385,4 +3392,4 @@ function _c({ exhibition: e = {}, ...t }) {
3385
3392
  extraViews: Sa(I())
3386
3393
  };
3387
3394
  }
3388
- export { Ps as ArtIntroHome, cc as ArtIntroPage, $a as BAROQUEART_LABELS, Ua as BAROQUEART_NO_COUNTRY, to as BAROQUEART_WINDOWS, Co as BaroqueartHome, Vo as BaroqueartIntroduction, gs as BaroqueartPage, Ha as BaroqueartShell, ys as BaroqueartZoom, Ve as EXHIBITION_ENTITIES, be as ISLAMICART_NO_COUNTRY, Fe as LABELS, an as MinisiteCredits, et as MinisiteHome, Ot as MinisiteIntroduction, ln as MinisiteMap, tn as MinisitePage, _e as MinisiteShell, fn as MinisiteZoom, ye as PLACEHOLDER_TITLE, Rn as SHARINGHISTORY_LABELS, Yn as SHARINGHISTORY_WINDOWS, ga as SharingHistoryFurtherReading, Or as SharingHistoryHome, mi as SharingHistoryIntroduction, aa as SharingHistoryPage, Ln as SharingHistoryShell, va as SharingHistoryWindow, ba as SharingHistoryZoom, hc as artintroConfig, uc as artintroNavigation, lc as artintroRoutes, dc as artintroSettings, Ja as baroqueartCaption, Qa as baroqueartCuratorLabel, Ya as baroqueartDetailViewCaption, Za as baroqueartIntroCaption, xs as baroqueartMenu, gc as baroqueartMinisiteConfig, Cs as baroqueartNavigation, bs as baroqueartRoutes, ws as baroqueartSettings, Wa as baroqueartSlotsOf, Xa as baroqueartWithFirstView, Y as cleanText, Me as curatorLabel, Ne as curatorLink, Be as exhibitionData, Ie as familyOf, je as introCaption, mn as islamicartMenu, Le as labelSet, mc as minisiteConfig, hn as minisiteNavigation, pn as minisiteRoutes, gn as minisiteSettings, Se as pageWithNeighbours, fc as parentSite, De as placementCaption, Pe as quoteHasItalics, xe as readingOrder, Kn as sharinghistoryCaption, qn as sharinghistoryHomeLogos, Hn as sharinghistoryListedSubthemes, Vn as sharinghistoryListedThemes, _c as sharinghistoryMinisiteConfig, wa as sharinghistoryNavigation, Un as sharinghistoryPageRoute, Wn as sharinghistoryPageWithNext, Bn as sharinghistoryReadingOrder, Jn as sharinghistoryRelatedLinks, Sa as sharinghistoryRoutes, Ta as sharinghistorySettings, Gn as sharinghistorySlotsOf, ke as sheetItemId, Ce as slotsOf, no as useBaroqueartExhibition, X as useExhibition, $ as useSharingHistoryExhibition, Ae as viewPicture, Oe as withFirstView };
3395
+ export { Ps as ArtIntroHome, cc as ArtIntroPage, $a as BAROQUEART_LABELS, Ua as BAROQUEART_NO_COUNTRY, to as BAROQUEART_WINDOWS, Co as BaroqueartHome, Vo as BaroqueartIntroduction, gs as BaroqueartPage, Ha as BaroqueartShell, ys as BaroqueartZoom, Ve as EXHIBITION_ENTITIES, be as ISLAMICART_NO_COUNTRY, Fe as LABELS, an as MinisiteCredits, et as MinisiteHome, Ot as MinisiteIntroduction, ln as MinisiteMap, tn as MinisitePage, _e as MinisiteShell, fn as MinisiteZoom, ye as PLACEHOLDER_TITLE, Rn as SHARINGHISTORY_LABELS, Yn as SHARINGHISTORY_WINDOWS, ga as SharingHistoryFurtherReading, Or as SharingHistoryHome, mi as SharingHistoryIntroduction, aa as SharingHistoryPage, Ln as SharingHistoryShell, va as SharingHistoryWindow, ba as SharingHistoryZoom, gc as artintroConfig, uc as artintroNavigation, lc as artintroRoutes, dc as artintroSettings, Ja as baroqueartCaption, Qa as baroqueartCuratorLabel, Ya as baroqueartDetailViewCaption, Za as baroqueartIntroCaption, xs as baroqueartMenu, _c as baroqueartMinisiteConfig, Cs as baroqueartNavigation, bs as baroqueartRoutes, ws as baroqueartSettings, Wa as baroqueartSlotsOf, Xa as baroqueartWithFirstView, Y as cleanText, Me as curatorLabel, Ne as curatorLink, Be as exhibitionData, Ie as familyOf, je as introCaption, mn as islamicartMenu, Le as labelSet, hc as minisiteConfig, hn as minisiteNavigation, pn as minisiteRoutes, gn as minisiteSettings, Se as pageWithNeighbours, fc as parentSite, De as placementCaption, Pe as quoteHasItalics, xe as readingOrder, Kn as sharinghistoryCaption, qn as sharinghistoryHomeLogos, Hn as sharinghistoryListedSubthemes, Vn as sharinghistoryListedThemes, vc as sharinghistoryMinisiteConfig, wa as sharinghistoryNavigation, Un as sharinghistoryPageRoute, Wn as sharinghistoryPageWithNext, Bn as sharinghistoryReadingOrder, Jn as sharinghistoryRelatedLinks, Sa as sharinghistoryRoutes, Ta as sharinghistorySettings, Gn as sharinghistorySlotsOf, ke as sheetItemId, Ce as slotsOf, no as useBaroqueartExhibition, X as useExhibition, $ as useSharingHistoryExhibition, Ae as viewPicture, Oe as withFirstView };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@museumwnf/viewer-layout",
3
- "version": "3.82.0",
3
+ "version": "3.83.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",
@@ -43,7 +43,7 @@ const FAMILIES = {
43
43
  * - `namespace` — its own texts' namespace (package.json `viewerI18n.namespace`).
44
44
  */
45
45
  export function describeMinisiteSmoke({ config, exhibition, sharedTexts, ownTexts, sources, namespace }) {
46
- const family = exhibition.family ?? 'ISL'
46
+ const family = exhibition.family ?? config.minisite?.family ?? 'ISL'
47
47
  const marks = FAMILIES[family]
48
48
  if (!marks) throw new Error(`describeMinisiteSmoke: unknown family "${family}" in minisite.json.`)
49
49
  const messages = mergeMessages(sharedTexts, { en: ownTexts })
@@ -55,7 +55,8 @@ export function describeMinisiteSmoke({ config, exhibition, sharedTexts, ownText
55
55
  // scripts/minisites generator has written what legacy configured for it:
56
56
  // the settings, the theme and the frame's pictures.
57
57
  it("carries this site's own settings, theme and pictures", () => {
58
- expect(exhibition.legacy).toMatch(marks.legacy)
58
+ // Legacy's address is provenance only: checked where minisite.json keeps it.
59
+ if (exhibition.legacy !== undefined) expect(exhibition.legacy).toMatch(marks.legacy)
59
60
  if (family === 'ISL' || family === 'BAR') expect(exhibition.curators.length).toBeGreaterThan(0)
60
61
  if (family === 'SH') expect(exhibition.profiles.length).toBeGreaterThan(0)
61
62
  expect(readFileSync('theme/tokens.css', 'utf8')).toContain(marks.token)