@umriss-ui/dashboard 0.40.2 → 0.40.4

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/CHANGELOG.md CHANGED
@@ -12,6 +12,17 @@ upgrade reads that one.
12
12
 
13
13
  The dashboard joins the other five packages' one number at its first version: they are released together, and a package without a change of its own still gets a heading for it.
14
14
 
15
+ ## 0.40.4 – A larger font keeps its rows (Oct. 2026)
16
+
17
+ ### Fixed
18
+
19
+ - **The row unit's default grows with the reader's font size**: 50 px at the default size, more above it, rounded to whole pixels. At a browser font size of 200 %, widgets cut their content. `--u-dashboard-row` keeps its name; a theme that sets it keeps its value.
20
+
21
+ ## 0.40.3 – No change of its own (Oct. 2026)
22
+
23
+ Released with the other five packages under their one number. No change of its
24
+ own.
25
+
15
26
  ## 0.40.2 – No change of its own (Oct. 2026)
16
27
 
17
28
  Released with the other five packages under their one number. No change of its
@@ -1 +1 @@
1
- @layer umriss.tokens,umriss.base,umriss.components;@layer umriss.components{._root_xjsd2_17,._root_xjsd2_17:before,._root_xjsd2_17:after{box-sizing:border-box}._bar_xjsd2_34,._bar_xjsd2_34:before,._bar_xjsd2_34:after{box-sizing:border-box}._mode_xjsd2_43,._mode_xjsd2_43:before,._mode_xjsd2_43:after{box-sizing:border-box}._head_xjsd2_58,._head_xjsd2_58:before,._head_xjsd2_58:after{box-sizing:border-box}._editingHead_xjsd2_68,._editingHead_xjsd2_68:before,._editingHead_xjsd2_68:after{box-sizing:border-box}._grip_xjsd2_76,._grip_xjsd2_76:before,._grip_xjsd2_76:after{box-sizing:border-box}._title_xjsd2_81,._title_xjsd2_81:before,._title_xjsd2_81:after{box-sizing:border-box}._size_xjsd2_92,._size_xjsd2_92:before,._size_xjsd2_92:after{box-sizing:border-box}._item_xjsd2_100,._item_xjsd2_100:before,._item_xjsd2_100:after{box-sizing:border-box}._placeholder_xjsd2_110,._placeholder_xjsd2_110:before,._placeholder_xjsd2_110:after{box-sizing:border-box}._grid_xjsd2_116,._grid_xjsd2_116:before,._grid_xjsd2_116:after{box-sizing:border-box}._headingRow_xjsd2_133,._headingRow_xjsd2_133:before,._headingRow_xjsd2_133:after{box-sizing:border-box}._headingHead_xjsd2_138,._headingHead_xjsd2_138:before,._headingHead_xjsd2_138:after{box-sizing:border-box}._heading_xjsd2_133,._heading_xjsd2_133:before,._heading_xjsd2_133:after{box-sizing:border-box}._body_xjsd2_163,._body_xjsd2_163:before,._body_xjsd2_163:after{box-sizing:border-box}._options_xjsd2_189,._options_xjsd2_189:before,._options_xjsd2_189:after{box-sizing:border-box}._catalogue_xjsd2_194,._catalogue_xjsd2_194:before,._catalogue_xjsd2_194:after{box-sizing:border-box}._entry_xjsd2_202,._entry_xjsd2_202:before,._entry_xjsd2_202:after{box-sizing:border-box}._footprint_xjsd2_209,._footprint_xjsd2_209:before,._footprint_xjsd2_209:after{box-sizing:border-box}._entryText_xjsd2_221,._entryText_xjsd2_221:before,._entryText_xjsd2_221:after{box-sizing:border-box}._root_xjsd2_17{container-type:inline-size;width:100%;padding:0 var(--u-space-4) var(--u-space-4);border-radius:var(--u-radius-lg);corner-shape:squircle;--row-unit: var(--u-dashboard-row, 50px);--gap: var(--u-dashboard-gap, 12px)}._root_xjsd2_17[data-editing]{box-shadow:inset 0 0 0 2px var(--u-color-accent);outline:2px solid transparent;outline-offset:-2px}._bar_xjsd2_34{display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;gap:var(--u-space-2);padding-block:var(--u-space-3)}._mode_xjsd2_43{margin-inline-end:auto;padding:5px var(--u-space-2);border-radius:var(--u-radius-xs);corner-shape:squircle;background:var(--u-color-accent);color:var(--u-color-on-accent);font-family:var(--u-font-mono);font-size:var(--u-text-xs);font-weight:var(--u-weight-medium);line-height:var(--u-leading-none);letter-spacing:var(--u-tracking-caps);text-transform:uppercase}._head_xjsd2_58{display:flex;align-items:center;gap:6px;min-width:0;min-height:calc(var(--u-control-height) + 2px);padding:var(--u-space-2) var(--u-space-2) 0 var(--u-space-3);border-radius:var(--u-radius-lg) var(--u-radius-lg) 0 0;corner-shape:squircle}._editingHead_xjsd2_68{padding-block-end:var(--u-space-1);background:var(--u-color-surface-pressed);touch-action:none;user-select:none;cursor:grab}._grip_xjsd2_76{flex:none;color:var(--u-color-text-muted)}._title_xjsd2_81{flex:1 1 auto;min-width:0;margin:0;overflow:hidden;font-size:var(--u-text-sm);font-weight:var(--u-weight-medium);white-space:nowrap;text-overflow:ellipsis}._size_xjsd2_92{font-family:var(--u-font-mono);font-size:var(--u-text-xs);line-height:var(--u-leading-none);color:var(--u-color-text-muted);white-space:nowrap}._item_xjsd2_100[data-dragging]{position:relative;z-index:5;box-shadow:var(--u-shadow-overlay)}._item_xjsd2_100[data-dragging] ._editingHead_xjsd2_68{cursor:grabbing}._placeholder_xjsd2_110{border:2px dashed var(--u-color-accent);border-radius:var(--u-radius-lg);corner-shape:squircle;background:var(--u-color-accent-subtle)}._grid_xjsd2_116{display:grid;grid-template-columns:repeat(12,minmax(0,1fr));grid-auto-rows:var(--row-unit);gap:var(--gap);max-width:var(--u-dashboard-max-width, 1560px)}._item_xjsd2_100{grid-column:var(--column) / span var(--columns);grid-row:var(--row) / span var(--rows);min-height:0;min-width:0}._headingRow_xjsd2_133{display:flex;align-items:stretch}._headingHead_xjsd2_138{flex:1 1 auto;align-items:flex-end;padding:0 var(--u-space-2) 0 2px;border-radius:var(--u-radius-md);corner-shape:squircle}._headingRow_xjsd2_133[data-editing] ._headingHead_xjsd2_138{align-items:center;padding-inline-start:var(--u-space-3);padding-block-end:0}._heading_xjsd2_133{flex:1 1 auto;min-width:0;margin:0;padding-block-end:calc(var(--u-space-1) + 2px);font-size:var(--u-text-lg)}._headingRow_xjsd2_133[data-editing] ._heading_xjsd2_133{padding-block-end:0}._body_xjsd2_163{flex:1 1 auto;min-height:0;padding:2px var(--u-space-3) 10px;overflow:hidden}._item_xjsd2_100[data-editing] ._body_xjsd2_163{padding-block-start:var(--u-space-2)}@container (max-width: 755px){._grid_xjsd2_116{grid-template-columns:minmax(0,1fr);grid-auto-rows:auto}._item_xjsd2_100{grid-column:1;grid-row:auto;order:var(--order, 0);height:calc(var(--rows) * var(--row-unit) + (var(--rows) - 1) * var(--gap))}}._options_xjsd2_189{min-width:16rem;padding:var(--u-space-3)}._catalogue_xjsd2_194{list-style:none;margin:0;padding:0;display:grid;gap:var(--u-space-3, 12px)}._entry_xjsd2_202{display:grid;grid-template-columns:4.5rem 1fr auto;align-items:center;gap:var(--u-space-3, 12px)}._footprint_xjsd2_209{aspect-ratio:3 / 1;border-radius:2px;corner-shape:squircle;box-shadow:var(--u-edge)}._footprint_xjsd2_209>span{box-sizing:border-box}._footprint_xjsd2_209>span{display:block;background:var(--u-color-accent, currentColor);opacity:.5}._entryText_xjsd2_221{display:grid}}
1
+ @layer umriss.tokens,umriss.base,umriss.components;@layer umriss.components{._root_1d7h6_17,._root_1d7h6_17:before,._root_1d7h6_17:after{box-sizing:border-box}._bar_1d7h6_34,._bar_1d7h6_34:before,._bar_1d7h6_34:after{box-sizing:border-box}._mode_1d7h6_43,._mode_1d7h6_43:before,._mode_1d7h6_43:after{box-sizing:border-box}._head_1d7h6_58,._head_1d7h6_58:before,._head_1d7h6_58:after{box-sizing:border-box}._editingHead_1d7h6_68,._editingHead_1d7h6_68:before,._editingHead_1d7h6_68:after{box-sizing:border-box}._grip_1d7h6_76,._grip_1d7h6_76:before,._grip_1d7h6_76:after{box-sizing:border-box}._title_1d7h6_81,._title_1d7h6_81:before,._title_1d7h6_81:after{box-sizing:border-box}._size_1d7h6_92,._size_1d7h6_92:before,._size_1d7h6_92:after{box-sizing:border-box}._item_1d7h6_100,._item_1d7h6_100:before,._item_1d7h6_100:after{box-sizing:border-box}._placeholder_1d7h6_110,._placeholder_1d7h6_110:before,._placeholder_1d7h6_110:after{box-sizing:border-box}._grid_1d7h6_116,._grid_1d7h6_116:before,._grid_1d7h6_116:after{box-sizing:border-box}._headingRow_1d7h6_133,._headingRow_1d7h6_133:before,._headingRow_1d7h6_133:after{box-sizing:border-box}._headingHead_1d7h6_138,._headingHead_1d7h6_138:before,._headingHead_1d7h6_138:after{box-sizing:border-box}._heading_1d7h6_133,._heading_1d7h6_133:before,._heading_1d7h6_133:after{box-sizing:border-box}._body_1d7h6_163,._body_1d7h6_163:before,._body_1d7h6_163:after{box-sizing:border-box}._options_1d7h6_189,._options_1d7h6_189:before,._options_1d7h6_189:after{box-sizing:border-box}._catalogue_1d7h6_194,._catalogue_1d7h6_194:before,._catalogue_1d7h6_194:after{box-sizing:border-box}._entry_1d7h6_202,._entry_1d7h6_202:before,._entry_1d7h6_202:after{box-sizing:border-box}._footprint_1d7h6_209,._footprint_1d7h6_209:before,._footprint_1d7h6_209:after{box-sizing:border-box}._entryText_1d7h6_221,._entryText_1d7h6_221:before,._entryText_1d7h6_221:after{box-sizing:border-box}._root_1d7h6_17{container-type:inline-size;width:100%;padding:0 var(--u-space-4) var(--u-space-4);border-radius:var(--u-radius-lg);corner-shape:squircle;--row-unit: var(--u-dashboard-row, round(max(50px, 3.125rem), 1px));--gap: var(--u-dashboard-gap, 12px)}._root_1d7h6_17[data-editing]{box-shadow:inset 0 0 0 2px var(--u-color-accent);outline:2px solid transparent;outline-offset:-2px}._bar_1d7h6_34{display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;gap:var(--u-space-2);padding-block:var(--u-space-3)}._mode_1d7h6_43{margin-inline-end:auto;padding:5px var(--u-space-2);border-radius:var(--u-radius-xs);corner-shape:squircle;background:var(--u-color-accent);color:var(--u-color-on-accent);font-family:var(--u-font-mono);font-size:var(--u-text-xs);font-weight:var(--u-weight-medium);line-height:var(--u-leading-none);letter-spacing:var(--u-tracking-caps);text-transform:uppercase}._head_1d7h6_58{display:flex;align-items:center;gap:6px;min-width:0;min-height:calc(var(--u-control-height) + 2px);padding:var(--u-space-2) var(--u-space-2) 0 var(--u-space-3);border-radius:var(--u-radius-lg) var(--u-radius-lg) 0 0;corner-shape:squircle}._editingHead_1d7h6_68{padding-block-end:var(--u-space-1);background:var(--u-color-surface-pressed);touch-action:none;user-select:none;cursor:grab}._grip_1d7h6_76{flex:none;color:var(--u-color-text-muted)}._title_1d7h6_81{flex:1 1 auto;min-width:0;margin:0;overflow:hidden;font-size:var(--u-text-sm);font-weight:var(--u-weight-medium);white-space:nowrap;text-overflow:ellipsis}._size_1d7h6_92{font-family:var(--u-font-mono);font-size:var(--u-text-xs);line-height:var(--u-leading-none);color:var(--u-color-text-muted);white-space:nowrap}._item_1d7h6_100[data-dragging]{position:relative;z-index:5;box-shadow:var(--u-shadow-overlay)}._item_1d7h6_100[data-dragging] ._editingHead_1d7h6_68{cursor:grabbing}._placeholder_1d7h6_110{border:2px dashed var(--u-color-accent);border-radius:var(--u-radius-lg);corner-shape:squircle;background:var(--u-color-accent-subtle)}._grid_1d7h6_116{display:grid;grid-template-columns:repeat(12,minmax(0,1fr));grid-auto-rows:var(--row-unit);gap:var(--gap);max-width:var(--u-dashboard-max-width, 1560px)}._item_1d7h6_100{grid-column:var(--column) / span var(--columns);grid-row:var(--row) / span var(--rows);min-height:0;min-width:0}._headingRow_1d7h6_133{display:flex;align-items:stretch}._headingHead_1d7h6_138{flex:1 1 auto;align-items:flex-end;padding:0 var(--u-space-2) 0 2px;border-radius:var(--u-radius-md);corner-shape:squircle}._headingRow_1d7h6_133[data-editing] ._headingHead_1d7h6_138{align-items:center;padding-inline-start:var(--u-space-3);padding-block-end:0}._heading_1d7h6_133{flex:1 1 auto;min-width:0;margin:0;padding-block-end:calc(var(--u-space-1) + 2px);font-size:var(--u-text-lg)}._headingRow_1d7h6_133[data-editing] ._heading_1d7h6_133{padding-block-end:0}._body_1d7h6_163{flex:1 1 auto;min-height:0;padding:2px var(--u-space-3) 10px;overflow:hidden}._item_1d7h6_100[data-editing] ._body_1d7h6_163{padding-block-start:var(--u-space-2)}@container (max-width: 755px){._grid_1d7h6_116{grid-template-columns:minmax(0,1fr);grid-auto-rows:auto}._item_1d7h6_100{grid-column:1;grid-row:auto;order:var(--order, 0);height:calc(var(--rows) * var(--row-unit) + (var(--rows) - 1) * var(--gap))}}._options_1d7h6_189{min-width:16rem;padding:var(--u-space-3)}._catalogue_1d7h6_194{list-style:none;margin:0;padding:0;display:grid;gap:var(--u-space-3, 12px)}._entry_1d7h6_202{display:grid;grid-template-columns:4.5rem 1fr auto;align-items:center;gap:var(--u-space-3, 12px)}._footprint_1d7h6_209{aspect-ratio:3 / 1;border-radius:2px;corner-shape:squircle;box-shadow:var(--u-edge)}._footprint_1d7h6_209>span{box-sizing:border-box}._footprint_1d7h6_209>span{display:block;background:var(--u-color-accent, currentColor);opacity:.5}._entryText_1d7h6_221{display:grid}}
package/dist/dashboard.js CHANGED
@@ -1,24 +1,24 @@
1
1
  "use client";
