@makoai/app-sdk 2.30.1 → 2.30.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.
@@ -51,7 +51,7 @@ export interface PeriodPickerProps {
51
51
  export function PeriodPicker({ value, onChange, units = ["month", "quarter", "year"], custom = "month", min, max, label: labelProp, locale, labels, presets, className }: PeriodPickerProps) {
52
52
  const L = localeStrings("period", locale, labels)
53
53
  const label = labelProp ?? L.time
54
- const text = periodLabel(value, locale)
54
+ const text = periodLabel(value, locale, labels)
55
55
  const wide = !!(locale || presets?.length)
56
56
  const today = todayIso()
57
57
  const hi = max ?? today
@@ -166,7 +166,7 @@ function PickerMenu({ value, units, custom, min, max, today, L, locale, presets,
166
166
  on ? "border-brand bg-[color-mix(in_srgb,var(--brand)_8%,transparent)] font-semibold" : "hover:bg-accent",
167
167
  )}
168
168
  onClick={() => onPick(p)}>
169
- {periodLabel(p, locale)}{live && <small className="text-[10px] font-normal text-muted-foreground">{L.inProgress}</small>}
169
+ {periodLabel(p, locale, L)}{live && <small className="text-[10px] font-normal text-muted-foreground">{L.inProgress}</small>}
170
170
  </button>
171
171
  )
172
172
  })}
