@fasl-work/caos-app-shell 0.19.1 → 0.19.3

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/index.js CHANGED
@@ -1014,7 +1014,7 @@ function DocReferences({ ids }) {
1014
1014
  return /* @__PURE__ */ jsxs("li", { children: [
1015
1015
  /* @__PURE__ */ jsx("span", { translate: "no", children: c.citation }),
1016
1016
  " ",
1017
- h ? /* @__PURE__ */ jsx("a", { href: h, target: "_blank", rel: "noreferrer noopener", className: "faint", children: c.doi ? /* @__PURE__ */ jsx("span", { translate: "no", children: `doi:${c.doi}` }) : "link" }) : null
1017
+ h ? /* @__PURE__ */ jsx("a", { href: h, target: "_blank", rel: "noreferrer noopener", className: "faint", children: c.doi ? /* @__PURE__ */ jsx("span", { translate: "no", children: `doi:${c.doi}` }) : lang === "es" ? "enlace" : "link" }) : null
1018
1018
  ] }, id);
1019
1019
  }) })
1020
1020
  ] });
@@ -1031,6 +1031,7 @@ function Refs({ ids, label }) {
1031
1031
  }
1032
1032
  function ReferenceList({ ids, heading }) {
1033
1033
  console.error("[caos-app-shell] ReferenceList is superseded by the end-of-page references block (ADR-0017 s4): give each DocSection its refs");
1034
+ const lang = useShellLang();
1034
1035
  const { list, byId } = useContext(CitationsContext);
1035
1036
  const items = ids ? ids.map((k) => byId[k]).filter(Boolean) : list;
1036
1037
  return /* @__PURE__ */ jsxs("section", { className: "references", "aria-label": heading ?? "References", children: [
@@ -1040,7 +1041,7 @@ function ReferenceList({ ids, heading }) {
1040
1041
  return /* @__PURE__ */ jsxs("li", { children: [
1041
1042
  /* @__PURE__ */ jsx("span", { translate: "no", children: c.citation }),
1042
1043
  " ",
1043
- h ? /* @__PURE__ */ jsx("a", { href: h, target: "_blank", rel: "noreferrer noopener", className: "faint", children: c.doi ? /* @__PURE__ */ jsx("span", { translate: "no", children: `doi:${c.doi}` }) : "link" }) : null
1044
+ h ? /* @__PURE__ */ jsx("a", { href: h, target: "_blank", rel: "noreferrer noopener", className: "faint", children: c.doi ? /* @__PURE__ */ jsx("span", { translate: "no", children: `doi:${c.doi}` }) : lang === "es" ? "enlace" : "link" }) : null
1044
1045
  ] }, c.id);
1045
1046
  }) })
1046
1047
  ] });
@@ -3802,8 +3803,8 @@ function isStale(dataKey, current) {
3802
3803
  }
3803
3804
  var LANE_LABELS = {
3804
3805
  live: { en: "Live in your browser", es: "En vivo en tu navegador" },
3805
- replay: { en: "Replay of the offline result", es: "Reproduce el resultado offline" },
3806
- offline: { en: "Offline only", es: "Solo offline" }
3806
+ replay: { en: "Replay of the offline result", es: "Reproduce el resultado precalculado" },
3807
+ offline: { en: "Offline only", es: "Solo precalculado" }
3807
3808
  };
3808
3809
  var PROVENANCE_LABELS = {
3809
3810
  real: { en: "Real data", es: "Datos reales" },
package/gate/inpage.mjs CHANGED
@@ -890,7 +890,7 @@ export function installLib() {
890
890
  }
891
891
  // the document is scrolled so the element shows below a header stuck at the top of the viewport (0.8.0: the
892
892
  // sticky header sticks in a scrolling document since known shell defect 26 was fixed)
893
- const cover = el.closest('header, [role="banner"]') ? 0 : stuckTop();
893
+ const cover = coverFor(el);
894
894
  const r = el.getBoundingClientRect();
895
895
  if (r.top < cover || r.bottom > window.innerHeight) winScroll(window.scrollX, window.scrollY + r.top + r.height / 2 - (cover + (window.innerHeight - cover) / 2));
896
896
  const r2 = el.getBoundingClientRect();
@@ -918,8 +918,19 @@ export function installLib() {
918
918
  return bottom;
919
919
  }
920
920
 
921
+ /** A link inside a static section <header> is still covered by the sticky site header above it. */
922
+ function coverFor(el) {
923
+ const header = el.closest('header, [role="banner"]');
924
+ if (header) {
925
+ const style = getComputedStyle(header);
926
+ const rect = header.getBoundingClientRect();
927
+ if ((style.position === 'sticky' || style.position === 'fixed') && rect.top <= 1 && rect.bottom > 0) return 0;
928
+ }
929
+ return stuckTop();
930
+ }
931
+
921
932
  const visibleArea = (el) => {
922
- const area = { left: 0, top: el.closest('header, [role="banner"]') ? 0 : stuckTop(), right: window.innerWidth, bottom: window.innerHeight };
933
+ const area = { left: 0, top: coverFor(el), right: window.innerWidth, bottom: window.innerHeight };
923
934
  for (let a = el.parentElement; a && a !== document.body && a !== document.documentElement; a = a.parentElement) {
924
935
  const s = getComputedStyle(a);
925
936
  if (s.overflowX === 'visible' && s.overflowY === 'visible') continue;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fasl-work/caos-app-shell",
3
- "version": "0.19.1",
3
+ "version": "0.19.3",
4
4
  "description": "Shared web-app shell, workbench primitives, content primitives, design system and measured gate for the CAOS / Faena public apps (ADR-0016, ADR-0017, ADR-0071).",
5
5
  "license": "MIT",
6
6
  "author": "Felipe Santibáñez-Leal",