@umriss-ui/dashboard 0.53.0 → 0.54.0

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
@@ -13,6 +13,12 @@ one section before an upgrade reads that one.
13
13
 
14
14
  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.
15
15
 
16
+ ## 0.54.0 – A saved size is read only if its type offers it (Nov. 2026)
17
+
18
+ ### Fixed
19
+
20
+ - **A saved dashboard** no longer reads a widget size such as `constructor` or `toString` as a size; the widget takes its type's start size.
21
+
16
22
  ## 0.53.0 – Released in step with core (Nov. 2026)
17
23
 
18
24
  No change of its own; the number moves with core, which removes a field's deprecated `onChange(value)` (ADR-0081).
package/dist/dashboard.js CHANGED
@@ -3,16 +3,16 @@ import "./dashboard.css";
3
3
  import { Component as Te, useState as Q, useRef as R, useLayoutEffect as ye, useMemo as fe, Children as Ie, isValidElement as _e, useEffect as Z, useId as Ae, Suspense as $e, useSyncExternalStore as ze, createElement as Pe } from "react";
4
4
  import { useWording as pe, FormField as Fe, Input as Be, Button as F, Text as ne, GripGlyph as xe, Heading as je, Card as Ue, Skeleton as Ve, Drawer as We, ModalHeader as Ge, ModalBody as Ye, Popover as Ke, announce as P, Menu as Xe, MenuItem as B, MenuSeparator as oe } from "@umriss-ui/core";
5
5
  import { jsx as o, jsxs as D, Fragment as ae } from "react/jsx-runtime";
6
- const Oe = (n, t) => n.widgets.some((r) => r.id === t && r.locked !== !0), Je = (n, t) => (r) => {
6
+ const He = (n, t) => n.widgets.some((r) => r.id === t && r.locked !== !0), Je = (n, t) => (r) => {
7
7
  const i = r.widgets.findIndex((a) => a.id === n), M = Math.max(0, Math.min(r.widgets.length - 1, t));
8
8
  if (i < 0 || i === M) return r;
9
9
  const b = [...r.widgets];
10
10
  return b.splice(M, 0, ...b.splice(i, 1)), { ...r, widgets: b };
11
- }, qe = (n, t) => (r) => r.widgets.some((i) => i.id === n && i.locked !== !0 && i.size !== t) ? { ...r, widgets: r.widgets.map((i) => i.id === n ? { ...i, size: t } : i) } : r, Qe = (n) => (t) => Oe(t, n) ? { ...t, widgets: t.widgets.filter((r) => r.id !== n) } : t, Ze = (n, t) => {
11
+ }, qe = (n, t) => (r) => r.widgets.some((i) => i.id === n && i.locked !== !0 && i.size !== t) ? { ...r, widgets: r.widgets.map((i) => i.id === n ? { ...i, size: t } : i) } : r, Qe = (n) => (t) => He(t, n) ? { ...t, widgets: t.widgets.filter((r) => r.id !== n) } : t, Ze = (n, t) => {
12
12
  let r = 1;
13
13
  for (; n.widgets.some((i) => i.id === `${t}-${r}`); ) r++;
14
14
  return `${t}-${r}`;
15
- }, et = (n) => (t) => ({ ...t, widgets: [...t.widgets, n] }), tt = (n, t) => (r) => Oe(r, n) ? { ...r, widgets: r.widgets.map((i) => i.id === n ? { ...i, options: t } : i) } : r, nt = "_root_1pgwl_17", st = "_bar_1pgwl_36", rt = "_mode_1pgwl_46", ot = "_head_1pgwl_61", at = "_editingHead_1pgwl_80", it = "_grip_1pgwl_88", dt = "_title_1pgwl_93", ct = "_size_1pgwl_120", lt = "_item_1pgwl_128", ut = "_placeholder_1pgwl_138", ht = "_grid_1pgwl_144", ft = "_headingRow_1pgwl_161", pt = "_headingHead_1pgwl_76", gt = "_heading_1pgwl_76", mt = "_body_1pgwl_191", bt = "_options_1pgwl_219", wt = "_catalogue_1pgwl_224", yt = "_entry_1pgwl_232", _t = "_footprint_1pgwl_239", zt = "_entryText_1pgwl_251", x = {
15
+ }, et = (n) => (t) => ({ ...t, widgets: [...t.widgets, n] }), tt = (n, t) => (r) => He(r, n) ? { ...r, widgets: r.widgets.map((i) => i.id === n ? { ...i, options: t } : i) } : r, nt = "_root_1pgwl_17", st = "_bar_1pgwl_36", rt = "_mode_1pgwl_46", ot = "_head_1pgwl_61", at = "_editingHead_1pgwl_80", it = "_grip_1pgwl_88", dt = "_title_1pgwl_93", ct = "_size_1pgwl_120", lt = "_item_1pgwl_128", ut = "_placeholder_1pgwl_138", ht = "_grid_1pgwl_144", ft = "_headingRow_1pgwl_161", pt = "_headingHead_1pgwl_76", gt = "_heading_1pgwl_76", mt = "_body_1pgwl_191", bt = "_options_1pgwl_219", wt = "_catalogue_1pgwl_224", yt = "_entry_1pgwl_232", _t = "_footprint_1pgwl_239", zt = "_entryText_1pgwl_251", x = {
16
16
  root: nt,
17
17
  bar: st,
18
18
  mode: rt,
@@ -56,7 +56,7 @@ function ve(n, t) {
56
56
  ...n,
57
57
  widgets: me(n).flatMap((i) => {
58
58
  const M = t.get(i.type);
59
- return !M || r.has(i.id) ? [] : (r.add(i.id), [{ ...i, size: M.sizes[i.size] ? i.size : M.start, options: St(i.options, M.defaultOptions) }]);
59
+ return !M || r.has(i.id) ? [] : (r.add(i.id), [{ ...i, size: Object.hasOwn(M.sizes, i.size) ? i.size : M.start, options: St(i.options, M.defaultOptions) }]);
60
60
  })
61
61
  };
62
62
  }
@@ -87,7 +87,7 @@ function Ct(n, t, r, i, M, { cell: b, unit: a, gap: s }) {
87
87
  }
88
88
  return d;
89
89
  }