2
2
  import "./dashboard.css";
3
- import { Component as ye, useState as Z, useRef as E, useLayoutEffect as de, useMemo as oe, Children as ze, isValidElement as ie, useEffect as ne, useSyncExternalStore as ce, createElement as Me } from "react";
4
- import { useWording as ae, FormField as ve, Input as Ce, Button as L, Text as K, GripGlyph as le, Heading as Se, Card as Ne, Drawer as ke, ModalHeader as je, ModalBody as He, Popover as Ee, announce as $, Menu as Oe, MenuItem as B, MenuSeparator as se } from "@umriss-ui/core";
5
- import { jsx as a, jsxs as H, Fragment as re } from "react/jsx-runtime";
6
- const Re = (s, n) => (d) => {
3
+ import { Component as xe, useState as Z, useRef as O, useLayoutEffect as de, useMemo as oe, Children as ze, isValidElement as ie, useEffect as ne, useSyncExternalStore as ce, createElement as Me } from "react";
4
+ import { useWording as ae, FormField as ve, Input as Ce, Button as $, Text as K, GripGlyph as le, Heading as Se, Card as Ne, Drawer as ke, ModalHeader as He, ModalBody as Ee, Popover as Oe, announce as A, Menu as Re, MenuItem as U, MenuSeparator as se } from "@umriss-ui/core";
5
+ import { jsx as a, jsxs as E, Fragment as re } from "react/jsx-runtime";
6
+ const Te = (s, n) => (d) => {
7
7
  const c = d.widgets.findIndex((t) => t.id === s), C = Math.max(0, Math.min(d.widgets.length - 1, n));
8
8
  if (c < 0 || c === C) return d;
9
- const y = [...d.widgets];
10
- return y.splice(C, 0, ...y.splice(c, 1)), { ...d, widgets: y };
11
- }, Te = (s, n) => (d) => d.widgets.some((c) => c.id === s && c.size !== n) ? { ...d, widgets: d.widgets.map((c) => c.id === s ? { ...c, size: n } : c) } : d, De = (s) => (n) => n.widgets.some((d) => d.id === s) ? { ...n, widgets: n.widgets.filter((d) => d.id !== s) } : n, Ie = (s, n) => {
9
+ const x = [...d.widgets];
10
+ return x.splice(C, 0, ...x.splice(c, 1)), { ...d, widgets: x };
11
+ }, De = (s, n) => (d) => d.widgets.some((c) => c.id === s && c.size !== n) ? { ...d, widgets: d.widgets.map((c) => c.id === s ? { ...c, size: n } : c) } : d, Ie = (s) => (n) => n.widgets.some((d) => d.id === s) ? { ...n, widgets: n.widgets.filter((d) => d.id !== s) } : n, Le = (s, n) => {
12
12
  let d = 1;
13
13
  for (; s.widgets.some((c) => c.id === `${n}-${d}`); ) d++;
14
14
  return `${n}-${d}`;
15
- }, Le = (s) => (n) => ({ ...n, widgets: [...n.widgets, s] }), $e = (s, n) => (d) => ({ ...d, widgets: d.widgets.map((c) => c.id === s ? { ...c, options: n } : c) }), Ae = "_root_xjsd2_17", Fe = "_bar_xjsd2_34", Pe = "_mode_xjsd2_43", Be = "_head_xjsd2_58", Ue = "_editingHead_xjsd2_68", Ve = "_grip_xjsd2_76", Ge = "_title_xjsd2_81", We = "_size_xjsd2_92", Ye = "_item_xjsd2_100", Xe = "_placeholder_xjsd2_110", Je = "_grid_xjsd2_116", Ke = "_headingRow_xjsd2_133", qe = "_headingHead_xjsd2_138", Qe = "_heading_xjsd2_133", Ze = "_body_xjsd2_163", et = "_options_xjsd2_189", tt = "_catalogue_xjsd2_194", nt = "_entry_xjsd2_202", st = "_footprint_xjsd2_209", rt = "_entryText_xjsd2_221", _ = {
16
- root: Ae,
17
- bar: Fe,
18
- mode: Pe,
19
- head: Be,
20
- editingHead: Ue,
21
- grip: Ve,
15
+ }, $e = (s) => (n) => ({ ...n, widgets: [...n.widgets, s] }), Ae = (s, n) => (d) => ({ ...d, widgets: d.widgets.map((c) => c.id === s ? { ...c, options: n } : c) }), Fe = "_root_1d7h6_17", Pe = "_bar_1d7h6_34", Be = "_mode_1d7h6_43", Ue = "_head_1d7h6_58", Ve = "_editingHead_1d7h6_68", je = "_grip_1d7h6_76", Ge = "_title_1d7h6_81", We = "_size_1d7h6_92", Ye = "_item_1d7h6_100", Xe = "_placeholder_1d7h6_110", Je = "_grid_1d7h6_116", Ke = "_headingRow_1d7h6_133", qe = "_headingHead_1d7h6_138", Qe = "_heading_1d7h6_133", Ze = "_body_1d7h6_163", et = "_options_1d7h6_189", tt = "_catalogue_1d7h6_194", nt = "_entry_1d7h6_202", st = "_footprint_1d7h6_209", rt = "_entryText_1d7h6_221", y = {
16
+ root: Fe,
17
+ bar: Pe,
18
+ mode: Be,
19
+ head: Ue,
20
+ editingHead: Ve,
21
+ grip: je,
22
22
  title: Ge,
23
23
  size: We,
24
24
  item: Ye,
@@ -34,7 +34,7 @@ const Re = (s, n) => (d) => {
34
34
  footprint: st,
35
35
  entryText: rt
36
36
  };
37
- class ot extends ye {
37
+ class ot extends xe {
38
38
  state = { failed: !1 };
39
39
  static getDerivedStateFromError() {
40
40
  return { failed: !0 };
@@ -57,37 +57,37 @@ function ge(s, n) {
57
57
  };
58
58
  }
59
59
  function me(s, n) {
60
- const d = /* @__PURE__ */ new Set(), c = (y, t, w, i) => {
61
- for (let h = y; h < y + i; h++) for (let m = t; m < t + w; m++) if (d.has(h * n + m)) return !1;
60
+ const d = /* @__PURE__ */ new Set(), c = (x, t, w, i) => {
61
+ for (let h = x; h < x + i; h++) for (let m = t; m < t + w; m++) if (d.has(h * n + m)) return !1;
62
62
  return !0;
63
63
  };
64
64
  let C = 0;
65
- return s.map((y) => {
66
- const t = Math.min(y.columns, n);
65
+ return s.map((x) => {
66
+ const t = Math.min(x.columns, n);
67
67
  for (let w = C; ; w++) {
68
68
  const i = Math.floor(w / n), h = w % n;
69
- if (!(h + t > n || !c(i, h, t, y.rows))) {
70
- for (let m = i; m < i + y.rows; m++) for (let p = h; p < h + t; p++) d.add(m * n + p);
71
- return C = w, { column: h, row: i, columns: t, rows: y.rows };
69
+ if (!(h + t > n || !c(i, h, t, x.rows))) {
70
+ for (let m = i; m < i + x.rows; m++) for (let p = h; p < h + t; p++) d.add(m * n + p);
71
+ return C = w, { column: h, row: i, columns: t, rows: x.rows };
72
72
  }
73
73
  }
74
74
  });
75
75
  }
76
- function at(s, n, d, c, C, { cell: y, unit: t, gap: w }) {
76
+ function at(s, n, d, c, C, { cell: x, unit: t, gap: w }) {
77
77
  let i = d, h = 1 / 0;
78
78
  for (let m = 0; m < s.length; m++) {
79
79
  const p = [...s];
80
80
  p.splice(m, 0, ...p.splice(d, 1));
81
- const T = me(p, n)[m], k = (T.column * (y + w) - c) ** 2 + (T.row * (t + w) - C) ** 2;
81
+ const D = me(p, n)[m], k = (D.column * (x + w) - c) ** 2 + (D.row * (t + w) - C) ** 2;
82
82
  k < h && (h = k, i = m);
83
83
  }
84
84
  return i;
85
85
  }
86
86
  const dt = { 3: "¼", 4: "⅓", 6: "½", 8: "⅔", 9: "¾" }, it = ({ columns: s }) => s >= 12 ? "" : dt[s] ?? `${s}/12`;
87
87
  function ct({ grid: s, cards: n, shown: d, drop: c, cancelled: C }) {
88
- const [y, t] = Z(null), w = E(null), i = E({}), h = E(/* @__PURE__ */ new Map()), m = E(null), p = E({ update: () => {
88
+ const [x, t] = Z(null), w = O(null), i = O({}), h = O(/* @__PURE__ */ new Map()), m = O(null), p = O({ update: () => {
89
89
  }, finish: () => {
90
- } }), T = () => {
90
+ } }), D = () => {
91
91
  const r = w.current, o = r && n.get(r.id);
92
92
  if (!r || !m.current || !o) return;
93
93
  const l = m.current.getBoundingClientRect();
@@ -97,16 +97,16 @@ function ct({ grid: s, cards: n, shown: d, drop: c, cancelled: C }) {
97
97
  const r = /* @__PURE__ */ new Map(), o = window.matchMedia("(prefers-reduced-motion: reduce)").matches;
98
98
  for (const [l, g] of n) {
99
99
  const M = h.current.get(l);
100
- r.set(l, [g.offsetLeft, g.offsetTop]), y && !o && M && l !== y.id && (M[0] !== g.offsetLeft || M[1] !== g.offsetTop) && g.animate([{ transform: `translate(${M[0] - g.offsetLeft}px, ${M[1] - g.offsetTop}px)` }, { transform: "none" }], { duration: 150, easing: "ease-out" });
100
+ r.set(l, [g.offsetLeft, g.offsetTop]), x && !o && M && l !== x.id && (M[0] !== g.offsetLeft || M[1] !== g.offsetTop) && g.animate([{ transform: `translate(${M[0] - g.offsetLeft}px, ${M[1] - g.offsetTop}px)` }, { transform: "none" }], { duration: 150, easing: "ease-out" });
101
101
  }
102
- h.current = r, y && T();
102
+ h.current = r, x && D();
103
103
  });
104
104
  const k = () => {
105
105
  const r = w.current, o = s.current, l = r && n.get(r.id);
106
106
  if (!r || !o || !l) return;
107
- const g = getComputedStyle(o), M = parseFloat(g.columnGap), F = g.gridTemplateColumns.split(" ").length, O = o.getBoundingClientRect(), R = d[r.from].span, Y = { cell: (O.width - (F - 1) * M) / F, gap: M, unit: (l.offsetHeight - (R.rows - 1) * M) / R.rows }, I = at(d.map((V) => V.span), F, r.from, r.x - r.dx - O.left, r.y - r.dy - O.top, Y);
108
- if (I === r.target) return T();
109
- r.target = I, t({ id: r.id, target: I });
107
+ const g = getComputedStyle(o), M = parseFloat(g.columnGap), P = g.gridTemplateColumns.split(" ").length, R = o.getBoundingClientRect(), T = d[r.from].span, Y = { cell: (R.width - (P - 1) * M) / P, gap: M, unit: (l.offsetHeight - (T.rows - 1) * M) / T.rows }, L = at(d.map((j) => j.span), P, r.from, r.x - r.dx - R.left, r.y - r.dy - R.top, Y);
108
+ if (L === r.target) return D();
109
+ r.target = L, t({ id: r.id, target: L });
110
110
  }, W = (r) => {
111
111
  const o = w.current;
112
112
  if (w.current = null, window.clearInterval(i.current.timer), i.current.escape && document.removeEventListener("keydown", i.current.escape), o && n.get(o.id)?.style.removeProperty("transform"), t(null), !!o?.started) {
@@ -117,12 +117,12 @@ function ct({ grid: s, cards: n, shown: d, drop: c, cancelled: C }) {
117
117
  de(() => {
118
118
  p.current = { update: k, finish: W };
119
119
  });
120
- const U = (r, o) => (l) => {
120
+ const V = (r, o) => (l) => {
121
121
  const g = l.target;
122
122
  if (l.button > 0 || g.closest("button") || !l.currentTarget.contains(g)) return;
123
123
  const M = n.get(r).getBoundingClientRect();
124
124
  w.current = { id: r, from: o, x0: l.clientX, y0: l.clientY, x: l.clientX, y: l.clientY, dx: l.clientX - M.left, dy: l.clientY - M.top, started: !1, target: o }, l.currentTarget.setPointerCapture(l.pointerId);
125
- }, A = (r) => {
125
+ }, F = (r) => {
126
126
  const o = w.current;
127
127
  if (o) {
128
128
  if (o.x = r.clientX, o.y = r.clientY, !o.started) {
@@ -136,13 +136,13 @@ function ct({ grid: s, cards: n, shown: d, drop: c, cancelled: C }) {
136
136
  }
137
137
  };
138
138
  return {
139
- drag: y,
139
+ drag: x,
140
140
  /** To go on the placeholder. */
141
141
  placeholder: m,
142
142
  /** The pointer handlers of a widget's head. */
143
143
  handlers: (r, o) => ({
144
- onPointerDown: U(r, o),
145
- onPointerMove: A,
144
+ onPointerDown: V(r, o),
145
+ onPointerMove: F,
146
146
  onPointerUp: () => p.current.finish(!0),
147
147
  onPointerCancel: () => p.current.finish(!1)
148
148
  })
@@ -179,86 +179,86 @@ function pt({ render: s, ...n }) {
179
179
  const he = (s, n) => ({ "--column": s.column + 1, "--row": s.row + 1, "--columns": s.columns, "--rows": s.rows, "--order": n }), fe = (s) => s.columns * s.rows, ee = (s, n) => (d) => {
180
180
  d ? s.set(n, d) : s.delete(n);
181
181
  };
182
- function gt({ view: s, editor: n, className: d, children: c, catalogue: C, ...y }) {
182
+ function gt({ view: s, editor: n, className: d, children: c, catalogue: C, ...x }) {
183
183
  const t = ae(), w = oe(() => ft(t), [t]), i = /* @__PURE__ */ new Map();
184
184
  for (const e of ze.toArray(c))
185
185
  ie(e) && e.type === be ? i.set(e.props.name, e.props) : ie(e) && e.type === lt && i.set(w.name, w);
186
186
  const { register: h } = n;
187
187
  ne(() => h(i));
188
188
  const m = ge(s, i), p = m.widgets.flatMap((e) => {
189
- const u = i.get(e.type), x = u?.sizes[e.size];
190
- return u && x ? [{ widget: e, type: u, span: x }] : [];
191
- }), T = E(null), [k] = Z(() => /* @__PURE__ */ new Map()), [W] = Z(() => /* @__PURE__ */ new Map()), [U] = Z(() => /* @__PURE__ */ new Map()), A = E(null), { editing: r } = n, o = m.widgets.length, l = (e, u, x) => {
192
- const S = m.widgets.findIndex((D) => D.id === e), v = Math.max(0, Math.min(o - 1, x));
193
- S !== v && (n.step(Re(e, v)), $(t.dashboardMoved(u, S + 1, v + 1, o)));
194
- }, { drag: g, placeholder: M, handlers: F } = ct({
195
- grid: T,
189
+ const u = i.get(e.type), _ = u?.sizes[e.size];
190
+ return u && _ ? [{ widget: e, type: u, span: _ }] : [];
191
+ }), D = O(null), [k] = Z(() => /* @__PURE__ */ new Map()), [W] = Z(() => /* @__PURE__ */ new Map()), [V] = Z(() => /* @__PURE__ */ new Map()), F = O(null), { editing: r } = n, o = m.widgets.length, l = (e, u, _) => {
192
+ const S = m.widgets.findIndex((I) => I.id === e), v = Math.max(0, Math.min(o - 1, _));
193
+ S !== v && (n.step(Te(e, v)), A(t.dashboardMoved(u, S + 1, v + 1, o)));
194
+ }, { drag: g, placeholder: M, handlers: P } = ct({
195
+ grid: D,
196
196
  cards: k,
197
- shown: p.map(({ widget: e, type: u, span: x }) => ({ id: e.id, span: x, title: q(u, e.options) })),
197
+ shown: p.map(({ widget: e, type: u, span: _ }) => ({ id: e.id, span: _, title: q(u, e.options) })),
198
198
  drop: (e, u) => {
199
- const x = p.find((S) => S.widget.id === e);
200
- l(e, q(x.type, x.widget.options), m.widgets.findIndex((S) => S.id === u));
199
+ const _ = p.find((S) => S.widget.id === e);
200
+ l(e, q(_.type, _.widget.options), m.widgets.findIndex((S) => S.id === u));
201
201
  },
202
- cancelled: (e) => $(t.dashboardDragCancelled(e))
203
- }), O = g ? p.findIndex((e) => e.widget.id === g.id) : -1, R = p.map((e, u) => u);
204
- O >= 0 && R.splice(g.target, 0, ...R.splice(O, 1));
205
- const Y = me(R.map((e) => p[e].span), ue), I = p.map((e, u) => Y[R.indexOf(u)]), [V, b] = Z(null), f = E(null), z = E(null);
202
+ cancelled: (e) => A(t.dashboardDragCancelled(e))
203
+ }), R = g ? p.findIndex((e) => e.widget.id === g.id) : -1, T = p.map((e, u) => u);
204
+ R >= 0 && T.splice(g.target, 0, ...T.splice(R, 1));
205
+ const Y = me(T.map((e) => p[e].span), ue), L = p.map((e, u) => Y[T.indexOf(u)]), [j, b] = Z(null), f = O(null), z = O(null);
206
206
  ne(() => {
207
207
  z.current && (k.get(z.current)?.scrollIntoView?.({ block: "nearest" }), z.current = null);
208
208
  });
209
- const N = E(!1);
209
+ const N = O(!1);
210
210
  ne(() => {
211
- N.current !== !1 && ((N.current === null ? A.current : W.get(N.current))?.focus(), N.current = !1);
211
+ N.current !== !1 && ((N.current === null ? F.current : W.get(N.current))?.focus(), N.current = !1);
212
212
  });
213
- const P = [...i.values()].filter((e) => !C || C.includes(e.name)), G = (e) => {
214
- const u = { id: Ie(m, e.name), type: e.name, size: e.start, options: e.defaultOptions };
215
- z.current = u.id, n.step(Le(u)), $(t.dashboardAdded(q(e, u.options), o + 1, o + 1));
216
- }, X = V ? i.get(m.widgets.find((e) => e.id === V)?.type ?? "") : void 0, te = m.widgets.find((e) => e.id === V), we = (e, u, x, S) => r ? {
213
+ const B = [...i.values()].filter((e) => !C || C.includes(e.name)), G = (e) => {
214
+ const u = { id: Le(m, e.name), type: e.name, size: e.start, options: e.defaultOptions };
215
+ z.current = u.id, n.step($e(u)), A(t.dashboardAdded(q(e, u.options), o + 1, o + 1));
216
+ }, X = j ? i.get(m.widgets.find((e) => e.id === j)?.type ?? "") : void 0, te = m.widgets.find((e) => e.id === j), we = (e, u, _, S) => r ? {
217
217
  ref: ee(W, e.id),
218
- className: Q(_.head, _.editingHead),
219
- ...F(e.id, x),
218
+ className: Q(y.head, y.editingHead),
219
+ ...P(e.id, _),
220
220
  role: "group",
221
221
  tabIndex: 0,
222
222
  "aria-label": t.dashboardHead(u, S + 1, o),
223
223
  onKeyDown: (v) => {
224
224
  if (v.target !== v.currentTarget) return;
225
- const D = { ArrowLeft: S - 1, ArrowUp: S - 1, ArrowRight: S + 1, ArrowDown: S + 1, Home: 0, End: o - 1 }[v.key];
226
- D !== void 0 && (v.preventDefault(), l(e.id, u, D));
225
+ const I = { ArrowLeft: S - 1, ArrowUp: S - 1, ArrowRight: S + 1, ArrowDown: S + 1, Home: 0, End: o - 1 }[v.key];
226
+ I !== void 0 && (v.preventDefault(), l(e.id, u, I));
227
227
  }
228
- } : { className: _.head }, xe = (e, u, x, S, v) => {
229
- const D = Object.entries(u.sizes).sort(([, j], [, J]) => fe(j) - fe(J));
230
- return /* @__PURE__ */ H(
231
- Oe,
228
+ } : { className: y.head }, _e = (e, u, _, S, v) => {
229
+ const I = Object.entries(u.sizes).sort(([, H], [, J]) => fe(H) - fe(J));
230
+ return /* @__PURE__ */ E(
231
+ Re,
232
232
  {
233
233
  align: "end",
234
- trigger: /* @__PURE__ */ a(L, { ref: ee(U, e.id), size: "sm", variant: "ghost", "aria-label": t.dashboardMenu(x), children: /* @__PURE__ */ a("svg", { viewBox: "0 0 10 10", width: "10", height: "10", "aria-hidden": "true", fill: "none", stroke: "currentColor", strokeWidth: "1.4", strokeLinecap: "round", children: /* @__PURE__ */ a("path", { d: "M1.5 5h.01M5 5h.01M8.5 5h.01" }) }) }),
234
+ trigger: /* @__PURE__ */ a($, { ref: ee(V, e.id), size: "sm", variant: "ghost", "aria-label": t.dashboardMenu(_), children: /* @__PURE__ */ a("svg", { viewBox: "0 0 10 10", width: "10", height: "10", "aria-hidden": "true", fill: "none", stroke: "currentColor", strokeWidth: "1.4", strokeLinecap: "round", children: /* @__PURE__ */ a("path", { d: "M1.5 5h.01M5 5h.01M8.5 5h.01" }) }) }),
235
235
  children: [
236
- /* @__PURE__ */ a(B, { disabled: !0, children: t.dashboardPlace(v + 1, o) }),
237
- /* @__PURE__ */ a(B, { disabled: v === 0, onSelect: () => l(e.id, x, 0), children: t.dashboardMoveStart }),
238
- /* @__PURE__ */ a(B, { disabled: v === 0, onSelect: () => l(e.id, x, v - 1), children: t.dashboardMoveEarlier }),
239
- /* @__PURE__ */ a(B, { disabled: v === o - 1, onSelect: () => l(e.id, x, v + 1), children: t.dashboardMoveLater }),
240
- /* @__PURE__ */ a(B, { disabled: v === o - 1, onSelect: () => l(e.id, x, o - 1), children: t.dashboardMoveEnd }),
241
- D.length > 1 && /* @__PURE__ */ H(re, { children: [
236
+ /* @__PURE__ */ a(U, { disabled: !0, children: t.dashboardPlace(v + 1, o) }),
237
+ /* @__PURE__ */ a(U, { disabled: v === 0, onSelect: () => l(e.id, _, 0), children: t.dashboardMoveStart }),
238
+ /* @__PURE__ */ a(U, { disabled: v === 0, onSelect: () => l(e.id, _, v - 1), children: t.dashboardMoveEarlier }),
239
+ /* @__PURE__ */ a(U, { disabled: v === o - 1, onSelect: () => l(e.id, _, v + 1), children: t.dashboardMoveLater }),
240
+ /* @__PURE__ */ a(U, { disabled: v === o - 1, onSelect: () => l(e.id, _, o - 1), children: t.dashboardMoveEnd }),
241
+ I.length > 1 && /* @__PURE__ */ E(re, { children: [
242
242
  /* @__PURE__ */ a(se, {}),
243
- D.map(([j, J]) => /* @__PURE__ */ a(
244
- B,
243
+ I.map(([H, J]) => /* @__PURE__ */ a(
244
+ U,
245
245
  {
246
- "aria-current": j === e.size || void 0,
246
+ "aria-current": H === e.size || void 0,
247
247
  onSelect: () => {
248
- n.step(Te(e.id, j)), $(t.dashboardResized(x, t.dashboardSizes[j]));
248
+ n.step(De(e.id, H)), A(t.dashboardResized(_, t.dashboardSizes[H]));
249
249
  },
250
- children: t.dashboardSizeEntry(t.dashboardSizes[j], it(J), j === e.size)
250
+ children: t.dashboardSizeEntry(t.dashboardSizes[H], it(J), H === e.size)
251
251
  },
252
- j
252
+ H
253
253
  ))
254
254
  ] }),
255
- u.form && /* @__PURE__ */ H(re, { children: [
255
+ u.form && /* @__PURE__ */ E(re, { children: [
256
256
  /* @__PURE__ */ a(se, {}),
257
257
  /* @__PURE__ */ a(
258
- B,
258
+ U,
259
259
  {
260
260
  onSelect: () => {
261
- f.current = U.get(e.id) ?? null, b(e.id);
261
+ f.current = V.get(e.id) ?? null, b(e.id);
262
262
  },
263
263
  children: t.dashboardOptions
264
264
  }
@@ -266,11 +266,11 @@ function gt({ view: s, editor: n, className: d, children: c, catalogue: C, ...y
266
266
  ] }),
267
267
  /* @__PURE__ */ a(se, {}),
268
268
  /* @__PURE__ */ a(
269
- B,
269
+ U,
270
270
  {
271
271
  tone: "danger",
272
272
  onSelect: () => {
273
- N.current = (p[S + 1] ?? p[S - 1])?.widget.id ?? null, n.step(De(e.id)), $(t.dashboardRemoved(x));
273
+ N.current = (p[S + 1] ?? p[S - 1])?.widget.id ?? null, n.step(Ie(e.id)), A(t.dashboardRemoved(_));
274
274
  },
275
275
  children: t.dashboardRemove
276
276
  }
@@ -279,90 +279,90 @@ function gt({ view: s, editor: n, className: d, children: c, catalogue: C, ...y
279
279
  }
280
280
  );
281
281
  };
282
- return /* @__PURE__ */ H("div", { role: "group", className: Q(_.root, d), "data-editing": r || void 0, ...y, children: [
283
- n.allowed && /* @__PURE__ */ a("div", { className: _.bar, children: r ? /* @__PURE__ */ H(re, { children: [
284
- /* @__PURE__ */ a("span", { className: _.mode, children: t.dashboardEditing }),
285
- /* @__PURE__ */ a(L, { size: "sm", disabled: !n.canUndo, onClick: n.undo, children: t.dashboardUndo }),
286
- /* @__PURE__ */ a(L, { size: "sm", disabled: !n.canRedo, onClick: n.redo, children: t.dashboardRedo }),
287
- /* @__PURE__ */ a(L, { size: "sm", disabled: !n.canReset, onClick: n.reset, children: t.dashboardReset }),
288
- /* @__PURE__ */ a(L, { ref: A, size: "sm", onClick: () => n.setCatalogue(!0), children: t.dashboardAddWidget }),
289
- /* @__PURE__ */ a(L, { size: "sm", onClick: n.cancel, children: t.dashboardCancel }),
290
- /* @__PURE__ */ a(L, { size: "sm", variant: "primary", onClick: n.done, children: t.dashboardDone })
291
- ] }) : /* @__PURE__ */ a(L, { size: "sm", onClick: n.edit, children: t.dashboardEdit }) }),
282
+ return /* @__PURE__ */ E("div", { role: "group", className: Q(y.root, d), "data-editing": r || void 0, ...x, children: [
283
+ n.allowed && /* @__PURE__ */ a("div", { className: y.bar, children: r ? /* @__PURE__ */ E(re, { children: [
284
+ /* @__PURE__ */ a("span", { className: y.mode, children: t.dashboardEditing }),
285
+ /* @__PURE__ */ a($, { size: "sm", disabled: !n.canUndo, onClick: n.undo, children: t.dashboardUndo }),
286
+ /* @__PURE__ */ a($, { size: "sm", disabled: !n.canRedo, onClick: n.redo, children: t.dashboardRedo }),
287
+ /* @__PURE__ */ a($, { size: "sm", disabled: !n.canReset, onClick: n.reset, children: t.dashboardReset }),
288
+ /* @__PURE__ */ a($, { ref: F, size: "sm", onClick: () => n.setCatalogue(!0), children: t.dashboardAddWidget }),
289
+ /* @__PURE__ */ a($, { size: "sm", onClick: n.cancel, children: t.dashboardCancel }),
290
+ /* @__PURE__ */ a($, { size: "sm", variant: "primary", onClick: n.done, children: t.dashboardDone })
291
+ ] }) : /* @__PURE__ */ a($, { size: "sm", onClick: n.edit, children: t.dashboardEdit }) }),
292
292
  r && o === 0 && /* @__PURE__ */ a(K, { children: t.dashboardEmptyEditing }),
293
293
  !r && o === 0 && /* @__PURE__ */ a(K, { children: t.dashboardEmpty }),
294
- /* @__PURE__ */ H("div", { className: _.grid, ref: T, children: [
295
- p.map(({ widget: e, type: u }, x) => {
296
- const S = he(I[x], R.indexOf(x)), v = q(u, e.options), D = m.widgets.findIndex((_e) => _e.id === e.id), j = we(e, v, x, D), J = r && xe(e, u, v, x, D);
297
- return u === w ? /* @__PURE__ */ a("div", { ref: ee(k, e.id), className: Q(_.item, _.headingRow), style: S, "data-widget": e.id, "data-editing": r || void 0, "data-dragging": g?.id === e.id || void 0, children: /* @__PURE__ */ H("div", { ...j, className: Q(j.className, _.headingHead), children: [
298
- r && /* @__PURE__ */ a(le, { className: _.grip }),
299
- /* @__PURE__ */ a(Se, { level: 2, size: "lg", className: _.heading, children: e.options.text }),
294
+ /* @__PURE__ */ E("div", { className: y.grid, ref: D, children: [
295
+ p.map(({ widget: e, type: u }, _) => {
296
+ const S = he(L[_], T.indexOf(_)), v = q(u, e.options), I = m.widgets.findIndex((ye) => ye.id === e.id), H = we(e, v, _, I), J = r && _e(e, u, v, _, I);
297
+ return u === w ? /* @__PURE__ */ a("div", { ref: ee(k, e.id), className: Q(y.item, y.headingRow), style: S, "data-widget": e.id, "data-editing": r || void 0, "data-dragging": g?.id === e.id || void 0, children: /* @__PURE__ */ E("div", { ...H, className: Q(H.className, y.headingHead), children: [
298
+ r && /* @__PURE__ */ a(le, { className: y.grip }),
299
+ /* @__PURE__ */ a(Se, { level: 2, size: "lg", className: y.heading, children: e.options.text }),
300
300
  J
301
- ] }) }, e.id) : /* @__PURE__ */ H(Ne, { ref: ee(k, e.id), className: _.item, style: S, "data-widget": e.id, "data-editing": r || void 0, "data-dragging": g?.id === e.id || void 0, "aria-label": v, children: [
302
- /* @__PURE__ */ H("div", { ...j, children: [
303
- r && /* @__PURE__ */ a(le, { className: _.grip }),
304
- /* @__PURE__ */ a("h2", { className: _.title, children: v }),
305
- r && /* @__PURE__ */ a("span", { className: _.size, children: t.dashboardSizes[e.size] }),
301
+ ] }) }, e.id) : /* @__PURE__ */ E(Ne, { ref: ee(k, e.id), className: y.item, style: S, "data-widget": e.id, "data-editing": r || void 0, "data-dragging": g?.id === e.id || void 0, "aria-label": v, children: [
302
+ /* @__PURE__ */ E("div", { ...H, children: [
303
+ r && /* @__PURE__ */ a(le, { className: y.grip }),
304
+ /* @__PURE__ */ a("h2", { className: y.title, children: v }),
305
+ r && /* @__PURE__ */ a("span", { className: y.size, children: t.dashboardSizes[e.size] }),
306
306
  J
307
307
  ] }),
308
- /* @__PURE__ */ a("div", { className: _.body, inert: r, children: /* @__PURE__ */ a(ot, { size: e.size, options: e.options, fallback: /* @__PURE__ */ a(K, { tone: "secondary", children: t.dashboardFailed }), children: /* @__PURE__ */ a(pt, { render: u.children, size: e.size, options: e.options }) }) })
308
+ /* @__PURE__ */ a("div", { className: y.body, inert: r, children: /* @__PURE__ */ a(ot, { size: e.size, options: e.options, fallback: /* @__PURE__ */ a(K, { tone: "secondary", children: t.dashboardFailed }), children: /* @__PURE__ */ a(pt, { render: u.children, size: e.size, options: e.options }) }) })
309
309
  ] }, e.id);
310
310
  }),
311
- O >= 0 && /* @__PURE__ */ a("div", { ref: M, "aria-hidden": "true", "data-placeholder": !0, className: Q(_.item, _.placeholder), style: he(I[O], g.target) })
311
+ R >= 0 && /* @__PURE__ */ a("div", { ref: M, "aria-hidden": "true", "data-placeholder": !0, className: Q(y.item, y.placeholder), style: he(L[R], g.target) })
312
312
  ] }),
313
- /* @__PURE__ */ H(ke, { open: n.catalogue, onClose: () => n.setCatalogue(!1), children: [
314
- /* @__PURE__ */ a(je, { title: t.dashboardCatalogue, description: t.dashboardCatalogueSentence }),
315
- /* @__PURE__ */ a(He, { children: /* @__PURE__ */ a("ul", { className: _.catalogue, children: P.map((e) => {
313
+ /* @__PURE__ */ E(ke, { open: n.catalogue, onClose: () => n.setCatalogue(!1), children: [
314
+ /* @__PURE__ */ a(He, { title: t.dashboardCatalogue, description: t.dashboardCatalogueSentence }),
315
+ /* @__PURE__ */ a(Ee, { children: /* @__PURE__ */ a("ul", { className: y.catalogue, children: B.map((e) => {
316
316
  const u = e.sizes[e.start];
317
- return /* @__PURE__ */ H("li", { className: _.entry, children: [
318
- /* @__PURE__ */ a("div", { className: _.footprint, role: "img", "aria-label": t.dashboardFootprint(u.columns, u.rows), children: /* @__PURE__ */ a("span", { style: { width: `${u.columns / ue * 100}%`, height: `${Math.min(1, u.rows / 4) * 100}%` } }) }),
319
- /* @__PURE__ */ H("div", { className: _.entryText, children: [
317
+ return /* @__PURE__ */ E("li", { className: y.entry, children: [
318
+ /* @__PURE__ */ a("div", { className: y.footprint, role: "img", "aria-label": t.dashboardFootprint(u.columns, u.rows), children: /* @__PURE__ */ a("span", { style: { width: `${u.columns / ue * 100}%`, height: `${Math.min(1, u.rows / 4) * 100}%` } }) }),
319
+ /* @__PURE__ */ E("div", { className: y.entryText, children: [
320
320
  /* @__PURE__ */ a(K, { as: "strong", weight: "semibold", children: e.label }),
321
321
  /* @__PURE__ */ a(K, { as: "span", size: "sm", tone: "secondary", children: e.sentence })
322
322
  ] }),
323
- /* @__PURE__ */ a(L, { size: "sm", "aria-label": t.dashboardAddType(e.label), onClick: () => G(e), children: t.dashboardAdd })
323
+ /* @__PURE__ */ a($, { size: "sm", "aria-label": t.dashboardAddType(e.label), onClick: () => G(e), children: t.dashboardAdd })
324
324
  ] }, e.name);
325
325
  }) }) })
326
326
  ] }),
327
- X?.form && te && /* @__PURE__ */ a(Ee, { open: !0, anchorRef: f, align: "end", onOpenChange: () => b(null), role: "dialog", ariaLabel: t.dashboardOptions, children: /* @__PURE__ */ a("div", { className: _.options, children: X.form({
327
+ X?.form && te && /* @__PURE__ */ a(Oe, { open: !0, anchorRef: f, align: "end", onOpenChange: () => b(null), role: "dialog", ariaLabel: t.dashboardOptions, children: /* @__PURE__ */ a("div", { className: y.options, children: X.form({
328
328
  options: te.options,
329
329
  change: (e) => {
330
- n.step($e(te.id, e)), $(t.dashboardOptionsChanged(q(X, e)));
330
+ n.step(Ae(te.id, e)), A(t.dashboardOptionsChanged(q(X, e)));
331
331
  }
332
332
  }) }) })
333
333
  ] });
334
334
  }
335
335
  const pe = (s, n) => JSON.stringify(s) === JSON.stringify(n);
336
- function xt({ defaultView: s, initialView: n, allowEdit: d = !0, onViewChange: c, onDraftChange: C }) {
337
- const y = E(null);
338
- y.current ??= { state: { view: n ?? s, draft: null, known: 0 }, listeners: /* @__PURE__ */ new Set(), types: /* @__PURE__ */ new Map(), signature: "" };
339
- const t = y.current, w = ae(), i = E({ defaultView: s, allowEdit: d, onViewChange: c, onDraftChange: C, wording: w });
336
+ function _t({ defaultView: s, initialView: n, allowEdit: d = !0, onViewChange: c, onDraftChange: C }) {
337
+ const x = O(null);
338
+ x.current ??= { state: { view: n ?? s, draft: null, known: 0 }, listeners: /* @__PURE__ */ new Set(), types: /* @__PURE__ */ new Map(), signature: "" };
339
+ const t = x.current, w = ae(), i = O({ defaultView: s, allowEdit: d, onViewChange: c, onDraftChange: C, wording: w });
340
340
  i.current = { defaultView: s, allowEdit: d, onViewChange: c, onDraftChange: C, wording: w };
341
341
  const h = oe(() => {
342
- const U = (b) => (t.listeners.add(b), () => void t.listeners.delete(b)), A = () => t.state, r = (b) => {
342
+ const V = (b) => (t.listeners.add(b), () => void t.listeners.delete(b)), F = () => t.state, r = (b) => {
343
343
  t.state = b, t.listeners.forEach((f) => f());
344
344
  }, o = (b) => t.types.size ? ge(b, t.types) : b, l = () => {
345
345
  !i.current.allowEdit || t.state.draft || (r({ ...t.state, draft: { steps: [o(t.state.view)], at: 0 } }), i.current.onDraftChange?.(!0));
346
346
  }, g = (b) => {
347
347
  const { view: f, draft: z } = t.state;
348
348
  if (!z) return;
349
- const N = z.steps[z.at], P = b && !pe(N, o(f));
350
- r({ ...t.state, view: P ? N : f, draft: null, catalogue: !1 }), i.current.onDraftChange?.(!1);
349
+ const N = z.steps[z.at], B = b && !pe(N, o(f));
350
+ r({ ...t.state, view: B ? N : f, draft: null, catalogue: !1 }), i.current.onDraftChange?.(!1);
351
351
  const { wording: G } = i.current;
352
- $(b ? P ? G.dashboardKept : G.dashboardLeft : G.dashboardCancelled), P && i.current.onViewChange?.(N);
352
+ A(b ? B ? G.dashboardKept : G.dashboardLeft : G.dashboardCancelled), B && i.current.onViewChange?.(N);
353
353
  }, M = (b) => {
354
354
  t.state.draft && r({ ...t.state, catalogue: b });
355
- }, F = (b) => {
355
+ }, P = (b) => {
356
356
  const { draft: f } = t.state;
357
357
  if (!f) return;
358
358
  const z = f.steps[f.at], N = b(z);
359
359
  N !== z && r({ ...t.state, draft: { steps: [...f.steps.slice(0, f.at + 1), N], at: f.at + 1 } });
360
- }, O = (b, f) => {
360
+ }, R = (b, f) => {
361
361
  const { draft: z } = t.state;
362
- z?.steps[z.at + b] && (r({ ...t.state, draft: { ...z, at: z.at + b } }), $(f));
363
- }, R = () => O(-1, i.current.wording.dashboardUndone), Y = () => O(1, i.current.wording.dashboardRedone), I = () => {
364
- t.state.draft && (F(() => o(i.current.defaultView)), $(i.current.wording.dashboardResetDone));
365
- }, V = (b, f, z) => ({
362
+ z?.steps[z.at + b] && (r({ ...t.state, draft: { ...z, at: z.at + b } }), A(f));
363
+ }, T = () => R(-1, i.current.wording.dashboardUndone), Y = () => R(1, i.current.wording.dashboardRedone), L = () => {
364
+ t.state.draft && (P(() => o(i.current.defaultView)), A(i.current.wording.dashboardResetDone));
365
+ }, j = (b, f, z) => ({
366
366
  allowed: b,
367
367
  editing: f !== null,
368
368
  edit: l,
@@ -372,26 +372,26 @@ function xt({ defaultView: s, initialView: n, allowEdit: d = !0, onViewChange: c
372
372
  setCatalogue: M,
373
373
  register: (N) => {
374
374
  t.types = N;
375
- const P = [...N].map(([G, X]) => `${G}:${X.start}:${JSON.stringify(X.sizes)}`).join("|");
376
- P !== t.signature && (t.signature = P, r({ ...t.state, known: t.state.known + 1 }));
375
+ const B = [...N].map(([G, X]) => `${G}:${X.start}:${JSON.stringify(X.sizes)}`).join("|");
376
+ B !== t.signature && (t.signature = B, r({ ...t.state, known: t.state.known + 1 }));
377
377
  },
378
- step: F,
379
- undo: R,
378
+ step: P,
379
+ undo: T,
380
380
  redo: Y,
381
- reset: I,
381
+ reset: L,
382
382
  canUndo: !!f && f.at > 0,
383
383
  canRedo: !!f && f.at < f.steps.length - 1,
384
384
  canReset: !!f && !pe(f.steps[f.at], o(i.current.defaultView))
385
385
  });
386
386
  return {
387
- get: A,
388
- subscribe: U,
387
+ get: F,
388
+ subscribe: V,
389
389
  edit: l,
390
390
  done: () => g(!0),
391
391
  cancel: () => g(!1),
392
- undo: R,
392
+ undo: T,
393
393
  redo: Y,
394
- reset: I,
394
+ reset: L,
395
395
  catalogue: () => M(!0),
396
396
  read: o,
397
397
  setView: (b) => {
@@ -399,11 +399,11 @@ function xt({ defaultView: s, initialView: n, allowEdit: d = !0, onViewChange: c
399
399
  r({ ...t.state, view: f, draft: t.state.draft ? { steps: [f], at: 0 } : null });
400
400
  },
401
401
  Dashboard: (b) => {
402
- const { view: f, draft: z, catalogue: N } = ce(U, A, A);
403
- return Me(gt, { ...b, view: z ? z.steps[z.at] : f, editor: V(i.current.allowEdit, z, !!N) });
402
+ const { view: f, draft: z, catalogue: N } = ce(V, F, F);
403
+ return Me(gt, { ...b, view: z ? z.steps[z.at] : f, editor: j(i.current.allowEdit, z, !!N) });
404
404
  }
405
405
  };
406
- }, [t]), { view: m, draft: p, known: T } = ce(h.subscribe, h.get, h.get), k = p ? p.steps[p.at] : m, W = oe(() => h.read(k), [h, k, T]);
406
+ }, [t]), { view: m, draft: p, known: D } = ce(h.subscribe, h.get, h.get), k = p ? p.steps[p.at] : m, W = oe(() => h.read(k), [h, k, D]);
407
407
  return {
408
408
  Dashboard: h.Dashboard,
409
409
  WidgetType: be,
@@ -422,5 +422,5 @@ function xt({ defaultView: s, initialView: n, allowEdit: d = !0, onViewChange: c
422
422
  export {
423
423
  lt as HeadingType,
424
424
  be as WidgetType,
425
- xt as useDashboard
425
+ _t as useDashboard
426
426
  };
package/docs/llms-full.md CHANGED
@@ -1,4 +1,4 @@
1
- # @umriss-ui/dashboard 0.40.2
1
+ # @umriss-ui/dashboard 0.40.4
2
2
 
3
3
  > React dashboard for data-dense applications - widgets a reader arranges, packed in order on twelve columns.
4
4
 
@@ -49,9 +49,10 @@ function Dot({ verdict }: { verdict: Verdict }) {
49
49
  function Kz({ value, unit, verdict, note }: { value: string; unit?: string; verdict: Verdict; note: string }) {
50
50
  return (
51
51
  <div style={{ display: "flex", flexDirection: "column", justifyContent: "center", gap: "var(--u-space-1)", height: "100%", minWidth: 0 }}>
52
- <Text as="div" size="2xl" weight="semibold" leading="tight" style={{ fontVariantNumeric: "tabular-nums", whiteSpace: "nowrap" }}>
52
+ <Text as="div" size="2xl" weight="semibold" leading="tight" style={{ fontVariantNumeric: "tabular-nums" }}>
53
53
  {value}
54
- {unit && <Text as="span" size="sm" tone="muted" style={{ marginInlineStart: "var(--u-space-1)", fontWeight: "var(--u-weight-regular)" }}>{unit}</Text>}
54
+ {/* The unit keeps its words together and goes under the value where the tile is too narrow for both. */}
55
+ {unit && <Text as="span" size="sm" tone="muted" style={{ marginInlineStart: "var(--u-space-1)", fontWeight: "var(--u-weight-regular)", whiteSpace: "nowrap" }}>{unit}</Text>}
55
56
  </Text>
56
57
  <Text as="div" size="xs" tone="secondary" style={{ display: "flex", alignItems: "center", gap: 6, whiteSpace: "nowrap" }}>
57
58
  <Dot verdict={verdict} />
@@ -442,9 +443,10 @@ function Dot({ verdict }: { verdict: Verdict }) {
442
443
  function Kz({ value, unit, verdict, note }: { value: string; unit?: string; verdict: Verdict; note: string }) {
443
444
  return (
444
445
  <div style={{ display: "flex", flexDirection: "column", justifyContent: "center", gap: "var(--u-space-1)", height: "100%", minWidth: 0 }}>
445
- <Text as="div" size="2xl" weight="semibold" leading="tight" style={{ fontVariantNumeric: "tabular-nums", whiteSpace: "nowrap" }}>
446
+ <Text as="div" size="2xl" weight="semibold" leading="tight" style={{ fontVariantNumeric: "tabular-nums" }}>
446
447
  {value}
447
- {unit && <Text as="span" size="sm" tone="muted" style={{ marginInlineStart: "var(--u-space-1)", fontWeight: "var(--u-weight-regular)" }}>{unit}</Text>}
448
+ {/* The unit keeps its words together and goes under the value where the tile is too narrow for both. */}
449
+ {unit && <Text as="span" size="sm" tone="muted" style={{ marginInlineStart: "var(--u-space-1)", fontWeight: "var(--u-weight-regular)", whiteSpace: "nowrap" }}>{unit}</Text>}
448
450
  </Text>
449
451
  <Text as="div" size="xs" tone="secondary" style={{ display: "flex", alignItems: "center", gap: 6, whiteSpace: "nowrap" }}>
450
452
  <Dot verdict={verdict} />
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umriss-ui/dashboard",
3
- "version": "0.40.2",
3
+ "version": "0.40.4",
4
4
  "description": "React dashboard for data-dense applications - widgets a reader arranges, packed in order on twelve columns.",
5
5
  "license": "MIT",
6
6
  "author": "Roman Händler",
@@ -45,7 +45,7 @@
45
45
  "peerDependencies": {
46
46
  "react": ">=19",
47
47
  "react-dom": ">=19",
48
- "@umriss-ui/core": "^0.40.2"
48
+ "@umriss-ui/core": "^0.40.4"
49
49
  },
50
50
  "devDependencies": {
51
51
  "@fontsource/geist-mono": "^5.3.0",
@@ -59,7 +59,7 @@
59
59
  "typescript": "^5.6.3",
60
60
  "vite": "^6.0.0",
61
61
  "vite-plugin-dts": "^4.3.0",
62
- "@umriss-ui/core": "0.40.2",
62
+ "@umriss-ui/core": "0.40.4",
63
63
  "@umriss-ui/demo": "0.0.0"
64
64
  },
65
65
  "scripts": {