@museumwnf/viewer-layout 3.71.0 → 3.72.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
@@ -778,6 +778,13 @@ every value is a `--mwnf-standalone-*` token with a neutral fallback
778
778
  (`tokens.reference.css`); a site's `theme/tokens.css` sets legacy's. It ships
779
779
  in `style.css`, so a site imports nothing more.
780
780
 
781
+ A product's label set by name: `StandaloneTimelineEntrance` and
782
+ `StandaloneHistoricalCrossRef` take `texts="<product>"` and read its
783
+ `<product>.tl.*`, `<product>.db.go` and `<product>.hcr.*` entries themselves
784
+ (viewer-i18n's convention, one label set per product), so a page passes the
785
+ name instead of mapping each label. Labels a page passes still win, for a
786
+ product whose entries are named otherwise.
787
+
781
788
  ## Mini-site family pages
782
789
 
783
790
  `@museumwnf/viewer-layout/minisite` is the family layer of the mini-sites:
@@ -1794,11 +1794,15 @@ var dt = { class: "mwnf-standalone-related" }, ft = { class: "mwnf-standalone-re
1794
1794
  props: {
1795
1795
  labels: {
1796
1796
  type: Object,
1797
- required: !0
1797
+ default: null
1798
+ },
1799
+ texts: {
1800
+ type: String,
1801
+ default: ""
1798
1802
  },
1799
1803
  alerts: {
1800
1804
  type: Object,
1801
- default: () => ({})
1805
+ default: null
1802
1806
  },
1803
1807
  countries: {
1804
1808
  type: Array,
@@ -1815,48 +1819,60 @@ var dt = { class: "mwnf-standalone-related" }, ft = { class: "mwnf-standalone-re
1815
1819
  },
1816
1820
  emits: ["search"],
1817
1821
  setup(e, { emit: t }) {
1818
- let n = e, r = t, i = E({
1822
+ let n = e, r = t, i = n.texts ? q().t : (e) => e, a = (e) => i(`${n.texts}.${e}`), o = l(() => n.labels ?? {
1823
+ selectCountry: a("tl.selectCountry"),
1824
+ allCountries: a("tl.allCountries"),
1825
+ startDate: a("tl.startDate"),
1826
+ endDate: a("tl.endDate"),
1827
+ go: a("db.go")
1828
+ }), s = l(() => n.alerts ?? (n.texts ? {
1829
+ country: a("tl.alertCountry"),
1830
+ countryOrDates: a("tl.alertCountryOrDates"),
1831
+ startDate: a("tl.alertStartDate"),
1832
+ endDate: a("tl.alertEndDate"),
1833
+ period: a("tl.alertPeriod")
1834
+ } : {})), u = E({
1819
1835
  country: "none",
1820
1836
  start: "none",
1821
1837
  end: "none"
1822
1838
  });
1823
- function a() {
1824
- return i.country === "none" ? n.alerts.country : i.country === "" ? i.start === "none" && i.end === "none" ? n.alerts.countryOrDates : i.start === "none" ? n.alerts.startDate : i.end === "none" ? n.alerts.endDate : Number(i.start) > Number(i.end) ? n.alerts.period : "" : "";
1839
+ function d() {
1840
+ return u.country === "none" ? s.value.country : u.country === "" ? u.start === "none" && u.end === "none" ? s.value.countryOrDates : u.start === "none" ? s.value.startDate : u.end === "none" ? s.value.endDate : Number(u.start) > Number(u.end) ? s.value.period : "" : "";
1825
1841
  }
1826
- function o() {
1827
- let e = a();
1828
- e ? window.alert(e) : r("search", { ...i });
1842
+ function m() {
1843
+ let e = d();
1844
+ e ? window.alert(e) : r("search", { ...u });
1829
1845
  }
1830
1846
  return (t, n) => (T(), f("form", {
1831
1847
  class: "mwnf-standalone-tle",
1832
- onSubmit: V(o, ["prevent"])
1848
+ onSubmit: V(m, ["prevent"])
1833
1849
  }, [
1834
1850
  p("p", ri, [B(p("select", {
1835
- "onUpdate:modelValue": n[0] ||= (e) => i.country = e,
1836
- "aria-label": e.labels.selectCountry
1851
+ "onUpdate:modelValue": n[0] ||= (e) => u.country = e,
1852
+ "aria-label": o.value.selectCountry
1837
1853
  }, [
1838
- p("option", ai, A(e.labels.selectCountry), 1),
1839
- p("option", oi, A(e.labels.allCountries), 1),
1854
+ p("option", ai, A(o.value.selectCountry), 1),
1855
+ p("option", oi, A(o.value.allCountries), 1),
1840
1856
  (T(!0), f(c, null, O(e.countries, (e) => (T(), f("option", {
1841
1857
  key: e.value,
1842
1858
  value: e.value
1843
1859
  }, A(e.label), 9, si))), 128))
1844
- ], 8, ii), [[F, i.country]])]),
1860
+ ], 8, ii), [[F, u.country]])]),
1845
1861
  p("p", ci, [B(p("select", {
1846
- "onUpdate:modelValue": n[1] ||= (e) => i.start = e,
1847
- "aria-label": e.labels.startDate
1848
- }, [p("option", ui, A(e.labels.startDate), 1), (T(!0), f(c, null, O(e.starts, (e) => (T(), f("option", {
1862
+ "onUpdate:modelValue": n[1] ||= (e) => u.start = e,
1863
+ "aria-label": o.value.startDate
1864
+ }, [p("option", ui, A(o.value.startDate), 1), (T(!0), f(c, null, O(e.starts, (e) => (T(), f("option", {
1849
1865
  key: e.value,
1850
1866
  value: e.value
1851
- }, A(e.label), 9, di))), 128))], 8, li), [[F, i.start]])]),
1867
+ }, A(e.label), 9, di))), 128))], 8, li), [[F, u.start]])]),
1852
1868
  p("p", fi, [B(p("select", {
1853
- "onUpdate:modelValue": n[2] ||= (e) => i.end = e,
1854
- "aria-label": e.labels.endDate
1855
- }, [p("option", mi, A(e.labels.endDate), 1), (T(!0), f(c, null, O(e.ends, (e) => (T(), f("option", {
1869
+ "onUpdate:modelValue": n[2] ||= (e) => u.end = e,
1870
+ "aria-label": o.value.endDate
1871
+ }, [p("option", mi, A(o.value.endDate), 1), (T(!0), f(c, null, O(e.ends, (e) => (T(), f("option", {
1856
1872
  key: e.value,
1857
1873
  value: e.value
1858
- }, A(e.label), 9, hi))), 128))], 8, pi), [[F, i.end]])]),
1859
- p("p", gi, [p("button", _i, A(e.labels.go), 1)])
1874
+ }, A(e.label), 9, hi))), 128))], 8, pi), [[F, u.end]])]),
1875
+ p("p", gi, [p("button", _i, A(o.value.go), 1)])
1860
1876
  ], 32));