90
- function Ht(n, t, r, i) {
90
+ function Ot(n, t, r, i) {
91
91
  const M = de(n, t)[r];
92
92
  let b = r, a = 1 / 0, s = 1 / 0;
93
93
  for (let d = 0; d < n.length; d++) {
@@ -101,7 +101,7 @@ function Ht(n, t, r, i) {
101
101
  }
102
102
  return b;
103
103
  }
104
- const Ot = { 3: "¼", 4: "⅓", 6: "½", 8: "⅔", 9: "¾" }, vt = ({ columns: n }) => n >= 12 ? "" : Ot[n] ?? `${n}/12`;
104
+ const Ht = { 3: "¼", 4: "⅓", 6: "½", 8: "⅔", 9: "¾" }, vt = ({ columns: n }) => n >= 12 ? "" : Ht[n] ?? `${n}/12`;
105
105
  function Nt({ grid: n, cards: t, shown: r, drop: i, cancelled: M }) {
106
106
  const [b, a] = Q(null), s = R(null), d = R({}), c = R(/* @__PURE__ */ new Map()), w = R(null), h = R({ update: () => {
107
107
  }, finish: () => {
@@ -225,8 +225,8 @@ function At({ view: n, editor: t, className: r, children: i, catalogue: M, headi
225
225
  const f = c.get(e.type), y = f?.sizes[e.size];
226
226
  return f && y ? [{ widget: e, type: f, span: y }] : [];
227
227
  }), ee = `h${Math.min(6, b + (_.some(({ type: e }) => e === d) ? 1 : 0))}`, K = R(null), [A] = Q(() => /* @__PURE__ */ new Map()), [l] = Q(() => /* @__PURE__ */ new Map()), [u] = Q(() => /* @__PURE__ */ new Map()), g = R(null), k = R(null), { editing: p } = t, C = h.widgets.length, U = _.map(({ widget: e, type: f }) => q(f, e.options)), V = Ae(), W = (e, f) => U.filter((y) => y === e).length > 1 ? s.dashboardHead(e, f + 1, C) : e, L = (e, f, y) => {
228
- const N = h.widgets.findIndex((O) => O.id === e), H = Math.max(0, Math.min(C - 1, y));
229
- N !== H && (t.step(Je(e, H)), P(s.dashboardMoved(f, N + 1, H + 1, C)));
228
+ const N = h.widgets.findIndex((H) => H.id === e), O = Math.max(0, Math.min(C - 1, y));
229
+ N !== O && (t.step(Je(e, O)), P(s.dashboardMoved(f, N + 1, O + 1, C)));
230
230
  }, { drag: T, placeholder: z, handlers: m } = Nt({
231
231
  grid: K,
232
232
  cards: A,
@@ -254,37 +254,37 @@ function At({ view: n, editor: t, className: r, children: i, catalogue: M, headi
254
254
  const Ee = [...c.values()].filter((e) => !M || M.includes(e.name)), Re = (e) => {
255
255
  const f = { id: Ze(h, e.name), type: e.name, size: e.start, options: e.defaultOptions };
256
256
  re.current = f.id, t.step(et(f)), P(s.dashboardAdded(q(e, f.options), C + 1, C + 1));
257
- }, ce = I ? c.get(h.widgets.find((e) => e.id === I)?.type ?? "") : void 0, le = h.widgets.find((e) => e.id === I), De = (e, f, y, N, H) => p ? {
257
+ }, ce = I ? c.get(h.widgets.find((e) => e.id === I)?.type ?? "") : void 0, le = h.widgets.find((e) => e.id === I), De = (e, f, y, N, O) => p ? {
258
258
  ref: ie(l, e.id),
259
259
  className: se(x.head, x.editingHead),
260
260
  ...m(e.id, y),
261
261
  role: "group",
262
262
  tabIndex: 0,
263
- "aria-label": (H ? s.dashboardHeadLocked : s.dashboardHead)(f, N + 1, C),
263
+ "aria-label": (O ? s.dashboardHeadLocked : s.dashboardHead)(f, N + 1, C),
264
264
  "aria-describedby": V,
265
- onKeyDown: (O) => {
266
- if (O.target !== O.currentTarget) return;
267
- const $ = { ArrowUp: -1, ArrowDown: 1 }[O.key], E = $ ? h.widgets.findIndex((Y) => Y.id === _[Ht(_.map((ue) => ue.span), he, y, $)]?.widget.id) : { ArrowLeft: N - 1, ArrowRight: N + 1, Home: 0, End: C - 1 }[O.key];
268
- E !== void 0 && (O.preventDefault(), L(e.id, f, E));
265
+ onKeyDown: (H) => {
266
+ if (H.target !== H.currentTarget) return;
267
+ const $ = { ArrowUp: -1, ArrowDown: 1 }[H.key], E = $ ? h.widgets.findIndex((Y) => Y.id === _[Ot(_.map((ue) => ue.span), he, y, $)]?.widget.id) : { ArrowLeft: N - 1, ArrowRight: N + 1, Home: 0, End: C - 1 }[H.key];
268
+ E !== void 0 && (H.preventDefault(), L(e.id, f, E));
269
269
  }
270
- } : { className: x.head }, Le = (e, f, y, N, H, O) => {
270
+ } : { className: x.head }, Le = (e, f, y, N, O, H) => {
271
271
  const $ = Object.entries(f.sizes).sort(([, E], [, Y]) => Ce(E) - Ce(Y));
272
272
  return /* @__PURE__ */ D(
273
273
  Xe,
274
274
  {
275
275
  align: "end",
276
- trigger: /* @__PURE__ */ o(F, { ref: ie(u, e.id), size: "sm", variant: "ghost", "aria-label": s.dashboardMenu(W(y, H)), children: /* @__PURE__ */ o("svg", { viewBox: "0 0 10 10", width: "10", height: "10", "aria-hidden": "true", fill: "none", stroke: "currentColor", strokeWidth: "1.4", strokeLinecap: "round", children: /* @__PURE__ */ o("path", { d: "M1.5 5h.01M5 5h.01M8.5 5h.01" }) }) }),
276
+ trigger: /* @__PURE__ */ o(F, { ref: ie(u, e.id), size: "sm", variant: "ghost", "aria-label": s.dashboardMenu(W(y, O)), children: /* @__PURE__ */ o("svg", { viewBox: "0 0 10 10", width: "10", height: "10", "aria-hidden": "true", fill: "none", stroke: "currentColor", strokeWidth: "1.4", strokeLinecap: "round", children: /* @__PURE__ */ o("path", { d: "M1.5 5h.01M5 5h.01M8.5 5h.01" }) }) }),
277
277
  children: [
278
- /* @__PURE__ */ o(B, { disabled: !0, children: s.dashboardPlace(H + 1, C) }),
279
- /* @__PURE__ */ o(B, { disabled: H === 0, onSelect: () => L(e.id, y, 0), children: s.dashboardMoveStart }),
280
- /* @__PURE__ */ o(B, { disabled: H === 0, onSelect: () => L(e.id, y, H - 1), children: s.dashboardMoveEarlier }),
281
- /* @__PURE__ */ o(B, { disabled: H === C - 1, onSelect: () => L(e.id, y, H + 1), children: s.dashboardMoveLater }),
282
- /* @__PURE__ */ o(B, { disabled: H === C - 1, onSelect: () => L(e.id, y, C - 1), children: s.dashboardMoveEnd }),
283
- O && /* @__PURE__ */ D(ae, { children: [
278
+ /* @__PURE__ */ o(B, { disabled: !0, children: s.dashboardPlace(O + 1, C) }),
279
+ /* @__PURE__ */ o(B, { disabled: O === 0, onSelect: () => L(e.id, y, 0), children: s.dashboardMoveStart }),
280
+ /* @__PURE__ */ o(B, { disabled: O === 0, onSelect: () => L(e.id, y, O - 1), children: s.dashboardMoveEarlier }),
281
+ /* @__PURE__ */ o(B, { disabled: O === C - 1, onSelect: () => L(e.id, y, O + 1), children: s.dashboardMoveLater }),
282
+ /* @__PURE__ */ o(B, { disabled: O === C - 1, onSelect: () => L(e.id, y, C - 1), children: s.dashboardMoveEnd }),
283
+ H && /* @__PURE__ */ D(ae, { children: [
284
284
  /* @__PURE__ */ o(oe, {}),
285
285
  /* @__PURE__ */ o(B, { disabled: !0, children: s.dashboardLockedLine })
286
286
  ] }),
287
- !O && $.length > 1 && /* @__PURE__ */ D(ae, { children: [
287
+ !H && $.length > 1 && /* @__PURE__ */ D(ae, { children: [
288
288
  /* @__PURE__ */ o(oe, {}),
289
289
  $.map(([E, Y]) => /* @__PURE__ */ D(
290
290
  B,
@@ -302,7 +302,7 @@ function At({ view: n, editor: t, className: r, children: i, catalogue: M, headi
302
302
  E
303
303
  ))
304
304
  ] }),
305
- !O && f.form && /* @__PURE__ */ D(ae, { children: [
305
+ !H && f.form && /* @__PURE__ */ D(ae, { children: [
306
306
  /* @__PURE__ */ o(oe, {}),
307
307
  /* @__PURE__ */ o(
308
308
  B,
@@ -314,8 +314,8 @@ function At({ view: n, editor: t, className: r, children: i, catalogue: M, headi
314
314
  }
315
315
  )
316
316
  ] }),
317
- !O && /* @__PURE__ */ o(oe, {}),
318
- !O && /* @__PURE__ */ o(
317
+ !H && /* @__PURE__ */ o(oe, {}),
318
+ !H && /* @__PURE__ */ o(
319
319
  B,
320
320
  {
321
321
  tone: "danger",
@@ -362,21 +362,21 @@ function At({ view: n, editor: t, className: r, children: i, catalogue: M, headi
362
362
  !p && C === 0 && /* @__PURE__ */ o(ne, { children: s.dashboardEmpty }),
363
363
  /* @__PURE__ */ D("div", { className: x.grid, ref: K, children: [
364
364
  _.map(({ widget: e, type: f }, y) => {
365
- const N = Se(X[y], v.indexOf(y)), H = q(f, e.options), O = h.widgets.findIndex((ue) => ue.id === e.id), $ = e.locked === !0, E = De(e, H, y, O, $), Y = p && Le(e, f, H, y, O, $);
365
+ const N = Se(X[y], v.indexOf(y)), O = q(f, e.options), H = h.widgets.findIndex((ue) => ue.id === e.id), $ = e.locked === !0, E = De(e, O, y, H, $), Y = p && Le(e, f, O, y, H, $);
366
366
  return f === d ? /* @__PURE__ */ o("div", { ref: ie(A, e.id), className: se(x.item, x.headingRow), style: N, "data-widget": e.id, "data-editing": p || void 0, "data-dragging": T?.id === e.id || void 0, children: /* @__PURE__ */ D("div", { ...E, className: se(E.className, x.headingHead), children: [
367
367
  p && /* @__PURE__ */ o(xe, { className: x.grip }),
368
368
  /* @__PURE__ */ o(je, { level: b, size: "lg", className: x.heading, children: e.options.text }),
369
369
  p && $ && /* @__PURE__ */ o("span", { className: x.size, children: s.dashboardLocked }),
370
370
  Y
371
- ] }) }, e.id) : /* @__PURE__ */ D(Ue, { ref: ie(A, e.id), className: x.item, style: N, "data-widget": e.id, "data-editing": p || void 0, "data-dragging": T?.id === e.id || void 0, "aria-label": W(H, O), children: [
371
+ ] }) }, e.id) : /* @__PURE__ */ D(Ue, { ref: ie(A, e.id), className: x.item, style: N, "data-widget": e.id, "data-editing": p || void 0, "data-dragging": T?.id === e.id || void 0, "aria-label": W(O, H), children: [
372
372
  /* @__PURE__ */ D("div", { ...E, children: [
373
373
  p && /* @__PURE__ */ o(xe, { className: x.grip }),
374
- /* @__PURE__ */ o(ee, { className: x.title, children: H }),
374
+ /* @__PURE__ */ o(ee, { className: x.title, children: O }),
375
375
  p && /* @__PURE__ */ o("span", { className: x.size, children: s.dashboardSizes[e.size] }),
376
376
  p && $ && /* @__PURE__ */ o("span", { className: x.size, children: s.dashboardLocked }),
377
377
  Y
378
378
  ] }),
379
- /* @__PURE__ */ o(It, { title: W(H, O), editing: p, children: /* @__PURE__ */ o(xt, { size: e.size, options: e.options, fallback: /* @__PURE__ */ o(ne, { tone: "secondary", children: s.dashboardFailed }), children: /* @__PURE__ */ o($e, { fallback: /* @__PURE__ */ o(Ve, { width: "100%", height: "100%" }), children: /* @__PURE__ */ o(Tt, { render: f.children, size: e.size, options: e.options }) }) }) })
379
+ /* @__PURE__ */ o(It, { title: W(O, H), editing: p, children: /* @__PURE__ */ o(xt, { size: e.size, options: e.options, fallback: /* @__PURE__ */ o(ne, { tone: "secondary", children: s.dashboardFailed }), children: /* @__PURE__ */ o($e, { fallback: /* @__PURE__ */ o(Ve, { width: "100%", height: "100%" }), children: /* @__PURE__ */ o(Tt, { render: f.children, size: e.size, options: e.options }) }) }) })
380
380
  ] }, e.id);
381
381
  }),
382
382
  S >= 0 && /* @__PURE__ */ o("div", { ref: z, "aria-hidden": "true", "data-placeholder": !0, className: se(x.item, x.placeholder), style: Se(X[S], T.target) })
@@ -405,7 +405,7 @@ function At({ view: n, editor: t, className: r, children: i, catalogue: M, headi
405
405
  }
406
406
  );
407
407
  }
408
- const He = (n, t) => JSON.stringify(n) === JSON.stringify(t);
408
+ const Oe = (n, t) => JSON.stringify(n) === JSON.stringify(t);
409
409
  function Bt({ defaultView: n, initialView: t, allowEdit: r = !0, onViewChange: i, onDraftChange: M }) {
410
410
  const b = R(null);
411
411
  b.current ??= { state: { view: Me(t) ? t : n, draft: null, known: 0 }, listeners: /* @__PURE__ */ new Set(), types: /* @__PURE__ */ new Map(), signature: "" };
@@ -419,7 +419,7 @@ function Bt({ defaultView: n, initialView: t, allowEdit: r = !0, onViewChange: i
419
419
  }, k = (z) => {
420
420
  const { view: m, draft: S } = a.state;
421
421
  if (!S) return;
422
- const v = S.steps[S.at], G = z && !He(v, u(m)), X = { ...v, widgets: [...v.widgets, ...kt(m, S.steps[0])] };
422
+ const v = S.steps[S.at], G = z && !Oe(v, u(m)), X = { ...v, widgets: [...v.widgets, ...kt(m, S.steps[0])] };
423
423
  l({ ...a.state, view: G ? X : m, draft: null, catalogue: !1 }), d.current.onDraftChange?.(!1);
424
424
  const { wording: I } = d.current;
425
425
  P(z ? G ? I.dashboardKept : I.dashboardLeft : I.dashboardCancelled), G && d.current.onViewChange?.(X);
@@ -454,7 +454,7 @@ function Bt({ defaultView: n, initialView: t, allowEdit: r = !0, onViewChange: i
454
454
  reset: L,
455
455
  canUndo: !!m && m.at > 0,
456
456
  canRedo: !!m && m.at < m.steps.length - 1,
457
- canReset: !!m && !He(m.steps[m.at], u(d.current.defaultView))
457
+ canReset: !!m && !Oe(m.steps[m.at], u(d.current.defaultView))
458
458
  });
459
459
  return {
460
460
  get: A,
package/docs/llms-full.md CHANGED
@@ -1,4 +1,4 @@
1
- # @umriss-ui/dashboard 0.53.0
1
+ # @umriss-ui/dashboard 0.54.0
2
2
 
3
3
  > React dashboard for data-dense applications - widgets a reader arranges, packed in order on twelve columns.
4
4
 
@@ -820,7 +820,7 @@ Declares no props of its own.
820
820
  - Never: stacks of widgets that share one place, coordinates and free placement, a layout per breakpoint, dense packing, dragging from the catalogue to a chosen place ([ADR-0064](https://github.com/romanhaendler/umriss-ui/blob/main/docs/adr/0064-a-dashboard-a-user-arranges-is-a-sequence-on-fixed-columns.md)).
821
821
  - Where an arrangement is stored, which default a role gets, several dashboards and what stands in a widget are the application's.
822
822
 
823
- What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/dashboard-v0.53.0/docs/adr/0032-what-umriss-is-not.md).
823
+ What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/dashboard-v0.54.0/docs/adr/0032-what-umriss-is-not.md).
824
824
 
825
825
  ## API index
826
826
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umriss-ui/dashboard",
3
- "version": "0.53.0",
3
+ "version": "0.54.0",
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",
@@ -55,14 +55,14 @@
55
55
  }
56
56
  },
57
57
  "peerDependencies": {
58
- "@umriss-ui/core": "^0.53.0",
58
+ "@umriss-ui/core": "^0.54.0",
59
59
  "react": ">=19",
60
60
  "react-dom": ">=19"
61
61
  },
62
62
  "devDependencies": {
63
63
  "@fontsource/geist-mono": "^5.3.0",
64
64
  "@fontsource/geist-sans": "^5.3.0",
65
- "@umriss-ui/core": "0.53.0",
65
+ "@umriss-ui/core": "0.54.0",
66
66
  "@umriss-ui/demo": "0.0.0",
67
67
  "@types/node": "^22.20.2",
68
68
  "@types/react": "^19.0.0",