@fasl-work/caos-app-shell 0.19.0 → 0.19.1
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/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/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.1",
|
|
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). */
|