1861
1877
  }
1862
1878
  }, yi = {
@@ -2136,7 +2152,11 @@ var dt = { class: "mwnf-standalone-related" }, ft = { class: "mwnf-standalone-re
2136
2152
  props: {
2137
2153
  labels: {
2138
2154
  type: Object,
2139
- required: !0
2155
+ default: null
2156
+ },
2157
+ texts: {
2158
+ type: String,
2159
+ default: ""
2140
2160
  },
2141
2161
  start: {
2142
2162
  type: Number,
@@ -2181,7 +2201,12 @@ var dt = { class: "mwnf-standalone-related" }, ft = { class: "mwnf-standalone-re
2181
2201
  },
2182
2202
  emits: ["change"],
2183
2203
  setup(e, { emit: t }) {
2184
- let n = e, r = t, i = l(() => {
2204
+ let n = e, r = t, i = n.texts ? q().t : (e) => e, a = l(() => n.labels ?? {
2205
+ heading: i(`${n.texts}.tl.title`),
2206
+ close: i("record.glossary.close"),
2207
+ country: i(`${n.texts}.hcr.country`),
2208
+ range: i(`${n.texts}.hcr.range`)
2209
+ }), o = l(() => {
2185
2210
  let e = (Math.floor(n.start / 50) - 2) * 50;
2186
2211
  return e + 700 > 2050 && (e = 1350), Array.from({ length: 14 }, (t, r) => {
2187
2212
  let i = e + 50 * r;
@@ -2193,19 +2218,19 @@ var dt = { class: "mwnf-standalone-related" }, ft = { class: "mwnf-standalone-re
2193
2218
  });
2194
2219
  return (t, n) => (T(), u($, {
2195
2220
  class: "mwnf-standalone-hcr",
2196
- heading: e.labels.heading,
2197
- "close-label": e.labels.close,
2221
+ heading: a.value.heading,
2222
+ "close-label": a.value.close,
2198
2223
  dir: e.dir
2199
2224
  }, {
2200
- before: z(() => [p("section", $i, [p("div", ea, [(T(!0), f(c, null, O(i.value, (e) => (T(), f("span", {
2225
+ before: z(() => [p("section", $i, [p("div", ea, [(T(!0), f(c, null, O(o.value, (e) => (T(), f("span", {
2201
2226
  key: e.value,
2202
2227
  class: b({ "mwnf-standalone-hcr__year--active": e.active })
2203
2228
  }, A(e.value), 3))), 128))]), n[2] ||= p("div", { class: "mwnf-standalone-hcr__lines" }, null, -1)])]),
2204
2229
  default: z(() => [p("div", ta, [p("div", na, [
2205
- p("p", ra, A(e.labels.country), 1),
2230
+ p("p", ra, A(a.value.country), 1),
2206
2231
  p("select", {
2207
2232
  value: e.country,
2208
- "aria-label": e.labels.country,
2233
+ "aria-label": a.value.country,
2209
2234
  onChange: n[0] ||= (e) => r("change", {
2210
2235
  key: "country",
2211
2236
  value: e.target.value
@@ -2214,10 +2239,10 @@ var dt = { class: "mwnf-standalone-related" }, ft = { class: "mwnf-standalone-re
2214
2239
  key: e.value,
2215
2240
  value: e.value
2216
2241
  }, A(e.label), 9, aa))), 128))], 40, ia),
2217
- p("p", oa, A(e.labels.range), 1),
2242
+ p("p", oa, A(a.value.range), 1),
2218
2243
  p("select", {
2219
2244
  value: String(e.range),
2220
- "aria-label": e.labels.range,
2245
+ "aria-label": a.value.range,
2221
2246
  onChange: n[1] ||= (e) => r("change", {
2222
2247
  key: "start",
2223
2248
  value: e.target.value
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@museumwnf/viewer-layout",
3
- "version": "3.71.0",
3
+ "version": "3.72.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",