@fasl-work/caos-app-shell 0.19.0 → 0.19.2
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/chart.js +4 -2
- package/dist/{chunk-3LONJM5B.js → chunk-FXPSZD6X.js} +7 -1
- package/dist/index.js +2 -2
- package/gate/inpage.mjs +13 -2
- package/package.json +1 -1
- package/styles.css +9 -0
package/dist/chart.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { pick, placeXLabel, placeYLabel, useShellLang, useThemeStore, useStageSize, defaultChartName, axisTitleFits, resolveToken, DRAG_THRESHOLD, sameData, NBSP, formatNumber, thinRows, chartSummary, referenceLineName, ZOOM_HINT, CHART_ROLE, ChartSummary, ChartDataTable, ResetZoomButton, formatTicks, countOverlaps, isZoomed, formatTime, keyAction, KEY_PAN, KEY_ZOOM, firstVisible, stepIndex, wheelFactor, pinchState, repeatedLabels, panRange, zoomRange, revealValue, brushRange, leastLabelSpan, MIN_SPAN_SHARE } from './chunk-
|
|
2
|
-
export { referenceLineName, repeatedLabels } from './chunk-
|
|
1
|
+
import { pick, placeXLabel, placeYLabel, useShellLang, useThemeStore, useStageSize, defaultChartName, axisTitleFits, resolveToken, dateNames, DRAG_THRESHOLD, sameData, NBSP, formatNumber, thinRows, chartSummary, referenceLineName, ZOOM_HINT, CHART_ROLE, ChartSummary, ChartDataTable, ResetZoomButton, formatTicks, countOverlaps, isZoomed, formatTime, keyAction, KEY_PAN, KEY_ZOOM, firstVisible, stepIndex, wheelFactor, pinchState, repeatedLabels, panRange, zoomRange, revealValue, brushRange, leastLabelSpan, MIN_SPAN_SHARE } from './chunk-FXPSZD6X.js';
|
|
2
|
+
export { referenceLineName, repeatedLabels } from './chunk-FXPSZD6X.js';
|
|
3
3
|
import './chunk-33WTUQ7Q.js';
|
|
4
4
|
import { useRef, useCallback, useState, useId, useEffect, useMemo } from 'react';
|
|
5
5
|
import uPlot from 'uplot';
|
|
@@ -672,6 +672,8 @@ function UPlotChart({ x, y, series, marks, yMarks, onYMarkChange, height = 280,
|
|
|
672
672
|
const opts = {
|
|
673
673
|
width,
|
|
674
674
|
height: h,
|
|
675
|
+
// the month and weekday names of a time axis in the page language: uPlot's own are English (0.19.1, SHC-099)
|
|
676
|
+
...x.time ? { fmtDate: /* @__PURE__ */ ((names) => (tpl) => uPlot.fmtDate(tpl, names))(dateNames(lang)) } : {},
|
|
675
677
|
legend: { show: false },
|
|
676
678
|
cursor: {
|
|
677
679
|
...scatter ? { dataIdx: (u2, sIdx, closest) => sIdx === 0 ? closest : nearest(u2) ?? closest } : {},
|
|
@@ -536,6 +536,12 @@ function leastLabelSpan(fmt, full, plotPx, spacePx) {
|
|
|
536
536
|
return res * (Math.ceil(Math.max(0, plotPx) / Math.max(1, spacePx)) + 1) / scale;
|
|
537
537
|
}
|
|
538
538
|
var SCIENTIFIC_FLOOR = 1e-4;
|
|
539
|
+
function dateNames(lang) {
|
|
540
|
+
const locale = lang === "es" ? "es-CL" : "en-US";
|
|
541
|
+
const month = (style) => Array.from({ length: 12 }, (_, m) => new Intl.DateTimeFormat(locale, { month: style, timeZone: "UTC" }).format(new Date(Date.UTC(2024, m, 15))));
|
|
542
|
+
const weekday = (style) => Array.from({ length: 7 }, (_, d) => new Intl.DateTimeFormat(locale, { weekday: style, timeZone: "UTC" }).format(new Date(Date.UTC(2024, 8, 1 + d))));
|
|
543
|
+
return { MMMM: month("long"), MMM: month("short"), WWWW: weekday("long"), WWW: weekday("short") };
|
|
544
|
+
}
|
|
539
545
|
function formatTime(seconds, lang, spanSeconds) {
|
|
540
546
|
const short = spanSeconds < 3 * 86400;
|
|
541
547
|
const opts = short ? { year: "numeric", month: "short", day: "numeric", hour: "2-digit", minute: "2-digit" } : { year: "numeric", month: "short", day: "numeric" };
|
|
@@ -677,4 +683,4 @@ function placeYLabel(text, s) {
|
|
|
677
683
|
return null;
|
|
678
684
|
}
|
|
679
685
|
|
|
680
|
-
export { CHART_ROLE, ChartDataTable, ChartSummary, DRAG_THRESHOLD, GROUP_MARGIN, KEY_PAN, KEY_ZOOM, MIN_SPAN_SHARE, NBSP, NOT_AVAILABLE, ResetZoomButton, SCIENTIFIC_BELOW, SHELL_TOKENS, Stage, ZOOM_HINT, allIntegers, applyTheme, axisTitleFits, bandsOf, barExtent, brushRange, brushWindow, categoryAt, chartSummary, clipExtent, countOverlaps, defaultChartName, firstVisible, fitLabel, fontFamily, formatNumber, formatTicks, formatTime, isZoomed, keyAction, leastLabelSpan, memberAt, memberSlots, niceStep, niceTicks, panRange, pick, pinchState, placeXLabel, placeYLabel, readTheme, referenceLineName, repeatedLabels, resolveToken, revealValue, roundWindow, sameData, stepIndex, stepWindow, textWidth, thinRows, unusedLegendTones, useFormat, useLangStore, useShellLang, useStageSize, useThemeStore, useThemeTokens, wheelFactor, widestLabel, windowRange, windowZoomed, wrapLines, zoomRange };
|
|
686
|
+
export { CHART_ROLE, ChartDataTable, ChartSummary, DRAG_THRESHOLD, GROUP_MARGIN, KEY_PAN, KEY_ZOOM, MIN_SPAN_SHARE, NBSP, NOT_AVAILABLE, ResetZoomButton, SCIENTIFIC_BELOW, SHELL_TOKENS, Stage, ZOOM_HINT, allIntegers, applyTheme, axisTitleFits, bandsOf, barExtent, brushRange, brushWindow, categoryAt, chartSummary, clipExtent, countOverlaps, dateNames, defaultChartName, firstVisible, fitLabel, fontFamily, formatNumber, formatTicks, formatTime, isZoomed, keyAction, leastLabelSpan, memberAt, memberSlots, niceStep, niceTicks, panRange, pick, pinchState, placeXLabel, placeYLabel, readTheme, referenceLineName, repeatedLabels, resolveToken, revealValue, roundWindow, sameData, stepIndex, stepWindow, textWidth, thinRows, unusedLegendTones, useFormat, useLangStore, useShellLang, useStageSize, useThemeStore, useThemeTokens, wheelFactor, widestLabel, windowRange, windowZoomed, wrapLines, zoomRange };
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { useThemeStore, useShellLang, useLangStore, SHELL_TOKENS, pick, useStageSize, barExtent, clipExtent, allIntegers, bandsOf, windowRange, windowZoomed, unusedLegendTones, NOT_AVAILABLE, formatNumber, widestLabel, fitLabel, GROUP_MARGIN, axisTitleFits, wrapLines, formatTicks, niceTicks, textWidth, repeatedLabels, chartSummary, NBSP, CHART_ROLE, ChartSummary, ChartDataTable, ResetZoomButton, memberSlots, wheelFactor, pinchState, DRAG_THRESHOLD, panRange, brushWindow, keyAction, KEY_ZOOM, stepIndex, KEY_PAN, stepWindow, roundWindow, zoomRange, categoryAt, memberAt } from './chunk-
|
|
2
|
-
export { NBSP, NOT_AVAILABLE, SCIENTIFIC_BELOW, SHELL_TOKENS, Stage, applyTheme, fitLabel, fontFamily, formatNumber, formatTicks, niceStep, niceTicks, pick, readTheme, resolveToken, textWidth, useFormat, useLangStore, useShellLang, useStageSize, useThemeStore, useThemeTokens, widestLabel } from './chunk-
|
|
1
|
+
import { useThemeStore, useShellLang, useLangStore, SHELL_TOKENS, pick, useStageSize, barExtent, clipExtent, allIntegers, bandsOf, windowRange, windowZoomed, unusedLegendTones, NOT_AVAILABLE, formatNumber, widestLabel, fitLabel, GROUP_MARGIN, axisTitleFits, wrapLines, formatTicks, niceTicks, textWidth, repeatedLabels, chartSummary, NBSP, CHART_ROLE, ChartSummary, ChartDataTable, ResetZoomButton, memberSlots, wheelFactor, pinchState, DRAG_THRESHOLD, panRange, brushWindow, keyAction, KEY_ZOOM, stepIndex, KEY_PAN, stepWindow, roundWindow, zoomRange, categoryAt, memberAt } from './chunk-FXPSZD6X.js';
|
|
2
|
+
export { NBSP, NOT_AVAILABLE, SCIENTIFIC_BELOW, SHELL_TOKENS, Stage, applyTheme, fitLabel, fontFamily, formatNumber, formatTicks, niceStep, niceTicks, pick, readTheme, resolveToken, textWidth, useFormat, useLangStore, useShellLang, useStageSize, useThemeStore, useThemeTokens, widestLabel } from './chunk-FXPSZD6X.js';
|
|
3
3
|
import { APP_ROUTE, LANDING_ROUTE } from './chunk-33WTUQ7Q.js';
|
|
4
4
|
export { APP_ROUTE, LANDING_ROUTE, LANG_STORAGE_KEY, STANDARD_ROUTES, THEME_BOOT_SCRIPT, THEME_STORAGE_KEY } from './chunk-33WTUQ7Q.js';
|
|
5
5
|
import { createContext, Component, useState, useRef, useId, useEffect, useLayoutEffect, useCallback, useContext, useMemo, Children, isValidElement } from 'react';
|
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
|
|
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
|
|
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.
|
|
3
|
+
"version": "0.19.2",
|
|
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",
|
package/styles.css
CHANGED
|
@@ -705,6 +705,15 @@ svg.lucide { flex: none; }
|
|
|
705
705
|
.caos-views-row > *, .caos-views-row > .caos-plot.fill { flex: none; }
|
|
706
706
|
.caos-plot.fill > .caos-plot-body { flex: none; height: clamp(260px, 48vh, 440px); }
|
|
707
707
|
.caos-plot.fill > .caos-plot-note { max-height: none; overflow-y: visible; }
|
|
708
|
+
/* A filling card whose body holds flowing content takes the height of that content instead of the clamp, and what is wider
|
|
709
|
+
than the card scrolls sideways inside the body, never cut at its edge (0.19.1, SHC-100). Flowing content is a table that
|
|
710
|
+
is the body's own child, or any element the product marks `data-caos-flow` (a stack of a drawing and its tables, a long
|
|
711
|
+
table in a scroll box, panels of small multiples): content that sets its own heights, which the clamp and its hidden
|
|
712
|
+
overflow cut (CAOS_Contraste U16-R2b: whole tables and their right columns lost at 390 px). A drawing alone keeps the clamp. */
|
|
713
|
+
.caos-plot.fill > .caos-plot-body:has(> .caos-table, [data-caos-flow]) { height: auto; overflow-x: auto; overflow-y: visible; }
|
|
714
|
+
/* An equation wider than the phone scrolls in its box (above); its right edge fades and the box keeps a gap after the last
|
|
715
|
+
symbol, so the cut reads as more to scroll to and, scrolled to the end, the last symbol is whole (0.19.1, SHC-100). */
|
|
716
|
+
.equation { padding-right: 1.5rem; mask-image: linear-gradient(to right, #000 calc(100% - 1.5rem), transparent); }
|
|
708
717
|
}
|
|
709
718
|
@media (max-width: 760px) {
|
|
710
719
|
/* A phone wraps the cells instead of pushing the table past the page (found by the gate on the template). */
|