@@ -78,8 +78,8 @@ const month = (s: string, withYear = true) => `${MON[Number(s.slice(5, 7)) - 1]}
78
78
  * With a `locale` (2.29) the month names come from Intl in that language
79
79
  * ("nov. 2026", "16.–22. Nov 2026"). A preset reads as its name: "Last 28 days", "28 derniers jours".
80
80
  */
81
- export function periodLabel(p: Period, locale?: string): string {
82
- if (p.preset) return presetLabel(p.preset, locale);
81
+ export function periodLabel(p: Period, locale?: string, labels?: Parameters<typeof presetLabel>[2]): string {
82
+ if (p.preset) return presetLabel(p.preset, locale, labels);
83
83
  if (locale) return localLabel(p, locale);
84
84
  if (p.unit === "year") return p.from.slice(0, 4);
85
85
  if (p.unit === "quarter") return `Q${Math.floor(Number(p.from.slice(5, 7)) / 3) + 1} ${p.from.slice(0, 4)}`;
package/index.js CHANGED
@@ -38,7 +38,7 @@ import {
38
38
  * in a page (or this export) says which SDK a deployed app actually runs.
39
39
  * Kept in step with package.json by snapshot.test.mjs.
40
40
  */
41
- export const SDK_VERSION = "2.30.1";
41
+ export const SDK_VERSION = "2.30.3";
42
42
  if (typeof window !== "undefined") {
43
43
  try {
44
44
  window.__MAKO_APP_SDK__ = SDK_VERSION;
package/locale.js CHANGED
@@ -19,7 +19,7 @@ const en = {
19
19
  inProgress: "in progress", inProgressTitle: "In progress: the numbers are not final yet",
20
20
  from: "From", to: "To", apply: "Apply",
21
21
  quarterLabel: (q, y) => `Q${q} ${y}`,
22
- lastDays: n => `Last ${n} days`, mtd: "Month to date", qtd: "Quarter to date", ytd: "Year to date", allTime: "All time",
22
+ lastDays: n => (n === 1 ? "Today" : `Last ${n} days`), mtd: "Month to date", qtd: "Quarter to date", ytd: "Year to date", allTime: "All time",
23
23
  },
24
24
  filterBar: { filters: "Filters", reset: "Reset", resetTitle: "Back to the default filters", done: "Done" },
25
25
  filter: { all: "All", none: "None", many: n => `${n} selected`, only: "Only", search: "Search", noMatch: "No match", groupAll: label => `All ${label}` },
@@ -47,7 +47,7 @@ const fr = {
47
47
  inProgress: "en cours", inProgressTitle: "En cours : les chiffres ne sont pas encore définitifs",
48
48
  from: "Du", to: "Au", apply: "Appliquer",
49
49
  quarterLabel: (q, y) => `T${q} ${y}`,
50
- lastDays: n => `${n} derniers jours`, mtd: "Ce mois-ci", qtd: "Ce trimestre", ytd: "Cette année", allTime: "Toute la période",
50
+ lastDays: n => (n === 1 ? "Aujourd'hui" : `${n} derniers jours`), mtd: "Ce mois-ci", qtd: "Ce trimestre", ytd: "Cette année", allTime: "Toute la période",
51
51
  },
52
52
  filterBar: { filters: "Filtres", reset: "Réinitialiser", resetTitle: "Revenir aux filtres par défaut", done: "Terminé" },
53
53
  filter: { all: "Tous", none: "Aucun", many: n => `${n} sélectionnés`, only: "Seulement", search: "Rechercher", noMatch: "Aucun résultat", groupAll: label => `${label} (tout)` },
@@ -84,7 +84,7 @@ const de = {
84
84
  inProgress: "laufend", inProgressTitle: "Laufend: die Zahlen sind noch nicht endgültig",
85
85
  from: "Von", to: "Bis", apply: "Anwenden",
86
86
  quarterLabel: (q, y) => `Q${q} ${y}`,
87
- lastDays: n => `Letzte ${n} Tage`, mtd: "Dieser Monat", qtd: "Dieses Quartal", ytd: "Dieses Jahr", allTime: "Gesamter Zeitraum",
87
+ lastDays: n => (n === 1 ? "Heute" : `Letzte ${n} Tage`), mtd: "Dieser Monat", qtd: "Dieses Quartal", ytd: "Dieses Jahr", allTime: "Gesamter Zeitraum",
88
88
  },
89
89
  filterBar: { filters: "Filter", reset: "Zurücksetzen", resetTitle: "Zurück zu den Standardfiltern", done: "Fertig" },
90
90
  filter: { all: "Alle", none: "Keine", many: n => `${n} ausgewählt`, only: "Nur", search: "Suchen", noMatch: "Keine Treffer", groupAll: label => `${label} (alle)` },
@@ -121,7 +121,7 @@ const it = {
121
121
  inProgress: "in corso", inProgressTitle: "In corso: i numeri non sono ancora definitivi",
122
122
  from: "Da", to: "A", apply: "Applica",
123
123
  quarterLabel: (q, y) => `T${q} ${y}`,
124
- lastDays: n => `Ultimi ${n} giorni`, mtd: "Questo mese", qtd: "Questo trimestre", ytd: "Quest'anno", allTime: "Tutto il periodo",
124
+ lastDays: n => (n === 1 ? "Oggi" : `Ultimi ${n} giorni`), mtd: "Questo mese", qtd: "Questo trimestre", ytd: "Quest'anno", allTime: "Tutto il periodo",
125
125
  },
126
126
  filterBar: { filters: "Filtri", reset: "Reimposta", resetTitle: "Torna ai filtri predefiniti", done: "Fatto" },
127
127
  filter: { all: "Tutti", none: "Nessuno", many: n => `${n} selezionati`, only: "Solo", search: "Cerca", noMatch: "Nessun risultato", groupAll: label => `${label} (tutti)` },
@@ -158,7 +158,7 @@ const es = {
158
158
  inProgress: "en curso", inProgressTitle: "En curso: las cifras aún no son definitivas",
159
159
  from: "Desde", to: "Hasta", apply: "Aplicar",
160
160
  quarterLabel: (q, y) => `T${q} ${y}`,
161
- lastDays: n => `Últimos ${n} días`, mtd: "Este mes", qtd: "Este trimestre", ytd: "Este año", allTime: "Todo el periodo",
161
+ lastDays: n => (n === 1 ? "Hoy" : `Últimos ${n} días`), mtd: "Este mes", qtd: "Este trimestre", ytd: "Este año", allTime: "Todo el periodo",
162
162
  },
163
163
  filterBar: { filters: "Filtros", reset: "Restablecer", resetTitle: "Volver a los filtros por defecto", done: "Listo" },
164
164
  filter: { all: "Todos", none: "Ninguno", many: n => `${n} seleccionados`, only: "Solo", search: "Buscar", noMatch: "Sin resultados", groupAll: label => `${label} (todo)` },
@@ -195,7 +195,7 @@ const pl = {
195
195
  inProgress: "w toku", inProgressTitle: "W toku: liczby nie są jeszcze ostateczne",
196
196
  from: "Od", to: "Do", apply: "Zastosuj",
197
197
  quarterLabel: (q, y) => `Q${q} ${y}`,
198
- lastDays: n => `Ostatnie ${n} dni`, mtd: "Ten miesiąc", qtd: "Ten kwartał", ytd: "Ten rok", allTime: "Cały okres",
198
+ lastDays: n => (n === 1 ? "Dzisiaj" : `Ostatnie ${n} dni`), mtd: "Ten miesiąc", qtd: "Ten kwartał", ytd: "Ten rok", allTime: "Cały okres",
199
199
  },
200
200
  filterBar: { filters: "Filtry", reset: "Resetuj", resetTitle: "Przywróć domyślne filtry", done: "Gotowe" },
201
201
  filter: { all: "Wszystkie", none: "Brak", many: n => `Wybrano: ${n}`, only: "Tylko", search: "Szukaj", noMatch: "Brak wyników", groupAll: label => `${label} (wszystko)` },
@@ -232,7 +232,7 @@ const pt = {
232
232
  inProgress: "em curso", inProgressTitle: "Em curso: os números ainda não são definitivos",
233
233
  from: "De", to: "Até", apply: "Aplicar",
234
234
  quarterLabel: (q, y) => `T${q} ${y}`,
235
- lastDays: n => `Últimos ${n} dias`, mtd: "Este mês", qtd: "Este trimestre", ytd: "Este ano", allTime: "Todo o período",
235
+ lastDays: n => (n === 1 ? "Hoje" : `Últimos ${n} dias`), mtd: "Este mês", qtd: "Este trimestre", ytd: "Este ano", allTime: "Todo o período",
236
236
  },
237
237
  filterBar: { filters: "Filtros", reset: "Repor", resetTitle: "Voltar aos filtros predefinidos", done: "Concluído" },
238
238
  filter: { all: "Todos", none: "Nenhum", many: n => `${n} selecionados`, only: "Apenas", search: "Procurar", noMatch: "Sem resultados", groupAll: label => `${label} (tudo)` },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@makoai/app-sdk",
3
- "version": "2.30.1",
3
+ "version": "2.30.3",
4
4
  "description": "Mako app SDK: data bindings (useQuery/useDuckDB), URL state, theme, and the house dashboard kit (/ui).",
5
5
  "license": "MIT",
6
6
  "repository": {
package/ui.css CHANGED
@@ -215,19 +215,19 @@ button, input, select, textarea { font-family: inherit; }
215
215
  * resize a column. The table fills the card; its inline min-width (the sum of
216
216
  * the columns) makes it scroll sideways in a narrower card. */
217
217
  .mk-dt-table { width: 100%; table-layout: fixed; border-collapse: separate; border-spacing: 0; font-size: 13px; }
218
- .mk-dt-table th, .mk-dt-table td {
218
+ .mk-dt-table th:where(.mk-dt-table > * > tr > *), .mk-dt-table td:where(.mk-dt-table > * > tr > *) {
219
219
  padding: 7px 10px; text-align: left; white-space: nowrap; vertical-align: middle; overflow: hidden;
220
220
  border-bottom: 1px solid var(--mk-row-line); background: var(--card);
221
221
  }
222
222
  /* A row tint (rowClassName) sets --mk-dt-row-bg on the <tr>. Every body cell,
223
223
  * the pinned one included, paints it, so the tint survives the solid pin. */
224
- .mk-dt-table tbody td { background: var(--mk-dt-row-bg, var(--card)); }
225
- .mk-dt-table thead th {
224
+ .mk-dt-table tbody td:where(.mk-dt-table > * > tr > *) { background: var(--mk-dt-row-bg, var(--card)); }
225
+ .mk-dt-table thead th:where(.mk-dt-table > * > tr > *) {
226
226
  position: sticky; top: 0; z-index: 2; padding: 0; border-bottom: 0;
227
227
  font-size: 12px; font-weight: 500; color: var(--muted-foreground);
228
228
  box-shadow: inset 0 -1px 0 var(--border);
229
229
  }
230
- .mk-dt-table thead th.mk-dt-sorted { color: var(--foreground); }
230
+ .mk-dt-table thead th.mk-dt-sorted:where(.mk-dt-table > * > tr > *) { color: var(--foreground); }
231
231
  .mk-dt-label { display: flex; padding: 8px 10px; }
232
232
  .mk-dt-sort {
233
233
  appearance: none; display: flex; align-items: center; gap: 4px; width: 100%; min-width: 0; padding: 8px 10px;
@@ -240,28 +240,28 @@ button, input, select, textarea { font-family: inherit; }
240
240
  .mk-dt-sort svg { flex: none; }
241
241
  .mk-dt-faint { opacity: .35; }
242
242
  .mk-dt-table .mk-dt-num { text-align: right; font-variant-numeric: tabular-nums; }
243
- .mk-dt-table th.mk-dt-num :is(.mk-dt-sort, .mk-dt-label) { justify-content: flex-end; }
243
+ .mk-dt-table th.mk-dt-num:where(.mk-dt-table > * > tr > *) :is(.mk-dt-sort, .mk-dt-label) { justify-content: flex-end; }
244
244
  .mk-dt-table .mk-dt-center { text-align: center; }
245
- .mk-dt-table th.mk-dt-center :is(.mk-dt-sort, .mk-dt-label) { justify-content: center; }
245
+ .mk-dt-table th.mk-dt-center:where(.mk-dt-table > * > tr > *) :is(.mk-dt-sort, .mk-dt-label) { justify-content: center; }
246
246
  /* The pinned column: solid background and a hairline on its right edge. */
247
247
  .mk-dt-table .mk-dt-pin { position: sticky; left: 0; z-index: 1; box-shadow: inset -1px 0 0 var(--border); }
248
248
  /* The corner cell is pinned both ways and keeps BOTH borders: one box-shadow
249
249
  * would otherwise override the other and drop the header's bottom rule. */
250
- .mk-dt-table thead th.mk-dt-pin { z-index: 3; box-shadow: inset -1px 0 0 var(--border), inset 0 -1px 0 var(--border); }
250
+ .mk-dt-table thead th.mk-dt-pin:where(.mk-dt-table > * > tr > *) { z-index: 3; box-shadow: inset -1px 0 0 var(--border), inset 0 -1px 0 var(--border); }
251
251
  /* Column groups: a 2-row header. The whole <thead> sticks (two rows of
252
252
  * sticky cells would stack at top: 0) and the pinned corner still sticks
253
253
  * left. A group label spans its columns, centred, uppercase, with no rule
254
254
  * under it. A line runs down the left of each section, head to foot. */
255
255
  .mk-dt-table--grouped thead { position: sticky; top: 0; z-index: 2; }
256
- .mk-dt-table--grouped thead th { position: static; }
257
- .mk-dt-table--grouped thead th.mk-dt-pin { position: sticky; top: auto; left: 0; }
258
- .mk-dt-table thead th.mk-dt-group {
256
+ .mk-dt-table--grouped thead th:where(.mk-dt-table > * > tr > *) { position: static; }
257
+ .mk-dt-table--grouped thead th.mk-dt-pin:where(.mk-dt-table > * > tr > *) { position: sticky; top: auto; left: 0; }
258
+ .mk-dt-table thead th.mk-dt-group:where(.mk-dt-table > * > tr > *) {
259
259
  height: 26px; padding: 0 10px; text-align: center; box-shadow: none;
260
260
  font-size: 11px; font-weight: 600; letter-spacing: .075em; text-transform: uppercase;
261
261
  }
262
262
  .mk-dt-table .mk-dt-section { border-left: 1px solid var(--border); }
263
- .mk-dt-table tbody tr:hover > td { background: color-mix(in srgb, var(--muted) 50%, var(--mk-dt-row-bg, var(--card))); }
264
- .mk-dt-table tbody tr:last-child > td { border-bottom: 0; }
263
+ .mk-dt-table tbody tr:hover > td:where(.mk-dt-table > * > tr > *) { background: color-mix(in srgb, var(--muted) 50%, var(--mk-dt-row-bg, var(--card))); }
264
+ .mk-dt-table tbody tr:last-child > td:where(.mk-dt-table > * > tr > *) { border-bottom: 0; }
265
265
  .mk-dt-click { cursor: pointer; }
266
266
  .mk-dt-click:focus-visible { outline: none; }
267
267
  .mk-dt-click:focus-visible > td { background: color-mix(in srgb, var(--muted) 70%, var(--mk-dt-row-bg, var(--card))); }
@@ -270,7 +270,7 @@ button, input, select, textarea { font-family: inherit; }
270
270
  .mk-dt-cell :where(div, p) { overflow: hidden; text-overflow: ellipsis; }
271
271
  /* `truncate: false`: the text wraps inside the column; the width still holds. */
272
272
  .mk-dt-wrap { white-space: normal; overflow-wrap: anywhere; }
273
- .mk-dt-table td.mk-dt-empty { text-align: center; color: var(--muted-foreground); padding: 48px 10px; white-space: normal; }
273
+ .mk-dt-table td.mk-dt-empty:where(.mk-dt-table > * > tr > *) { text-align: center; color: var(--muted-foreground); padding: 48px 10px; white-space: normal; }
274
274
  /* `wrapHeaders`: a header label takes up to 2 lines instead of one ellipsized
275
275
  * line, so a client reads every word. The sort icon keeps its place beside it. */
276
276
  .mk-dt--wrap-heads .mk-dt-sort, .mk-dt--wrap-heads .mk-dt-label { white-space: normal; }
@@ -309,23 +309,23 @@ button, input, select, textarea { font-family: inherit; }
309
309
  .mk-dt-expander:focus-visible { outline: 2px solid var(--ring); outline-offset: -2px; }
310
310
  .mk-dt-expander svg { transform: rotate(-90deg); transition: transform .14s var(--mk-ease); }
311
311
  .mk-dt-expander[aria-expanded="true"] svg { transform: none; }
312
- .mk-dt-table tbody tr.mk-dt-open > td { border-bottom-color: transparent; }
313
- .mk-dt-table tbody tr.mk-dt-detail > td,
314
- .mk-dt-table tbody tr.mk-dt-detail:hover > td { padding: 0; white-space: normal; background: color-mix(in srgb, var(--muted) 40%, var(--card)); }
312
+ .mk-dt-table tbody tr.mk-dt-open > td:where(.mk-dt-table > * > tr > *) { border-bottom-color: transparent; }
313
+ .mk-dt-table tbody tr.mk-dt-detail > td:where(.mk-dt-table > * > tr > *),
314
+ .mk-dt-table tbody tr.mk-dt-detail:hover > td:where(.mk-dt-table > * > tr > *) { padding: 0; white-space: normal; background: color-mix(in srgb, var(--muted) 40%, var(--card)); }
315
315
  .mk-dt-detail-body { position: sticky; left: 0; padding: 10px 16px 14px 34px; overflow-wrap: anywhere; }
316
316
  /* `totalRow`: a <tfoot> pinned to the bottom of the scroll box, bold, with a
317
317
  * rule on top. Its first cell stays pinned left with the column. */
318
- .mk-dt-table tfoot td {
318
+ .mk-dt-table tfoot td:where(.mk-dt-table > * > tr > *) {
319
319
  position: sticky; bottom: 0; z-index: 2; border-bottom: 0; font-weight: 600;
320
320
  background: var(--card); box-shadow: inset 0 1px 0 var(--border);
321
321
  }
322
- .mk-dt-table tfoot td.mk-dt-pin { z-index: 3; box-shadow: inset -1px 0 0 var(--border), inset 0 1px 0 var(--border); }
323
- .mk-dt-table tfoot tr.mk-dt-total.mk-dt-click:hover > td,
324
- .mk-dt-table tfoot tr.mk-dt-total.mk-dt-click:focus-visible > td { background: color-mix(in srgb, var(--muted) 50%, var(--card)); }
322
+ .mk-dt-table tfoot td.mk-dt-pin:where(.mk-dt-table > * > tr > *) { z-index: 3; box-shadow: inset -1px 0 0 var(--border), inset 0 1px 0 var(--border); }
323
+ .mk-dt-table tfoot tr.mk-dt-total.mk-dt-click:hover > td:where(.mk-dt-table > * > tr > *),
324
+ .mk-dt-table tfoot tr.mk-dt-total.mk-dt-click:focus-visible > td:where(.mk-dt-table > * > tr > *) { background: color-mix(in srgb, var(--muted) 50%, var(--card)); }
325
325
  /* Section rows (2.30): one cell across the columns, a small muted heading
326
326
  * on a tinted band (agent-acquisition-funnel's "Inbound" / "Outbound"). */
327
- .mk-dt-table tbody tr.mk-dt-section-row > td,
328
- .mk-dt-table tbody tr.mk-dt-section-row:hover > td {
327
+ .mk-dt-table tbody tr.mk-dt-section-row > td:where(.mk-dt-table > * > tr > *),
328
+ .mk-dt-table tbody tr.mk-dt-section-row:hover > td:where(.mk-dt-table > * > tr > *) {
329
329
  padding: 0; background: color-mix(in srgb, var(--muted) 40%, var(--card));
330
330
  }
331
331
  .mk-dt-section-label {
@@ -337,20 +337,20 @@ button, input, select, textarea { font-family: inherit; }
337
337
  .mk-dt-skeleton { display: block; height: 14px; border-radius: calc(var(--radius, .625rem) - 2px); background: var(--accent); animation: mk-skeleton-pulse 2s cubic-bezier(.4, 0, .6, 1) infinite; }
338
338
  .mk-dt-table .mk-dt-num .mk-dt-skeleton { margin-left: auto; }
339
339
  .mk-dt-table .mk-dt-center .mk-dt-skeleton { margin-inline: auto; }
340
- .mk-dt-table tbody tr.mk-dt-skeleton-row:hover > td { background: var(--card); }
340
+ .mk-dt-table tbody tr.mk-dt-skeleton-row:hover > td:where(.mk-dt-table > * > tr > *) { background: var(--card); }
341
341
  @keyframes mk-skeleton-pulse { 50% { opacity: .5; } }
342
342
  .mk-dt-busy { opacity: .5; transition: opacity .15s; }
343
343
  /* Column resizing (2.30): a drag handle on each header's right edge, after
344
344
  * idx-portal's: a 2px line shows on hover, in brand while dragging. */
345
- .mk-dt-table--grouped thead th.mk-dt-resizable:not(.mk-dt-pin) { position: relative; }
345
+ .mk-dt-table--grouped thead th.mk-dt-resizable:not(.mk-dt-pin):where(.mk-dt-table > * > tr > *) { position: relative; }
346
346
  .mk-dt-resizer { position: absolute; top: 0; right: 0; bottom: 0; z-index: 4; width: 8px; cursor: col-resize; touch-action: none; user-select: none; }
347
347
  .mk-dt-resizer::after { content: ""; position: absolute; top: 8px; bottom: 8px; right: 0; width: 2px; border-radius: 1px; background: transparent; }
348
- .mk-dt-table th:hover > .mk-dt-resizer::after { background: var(--border); }
349
- .mk-dt-table th > .mk-dt-resizer:hover::after, .mk-dt-resizer--active::after { background: var(--brand); }
348
+ .mk-dt-table th:hover:where(.mk-dt-table > * > tr > *) > .mk-dt-resizer::after { background: var(--border); }
349
+ .mk-dt-table th:where(.mk-dt-table > * > tr > *) > .mk-dt-resizer:hover::after, .mk-dt-resizer--active::after { background: var(--brand); }
350
350
  body.mk-dt-col-resizing { cursor: col-resize; user-select: none; }
351
351
  /* "onEnd": the handle travels past its header while dragging, so that header
352
352
  * stops clipping and paints above its neighbours until release. */
353
- .mk-dt-table thead th:has(> .mk-dt-resizer--active) { overflow: visible; z-index: 5; }
353
+ .mk-dt-table thead th:has(> .mk-dt-resizer--active):where(.mk-dt-table > * > tr > *) { overflow: visible; z-index: 5; }
354
354
  .mk-dt-foot {
355
355
  flex: none; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px;
356
356
  padding: 8px 12px; border-top: 1px solid var(--border); font-size: 12px; color: var(--muted-foreground);