@umriss-ui/dashboard 0.57.0 → 0.58.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/API.md CHANGED
@@ -14,7 +14,7 @@ Generated by the props step (`pnpm --filter @umriss-ui/dashboard props`); do not
14
14
  ## Types
15
15
 
16
16
  - DashboardOptions — What `useDashboard` takes. [defaultView, initialView, allowEdit, onViewChange, onDraftChange]
17
- - DashboardParts — What `useDashboard` hands back. [Dashboard, WidgetType, view, setView, editing, edit, done, catalogue, cancel, undo, redo, reset]
17
+ - DashboardParts — What `useDashboard` hands back. [Dashboard, WidgetType, view, setView, editing, edit, done, openCatalogue, cancel, undo, redo, reset, catalogue]
18
18
  - DashboardProps — The props of `Dashboard`.
19
19
  - DashboardView — The arrangement of a dashboard: which widgets, in what order, at which sizes, with which options. [widgets]
20
20
  - DashboardWidget — One widget in a view. [id, type, size, options, locked]
@@ -62,11 +62,12 @@ Generated by the props step (`pnpm --filter @umriss-ui/dashboard props`); do not
62
62
  - editing: boolean — Whether the editing mode is on.
63
63
  - edit: () => void — Enters the editing mode.
64
64
  - done: () => void — Leaves the mode, keeps the changes and reports them once if there are any.
65
- - catalogue: () => void — Opens the catalogue.
65
+ - openCatalogue: () => void — Opens the catalogue.
66
66
  - cancel: () => void — Leaves the mode and puts the arrangement back as it was before `edit`.
67
67
  - undo: () => void — Goes one step back in the draft.
68
68
  - redo: () => void — Goes one step forward again.
69
69
  - reset: () => void — Steps to the `defaultView`; `undo` brings the arrangement back.
70
+ - catalogue: () => void — The old name of `openCatalogue`. (deprecated)
70
71
 
71
72
  #### props of Dashboard (DashboardProps)
72
73
 
@@ -93,3 +94,31 @@ Generated by the props step (`pnpm --filter @umriss-ui/dashboard props`); do not
93
94
 
94
95
  - options: Options — The widget's current options.
95
96
  - change: (options: Options) => void — Replaces the options; one step of the draft.
97
+
98
+ ## Types in full
99
+
100
+ ### DashboardView
101
+
102
+ - widgets: ReadonlyArray<DashboardWidget> — The widgets, in the order they are drawn and read.
103
+
104
+ ### DashboardWidget
105
+
106
+ - id: string — Unique within the view.
107
+ - type: string — The `name` of the widget type it is an instance of.
108
+ - size: WidgetSize — One of the sizes its type offers.
109
+ - options: unknown — The type's own options, typed through the hook.
110
+ - locked?: boolean — Set by the application, never by the dashboard: the reader can move the widget but not resize it, change its options or remove it.
111
+
112
+ ### HeadingOptions
113
+
114
+ - text: string — The title across the full width.
115
+
116
+ ### SizeSpan
117
+
118
+ - columns: number — Columns of twelve.
119
+ - rows: number — Rows of the fixed row unit.
120
+
121
+ ### WidgetContent
122
+
123
+ - size: WidgetSize — The size the widget stands at.
124
+ - options: Options — The widget's options.
package/CHANGELOG.md CHANGED
@@ -13,6 +13,29 @@ 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.58.1 – The editing outline keeps clear of the bar's last button (Nov. 2026)
17
+
18
+ ### Added
19
+
20
+ - **`API.md` prints every function's signature and the members of every record type with their types** (a closing section "Types in full"), so that a caller reads what a function takes and what a record's fields are without opening the source.
21
+
22
+ ### Fixed
23
+
24
+ - **The outline of the editing mode no longer covers the edge of the bar's last button.** The bar's controls stand 2 px in from the frame, at rest too.
25
+
26
+ ## 0.58.0 – The candidate for 1.0: `openCatalogue()`, the stored view is promised (Nov. 2026)
27
+
28
+ This is the last minor before `1.0.0`, and the surface is frozen with it. Every old name below works for this minor, warns once in development, and is removed in `1.0.0`; nothing else will differ between the two.
29
+
30
+ ### Added
31
+
32
+ - **`DashboardView` is the supported storage format - an addition is a minor release**, renaming or removing `widgets`, `type` or `size` a major one.
33
+
34
+ ### Changed
35
+
36
+ - **`catalogue()` in `useDashboard`'s return is `openCatalogue()`.**
37
+ - Migration: Call `openCatalogue()`; `catalogue()` works for this minor with a warning and is removed in 1.0.0. The prop `catalogue` of `Dashboard` stays.
38
+
16
39
  ## 0.57.0 – `API.md` lists the props of `Dashboard`; an example of the editing actions (Nov. 2026)
17
40
 
18
41
  ### Added
package/README.md CHANGED
@@ -108,6 +108,9 @@ const { Dashboard, WidgetType } = useDashboard({
108
108
  dashboard's boundary never sees the error, and it can reset the application's
109
109
  data layer. Without one, a widget gets another try by itself when its size or
110
110
  its options change.
111
+ - **`DashboardView` is the storage format.** What an application stores of it keeps
112
+ reading after an upgrade: an addition to it is a minor release, and renaming or
113
+ removing `widgets`, `type` or `size` is a major one.
111
114
  - **The application's, not the library's:** where an arrangement is stored,
112
115
  which default a role gets, several dashboards, sharing, and what stands in a
113
116
  widget.
@@ -1 +1 @@
1
- @layer umriss.tokens,umriss.base,umriss.components;@layer umriss.components{._root_1pgwl_17,._root_1pgwl_17:before,._root_1pgwl_17:after{box-sizing:border-box}._bar_1pgwl_36,._bar_1pgwl_36:before,._bar_1pgwl_36:after{box-sizing:border-box}._mode_1pgwl_46,._mode_1pgwl_46:before,._mode_1pgwl_46:after{box-sizing:border-box}._head_1pgwl_61,._head_1pgwl_61:before,._head_1pgwl_61:after{box-sizing:border-box}._editingHead_1pgwl_80,._editingHead_1pgwl_80:before,._editingHead_1pgwl_80:after{box-sizing:border-box}._grip_1pgwl_88,._grip_1pgwl_88:before,._grip_1pgwl_88:after{box-sizing:border-box}._title_1pgwl_93,._title_1pgwl_93:before,._title_1pgwl_93:after{box-sizing:border-box}._size_1pgwl_120,._size_1pgwl_120:before,._size_1pgwl_120:after{box-sizing:border-box}._item_1pgwl_128,._item_1pgwl_128:before,._item_1pgwl_128:after{box-sizing:border-box}._placeholder_1pgwl_138,._placeholder_1pgwl_138:before,._placeholder_1pgwl_138:after{box-sizing:border-box}._grid_1pgwl_144,._grid_1pgwl_144:before,._grid_1pgwl_144:after{box-sizing:border-box}._headingRow_1pgwl_161,._headingRow_1pgwl_161:before,._headingRow_1pgwl_161:after{box-sizing:border-box}._headingHead_1pgwl_76,._headingHead_1pgwl_76:before,._headingHead_1pgwl_76:after{box-sizing:border-box}._heading_1pgwl_76,._heading_1pgwl_76:before,._heading_1pgwl_76:after{box-sizing:border-box}._body_1pgwl_191,._body_1pgwl_191:before,._body_1pgwl_191:after{box-sizing:border-box}._options_1pgwl_219,._options_1pgwl_219:before,._options_1pgwl_219:after{box-sizing:border-box}._catalogue_1pgwl_224,._catalogue_1pgwl_224:before,._catalogue_1pgwl_224:after{box-sizing:border-box}._entry_1pgwl_232,._entry_1pgwl_232:before,._entry_1pgwl_232:after{box-sizing:border-box}._footprint_1pgwl_239,._footprint_1pgwl_239:before,._footprint_1pgwl_239:after{box-sizing:border-box}._entryText_1pgwl_251,._entryText_1pgwl_251:before,._entryText_1pgwl_251:after{box-sizing:border-box}._root_1pgwl_17{container-type:inline-size;width:100%;padding:0 0 var(--u-space-4);border-radius:var(--u-radius-lg);corner-shape:squircle;--_dashboard-row-unit: var(--u-dashboard-row, round(max(50px, 3.125rem), 1px));--_dashboard-gap: var(--u-dashboard-gap, 12px)}._root_1pgwl_17[data-editing]{outline:2px solid var(--u-color-accent);outline-offset:-2px}._bar_1pgwl_36{display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;gap:var(--u-space-2);max-width:var(--u-dashboard-max-width, 1560px);padding-block:var(--u-space-3)}._mode_1pgwl_46{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:var(--u-transform-caps)}._head_1pgwl_61{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}._head_1pgwl_61:not(._headingHead_1pgwl_76){height:max(calc(var(--u-control-height) + 2px),calc(var(--u-space-2) + var(--u-text-sm) * var(--u-leading-normal)))}._editingHead_1pgwl_80{padding-block:0;background:var(--u-color-surface-pressed);touch-action:none;user-select:none;cursor:grab}._grip_1pgwl_88{flex:none;color:var(--u-color-text-muted)}._title_1pgwl_93{flex:1 1 auto;min-width:0;margin:0;overflow:hidden;font-size:var(--u-text-sm);font-weight:var(--u-weight-medium);line-height:var(--u-leading-normal);white-space:nowrap;text-overflow:ellipsis}._head_1pgwl_61:hover ._title_1pgwl_93,._head_1pgwl_61:focus-within ._title_1pgwl_93{position:relative;z-index:1;overflow:visible;background:var(--u-color-surface);white-space:normal}._editingHead_1pgwl_80:hover ._title_1pgwl_93,._editingHead_1pgwl_80:focus-within ._title_1pgwl_93{background:var(--u-color-surface-pressed)}._size_1pgwl_120{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_1pgwl_128[data-dragging]{position:relative;z-index:5;box-shadow:var(--u-shadow-overlay)}._item_1pgwl_128[data-dragging] ._editingHead_1pgwl_80{cursor:grabbing}._placeholder_1pgwl_138{border:2px dashed var(--u-color-accent);border-radius:var(--u-radius-lg);corner-shape:squircle;background:var(--u-color-accent-subtle)}._grid_1pgwl_144{display:grid;grid-template-columns:repeat(12,minmax(0,1fr));grid-auto-rows:var(--_dashboard-row-unit);gap:var(--_dashboard-gap);max-width:var(--u-dashboard-max-width, 1560px)}._item_1pgwl_128{grid-column:var(--_dashboard-column) / span var(--_dashboard-columns);grid-row:var(--_dashboard-row) / span var(--_dashboard-rows);min-height:0;min-width:0}._headingRow_1pgwl_161{display:flex;align-items:stretch}._headingHead_1pgwl_76{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_1pgwl_161[data-editing] ._headingHead_1pgwl_76{align-items:center;padding-inline-start:var(--u-space-3);padding-block-end:0}._heading_1pgwl_76{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_1pgwl_161[data-editing] ._heading_1pgwl_76{padding-block-end:0}._body_1pgwl_191{flex:1 1 auto;min-height:0;padding:2px var(--u-space-3) 10px;overflow:auto}._body_1pgwl_191:focus-visible{outline:2px solid var(--u-color-accent);outline-offset:-2px}@container (max-width: 755px){._grid_1pgwl_144{grid-template-columns:minmax(0,1fr);grid-auto-rows:auto}._item_1pgwl_128{grid-column:1;grid-row:auto;order:var(--_dashboard-order, 0);height:calc(var(--_dashboard-rows) * var(--_dashboard-row-unit) + (var(--_dashboard-rows) - 1) * var(--_dashboard-gap))}}._options_1pgwl_219{min-width:16rem;padding:var(--u-space-3)}._catalogue_1pgwl_224{list-style:none;margin:0;padding:0;display:grid;gap:var(--u-space-3, 12px)}._entry_1pgwl_232{display:grid;grid-template-columns:4.5rem 1fr auto;align-items:center;gap:var(--u-space-3, 12px)}._footprint_1pgwl_239{aspect-ratio:3 / 1;border-radius:2px;corner-shape:squircle;box-shadow:var(--u-edge)}._footprint_1pgwl_239>span{box-sizing:border-box}._footprint_1pgwl_239>span{display:block;background:var(--u-color-accent, currentColor);opacity:.5}._entryText_1pgwl_251{display:grid}@media print{._head_1pgwl_61 button{box-sizing:border-box}._bar_1pgwl_36,._grip_1pgwl_88,._head_1pgwl_61 button{display:none}._root_1pgwl_17{color-scheme:light}._item_1pgwl_128{break-inside:avoid}}}
1
+ @layer umriss.tokens,umriss.base,umriss.components;@layer umriss.components{._root_uwiwp_17,._root_uwiwp_17:before,._root_uwiwp_17:after{box-sizing:border-box}._bar_uwiwp_36,._bar_uwiwp_36:before,._bar_uwiwp_36:after{box-sizing:border-box}._mode_uwiwp_49,._mode_uwiwp_49:before,._mode_uwiwp_49:after{box-sizing:border-box}._head_uwiwp_64,._head_uwiwp_64:before,._head_uwiwp_64:after{box-sizing:border-box}._editingHead_uwiwp_83,._editingHead_uwiwp_83:before,._editingHead_uwiwp_83:after{box-sizing:border-box}._grip_uwiwp_91,._grip_uwiwp_91:before,._grip_uwiwp_91:after{box-sizing:border-box}._title_uwiwp_96,._title_uwiwp_96:before,._title_uwiwp_96:after{box-sizing:border-box}._size_uwiwp_123,._size_uwiwp_123:before,._size_uwiwp_123:after{box-sizing:border-box}._item_uwiwp_131,._item_uwiwp_131:before,._item_uwiwp_131:after{box-sizing:border-box}._placeholder_uwiwp_141,._placeholder_uwiwp_141:before,._placeholder_uwiwp_141:after{box-sizing:border-box}._grid_uwiwp_147,._grid_uwiwp_147:before,._grid_uwiwp_147:after{box-sizing:border-box}._headingRow_uwiwp_164,._headingRow_uwiwp_164:before,._headingRow_uwiwp_164:after{box-sizing:border-box}._headingHead_uwiwp_79,._headingHead_uwiwp_79:before,._headingHead_uwiwp_79:after{box-sizing:border-box}._heading_uwiwp_79,._heading_uwiwp_79:before,._heading_uwiwp_79:after{box-sizing:border-box}._body_uwiwp_194,._body_uwiwp_194:before,._body_uwiwp_194:after{box-sizing:border-box}._options_uwiwp_222,._options_uwiwp_222:before,._options_uwiwp_222:after{box-sizing:border-box}._catalogue_uwiwp_227,._catalogue_uwiwp_227:before,._catalogue_uwiwp_227:after{box-sizing:border-box}._entry_uwiwp_235,._entry_uwiwp_235:before,._entry_uwiwp_235:after{box-sizing:border-box}._footprint_uwiwp_242,._footprint_uwiwp_242:before,._footprint_uwiwp_242:after{box-sizing:border-box}._entryText_uwiwp_254,._entryText_uwiwp_254:before,._entryText_uwiwp_254:after{box-sizing:border-box}._root_uwiwp_17{container-type:inline-size;width:100%;padding:0 0 var(--u-space-4);border-radius:var(--u-radius-lg);corner-shape:squircle;--_dashboard-row-unit: var(--u-dashboard-row, round(max(50px, 3.125rem), 1px));--_dashboard-gap: var(--u-dashboard-gap, 12px)}._root_uwiwp_17[data-editing]{outline:2px solid var(--u-color-accent);outline-offset:-2px}._bar_uwiwp_36{display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;gap:var(--u-space-2);max-width:var(--u-dashboard-max-width, 1560px);padding-block:var(--u-space-3);padding-inline:2px}._mode_uwiwp_49{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:var(--u-transform-caps)}._head_uwiwp_64{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}._head_uwiwp_64:not(._headingHead_uwiwp_79){height:max(calc(var(--u-control-height) + 2px),calc(var(--u-space-2) + var(--u-text-sm) * var(--u-leading-normal)))}._editingHead_uwiwp_83{padding-block:0;background:var(--u-color-surface-pressed);touch-action:none;user-select:none;cursor:grab}._grip_uwiwp_91{flex:none;color:var(--u-color-text-muted)}._title_uwiwp_96{flex:1 1 auto;min-width:0;margin:0;overflow:hidden;font-size:var(--u-text-sm);font-weight:var(--u-weight-medium);line-height:var(--u-leading-normal);white-space:nowrap;text-overflow:ellipsis}._head_uwiwp_64:hover ._title_uwiwp_96,._head_uwiwp_64:focus-within ._title_uwiwp_96{position:relative;z-index:1;overflow:visible;background:var(--u-color-surface);white-space:normal}._editingHead_uwiwp_83:hover ._title_uwiwp_96,._editingHead_uwiwp_83:focus-within ._title_uwiwp_96{background:var(--u-color-surface-pressed)}._size_uwiwp_123{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_uwiwp_131[data-dragging]{position:relative;z-index:5;box-shadow:var(--u-shadow-overlay)}._item_uwiwp_131[data-dragging] ._editingHead_uwiwp_83{cursor:grabbing}._placeholder_uwiwp_141{border:2px dashed var(--u-color-accent);border-radius:var(--u-radius-lg);corner-shape:squircle;background:var(--u-color-accent-subtle)}._grid_uwiwp_147{display:grid;grid-template-columns:repeat(12,minmax(0,1fr));grid-auto-rows:var(--_dashboard-row-unit);gap:var(--_dashboard-gap);max-width:var(--u-dashboard-max-width, 1560px)}._item_uwiwp_131{grid-column:var(--_dashboard-column) / span var(--_dashboard-columns);grid-row:var(--_dashboard-row) / span var(--_dashboard-rows);min-height:0;min-width:0}._headingRow_uwiwp_164{display:flex;align-items:stretch}._headingHead_uwiwp_79{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_uwiwp_164[data-editing] ._headingHead_uwiwp_79{align-items:center;padding-inline-start:var(--u-space-3);padding-block-end:0}._heading_uwiwp_79{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_uwiwp_164[data-editing] ._heading_uwiwp_79{padding-block-end:0}._body_uwiwp_194{flex:1 1 auto;min-height:0;padding:2px var(--u-space-3) 10px;overflow:auto}._body_uwiwp_194:focus-visible{outline:2px solid var(--u-color-accent);outline-offset:-2px}@container (max-width: 755px){._grid_uwiwp_147{grid-template-columns:minmax(0,1fr);grid-auto-rows:auto}._item_uwiwp_131{grid-column:1;grid-row:auto;order:var(--_dashboard-order, 0);height:calc(var(--_dashboard-rows) * var(--_dashboard-row-unit) + (var(--_dashboard-rows) - 1) * var(--_dashboard-gap))}}._options_uwiwp_222{min-width:16rem;padding:var(--u-space-3)}._catalogue_uwiwp_227{list-style:none;margin:0;padding:0;display:grid;gap:var(--u-space-3, 12px)}._entry_uwiwp_235{display:grid;grid-template-columns:4.5rem 1fr auto;align-items:center;gap:var(--u-space-3, 12px)}._footprint_uwiwp_242{aspect-ratio:3 / 1;border-radius:2px;corner-shape:squircle;box-shadow:var(--u-edge)}._footprint_uwiwp_242>span{box-sizing:border-box}._footprint_uwiwp_242>span{display:block;background:var(--u-color-accent, currentColor);opacity:.5}._entryText_uwiwp_254{display:grid}@media print{._head_uwiwp_64 button{box-sizing:border-box}._bar_uwiwp_36,._grip_uwiwp_91,._head_uwiwp_64 button{display:none}._root_uwiwp_17{color-scheme:light}._item_uwiwp_131{break-inside:avoid}}}
package/dist/dashboard.js CHANGED
@@ -1,40 +1,40 @@
1
1
  "use client";
2
2
  import "./dashboard.css";
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
- 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
- import { jsx as o, jsxs as D, Fragment as ae } from "react/jsx-runtime";
6
- const He = (n, t) => n.widgets.some((r) => r.id === t && r.locked !== !0), Je = (n, t) => (r) => {
7
- const i = r.widgets.findIndex((a) => a.id === n), M = Math.max(0, Math.min(r.widgets.length - 1, t));
8
- if (i < 0 || i === M) return r;
3
+ import { Component as Te, useState as Q, useRef as E, 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
+ import { useWording as pe, FormField as Fe, Input as je, Button as F, Text as ne, GripGlyph as xe, Heading as Be, 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 j, MenuSeparator as oe, warnOnce as Je } from "@umriss-ui/core";
5
+ import { jsx as o, jsxs as R, Fragment as ae } from "react/jsx-runtime";
6
+ const He = (n, t) => n.widgets.some((r) => r.id === t && r.locked !== !0), qe = (n, t) => (r) => {
7
+ const d = r.widgets.findIndex((a) => a.id === n), M = Math.max(0, Math.min(r.widgets.length - 1, t));
8
+ if (d < 0 || d === M) return r;
9
9
  const b = [...r.widgets];
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) => He(t, n) ? { ...t, widgets: t.widgets.filter((r) => r.id !== n) } : t, Ze = (n, t) => {
10
+ return b.splice(M, 0, ...b.splice(d, 1)), { ...r, widgets: b };
11
+ }, Qe = (n, t) => (r) => r.widgets.some((d) => d.id === n && d.locked !== !0 && d.size !== t) ? { ...r, widgets: r.widgets.map((d) => d.id === n ? { ...d, size: t } : d) } : r, Ze = (n) => (t) => He(t, n) ? { ...t, widgets: t.widgets.filter((r) => r.id !== n) } : t, et = (n, t) => {
12
12
  let r = 1;
13
- for (; n.widgets.some((i) => i.id === `${t}-${r}`); ) r++;
13
+ for (; n.widgets.some((d) => d.id === `${t}-${r}`); ) r++;
14
14
  return `${t}-${r}`;
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
- root: nt,
17
- bar: st,
18
- mode: rt,
19
- head: ot,
20
- editingHead: at,
21
- grip: it,
22
- title: dt,
23
- size: ct,
24
- item: lt,
25
- placeholder: ut,
26
- grid: ht,
27
- headingRow: ft,
28
- headingHead: pt,
29
- heading: gt,
30
- body: mt,
31
- options: bt,
32
- catalogue: wt,
33
- entry: yt,
34
- footprint: _t,
35
- entryText: zt
15
+ }, tt = (n) => (t) => ({ ...t, widgets: [...t.widgets, n] }), nt = (n, t) => (r) => He(r, n) ? { ...r, widgets: r.widgets.map((d) => d.id === n ? { ...d, options: t } : d) } : r, st = "_root_uwiwp_17", rt = "_bar_uwiwp_36", ot = "_mode_uwiwp_49", at = "_head_uwiwp_64", it = "_editingHead_uwiwp_83", dt = "_grip_uwiwp_91", ct = "_title_uwiwp_96", lt = "_size_uwiwp_123", ut = "_item_uwiwp_131", ht = "_placeholder_uwiwp_141", ft = "_grid_uwiwp_147", pt = "_headingRow_uwiwp_164", gt = "_headingHead_uwiwp_79", mt = "_heading_uwiwp_79", bt = "_body_uwiwp_194", wt = "_options_uwiwp_222", yt = "_catalogue_uwiwp_227", _t = "_entry_uwiwp_235", zt = "_footprint_uwiwp_242", xt = "_entryText_uwiwp_254", x = {
16
+ root: st,
17
+ bar: rt,
18
+ mode: ot,
19
+ head: at,
20
+ editingHead: it,
21
+ grip: dt,
22
+ title: ct,
23
+ size: lt,
24
+ item: ut,
25
+ placeholder: ht,
26
+ grid: ft,
27
+ headingRow: pt,
28
+ headingHead: gt,
29
+ heading: mt,
30
+ body: bt,
31
+ options: wt,
32
+ catalogue: yt,
33
+ entry: _t,
34
+ footprint: zt,
35
+ entryText: xt
36
36
  };
37
- class xt extends Te {
37
+ class Mt extends Te {
38
38
  state = { failed: !1 };
39
39
  static getDerivedStateFromError() {
40
40
  return { failed: !0 };
@@ -46,64 +46,64 @@ class xt extends Te {
46
46
  return this.state.failed ? this.props.fallback : this.props.children;
47
47
  }
48
48
  }
49
- const ge = (n) => typeof n == "object" && n !== null && !Array.isArray(n), Me = (n) => ge(n) && Array.isArray(n.widgets), me = (n) => n.widgets.filter((t) => ge(t) && typeof t.id == "string" && typeof t.type == "string"), Mt = (n) => ({ ...n, widgets: me(n) }), kt = (n, t) => {
50
- const r = new Set(t.widgets.map((i) => i.id));
51
- return me(n).filter((i) => !r.has(i.id));
52
- }, ke = (n) => ge(n) && [Object.prototype, null].includes(Object.getPrototypeOf(n)), St = (n, t) => ke(t) ? ke(n) ? { ...t, ...n } : t : n === void 0 ? t : n;
49
+ const ge = (n) => typeof n == "object" && n !== null && !Array.isArray(n), Me = (n) => ge(n) && Array.isArray(n.widgets), me = (n) => n.widgets.filter((t) => ge(t) && typeof t.id == "string" && typeof t.type == "string"), Ct = (n) => ({ ...n, widgets: me(n) }), kt = (n, t) => {
50
+ const r = new Set(t.widgets.map((d) => d.id));
51
+ return me(n).filter((d) => !r.has(d.id));
52
+ }, Ce = (n) => ge(n) && [Object.prototype, null].includes(Object.getPrototypeOf(n)), St = (n, t) => Ce(t) ? Ce(n) ? { ...t, ...n } : t : n === void 0 ? t : n;
53
53
  function ve(n, t) {
54
54
  const r = /* @__PURE__ */ new Set();
55
55
  return {
56
56
  ...n,
57
- widgets: me(n).flatMap((i) => {
58
- const M = t.get(i.type);
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) }]);
57
+ widgets: me(n).flatMap((d) => {
58
+ const M = t.get(d.type);
59
+ return !M || r.has(d.id) ? [] : (r.add(d.id), [{ ...d, size: Object.hasOwn(M.sizes, d.size) ? d.size : M.start, options: St(d.options, M.defaultOptions) }]);
60
60
  })
61
61
  };
62
62
  }
63
63
  function de(n, t) {
64
- const r = /* @__PURE__ */ new Set(), i = (b, a, s, d) => {
65
- for (let c = b; c < b + d; c++) for (let w = a; w < a + s; w++) if (r.has(c * t + w)) return !1;
64
+ const r = /* @__PURE__ */ new Set(), d = (b, a, s, c) => {
65
+ for (let i = b; i < b + c; i++) for (let w = a; w < a + s; w++) if (r.has(i * t + w)) return !1;
66
66
  return !0;
67
67
  };
68
68
  let M = 0;
69
69
  return n.map((b) => {
70
70
  const a = Math.min(b.columns, t);
71
71
  for (let s = M; ; s++) {
72
- const d = Math.floor(s / t), c = s % t;
73
- if (!(c + a > t || !i(d, c, a, b.rows))) {
74
- for (let w = d; w < d + b.rows; w++) for (let h = c; h < c + a; h++) r.add(w * t + h);
75
- return M = s, { column: c, row: d, columns: a, rows: b.rows };
72
+ const c = Math.floor(s / t), i = s % t;
73
+ if (!(i + a > t || !d(c, i, a, b.rows))) {
74
+ for (let w = c; w < c + b.rows; w++) for (let h = i; h < i + a; h++) r.add(w * t + h);
75
+ return M = s, { column: i, row: c, columns: a, rows: b.rows };
76
76
  }
77
77
  }
78
78
  });
79
79
  }
80
- function Ct(n, t, r, i, M, { cell: b, unit: a, gap: s }) {
81
- let d = r, c = 1 / 0;
80
+ function Ot(n, t, r, d, M, { cell: b, unit: a, gap: s }) {
81
+ let c = r, i = 1 / 0;
82
82
  for (let w = 0; w < n.length; w++) {
83
83
  const h = [...n];
84
84
  h.splice(w, 0, ...h.splice(r, 1));
85
- const _ = de(h, t)[w], j = (_.column * (b + s) - i) ** 2 + (_.row * (a + s) - M) ** 2;
86
- j < c && (c = j, d = w);
85
+ const _ = de(h, t)[w], B = (_.column * (b + s) - d) ** 2 + (_.row * (a + s) - M) ** 2;
86
+ B < i && (i = B, c = w);
87
87
  }
88
- return d;
88
+ return c;
89
89
  }
90
- function Ot(n, t, r, i) {
90
+ function Ht(n, t, r, d) {
91
91
  const M = de(n, t)[r];
92
92
  let b = r, a = 1 / 0, s = 1 / 0;
93
- for (let d = 0; d < n.length; d++) {
94
- if (d === r) continue;
95
- const c = [...n];
96
- c.splice(d, 0, ...c.splice(r, 1));
97
- const w = de(c, t)[d], h = (w.row - M.row) * i;
93
+ for (let c = 0; c < n.length; c++) {
94
+ if (c === r) continue;
95
+ const i = [...n];
96
+ i.splice(c, 0, ...i.splice(r, 1));
97
+ const w = de(i, t)[c], h = (w.row - M.row) * d;
98
98
  if (h <= 0) continue;
99
99
  const _ = Math.abs(w.column - M.column);
100
- (h < a || h === a && _ < s) && (b = d, a = h, s = _);
100
+ (h < a || h === a && _ < s) && (b = c, a = h, s = _);
101
101
  }
102
102
  return b;
103
103
  }
104
- const Ht = { 3: "¼", 4: "⅓", 6: "½", 8: "⅔", 9: "¾" }, vt = ({ columns: n }) => n >= 12 ? "" : Ht[n] ?? `${n}/12`;
105
- function Nt({ grid: n, cards: t, shown: r, drop: i, cancelled: M }) {
106
- const [b, a] = Q(null), s = R(null), d = R({}), c = R(/* @__PURE__ */ new Map()), w = R(null), h = R({ update: () => {
104
+ const vt = { 3: "¼", 4: "⅓", 6: "½", 8: "⅔", 9: "¾" }, Nt = ({ columns: n }) => n >= 12 ? "" : vt[n] ?? `${n}/12`;
105
+ function Dt({ grid: n, cards: t, shown: r, drop: d, cancelled: M }) {
106
+ const [b, a] = Q(null), s = E(null), c = E({}), i = E(/* @__PURE__ */ new Map()), w = E(null), h = E({ update: () => {
107
107
  }, finish: () => {
108
108
  } }), _ = () => {
109
109
  const l = s.current, u = l && t.get(l.id);
@@ -113,31 +113,31 @@ function Nt({ grid: n, cards: t, shown: r, drop: i, cancelled: M }) {
113
113
  };
114
114
  ye(() => {
115
115
  const l = /* @__PURE__ */ new Map(), u = window.matchMedia("(prefers-reduced-motion: reduce)").matches;
116
- for (const [g, k] of t) {
117
- const p = c.current.get(g);
118
- l.set(g, [k.offsetLeft, k.offsetTop]), b && !u && p && g !== b.id && (p[0] !== k.offsetLeft || p[1] !== k.offsetTop) && k.animate([{ transform: `translate(${p[0] - k.offsetLeft}px, ${p[1] - k.offsetTop}px)` }, { transform: "none" }], { duration: 150, easing: "ease-out" });
116
+ for (const [g, C] of t) {
117
+ const p = i.current.get(g);
118
+ l.set(g, [C.offsetLeft, C.offsetTop]), b && !u && p && g !== b.id && (p[0] !== C.offsetLeft || p[1] !== C.offsetTop) && C.animate([{ transform: `translate(${p[0] - C.offsetLeft}px, ${p[1] - C.offsetTop}px)` }, { transform: "none" }], { duration: 150, easing: "ease-out" });
119
119
  }
120
- c.current = l, b && _();
120
+ i.current = l, b && _();
121
121
  });
122
- const j = () => {
122
+ const B = () => {
123
123
  const l = s.current, u = n.current, g = l && t.get(l.id);
124
124
  if (!l || !u || !g) return;
125
- const k = getComputedStyle(u), p = parseFloat(k.columnGap), C = k.gridTemplateColumns.split(" ").length, U = u.getBoundingClientRect(), V = r[l.from].span, W = { cell: (U.width - (C - 1) * p) / C, gap: p, unit: (g.offsetHeight - (V.rows - 1) * p) / V.rows }, L = Ct(r.map((T) => T.span), C, l.from, l.x - l.dx - U.left, l.y - l.dy - U.top, W);
125
+ const C = getComputedStyle(u), p = parseFloat(C.columnGap), S = C.gridTemplateColumns.split(" ").length, U = u.getBoundingClientRect(), V = r[l.from].span, W = { cell: (U.width - (S - 1) * p) / S, gap: p, unit: (g.offsetHeight - (V.rows - 1) * p) / V.rows }, L = Ot(r.map((T) => T.span), S, l.from, l.x - l.dx - U.left, l.y - l.dy - U.top, W);
126
126
  if (L === l.target) return _();
127
127
  l.target = L, a({ id: l.id, target: L });
128
128
  }, ee = (l) => {
129
129
  const u = s.current;
130
- if (s.current = null, window.clearInterval(d.current.timer), d.current.escape && document.removeEventListener("keydown", d.current.escape), u && t.get(u.id)?.style.removeProperty("transform"), a(null), !!u?.started) {
130
+ if (s.current = null, window.clearInterval(c.current.timer), c.current.escape && document.removeEventListener("keydown", c.current.escape), u && t.get(u.id)?.style.removeProperty("transform"), a(null), !!u?.started) {
131
131
  if (!l) return M(r[u.from].title);
132
- i(u.id, r[u.target].id);
132
+ d(u.id, r[u.target].id);
133
133
  }
134
134
  };
135
135
  ye(() => {
136
- h.current = { update: j, finish: ee };
136
+ h.current = { update: B, finish: ee };
137
137
  });
138
138
  const K = (l, u) => (g) => {
139
- const k = g.target;
140
- if (g.button > 0 || k.closest("button") || !g.currentTarget.contains(k)) return;
139
+ const C = g.target;
140
+ if (g.button > 0 || C.closest("button") || !g.currentTarget.contains(C)) return;
141
141
  const p = t.get(l).getBoundingClientRect();
142
142
  s.current = { id: l, from: u, x0: g.clientX, y0: g.clientY, x: g.clientX, y: g.clientY, dx: g.clientX - p.left, dy: g.clientY - p.top, started: !1, target: u }, g.currentTarget.setPointerCapture(g.pointerId);
143
143
  }, A = (l) => {
@@ -145,9 +145,9 @@ function Nt({ grid: n, cards: t, shown: r, drop: i, cancelled: M }) {
145
145
  if (u) {
146
146
  if (u.x = l.clientX, u.y = l.clientY, !u.started) {
147
147
  if (Math.hypot(u.x - u.x0, u.y - u.y0) <= 4) return;
148
- u.started = !0, a({ id: u.id, target: u.from }), d.current.escape = (g) => g.key === "Escape" && h.current.finish(!1), document.addEventListener("keydown", d.current.escape), d.current.timer = window.setInterval(() => {
149
- const k = s.current?.y ?? window.innerHeight / 2, p = Math.ceil((64 - Math.min(k, window.innerHeight - k)) / 4);
150
- p <= 0 || (window.scrollBy(0, k < window.innerHeight / 2 ? -p : p), h.current.update());
148
+ u.started = !0, a({ id: u.id, target: u.from }), c.current.escape = (g) => g.key === "Escape" && h.current.finish(!1), document.addEventListener("keydown", c.current.escape), c.current.timer = window.setInterval(() => {
149
+ const C = s.current?.y ?? window.innerHeight / 2, p = Math.ceil((64 - Math.min(C, window.innerHeight - C)) / 4);
150
+ p <= 0 || (window.scrollBy(0, C < window.innerHeight / 2 ? -p : p), h.current.update());
151
151
  }, 16);
152
152
  }
153
153
  h.current.update();
@@ -173,11 +173,11 @@ function Et() {
173
173
  return null;
174
174
  }
175
175
  const Rt = "heading", q = (n, t) => n.title?.(t) ?? n.label;
176
- function Dt({ options: n, change: t }) {
176
+ function Lt({ options: n, change: t }) {
177
177
  const r = pe();
178
- return /* @__PURE__ */ o(Fe, { label: r.dashboardHeadingField, children: /* @__PURE__ */ o(Be, { value: n.text, onChange: (i) => t({ text: i.target.value }) }) });
178
+ return /* @__PURE__ */ o(Fe, { label: r.dashboardHeadingField, children: /* @__PURE__ */ o(je, { value: n.text, onChange: (d) => t({ text: d.target.value }) }) });
179
179
  }
180
- function Lt(n) {
180
+ function Tt(n) {
181
181
  return {
182
182
  name: Rt,
183
183
  label: n.dashboardHeadingLabel,
@@ -186,48 +186,48 @@ function Lt(n) {
186
186
  start: "full",
187
187
  defaultOptions: { text: n.dashboardHeadingText },
188
188
  title: (t) => t.text || n.dashboardHeadingLabel,
189
- form: Dt,
189
+ form: Lt,
190
190
  children: () => null
191
191
  };
192
192
  }
193
193
  const se = (...n) => n.filter(Boolean).join(" "), he = 12;
194
- function Tt({ render: n, ...t }) {
194
+ function It({ render: n, ...t }) {
195
195
  return n(t);
196
196
  }
197
- const Se = (n, t) => ({ "--_dashboard-column": n.column + 1, "--_dashboard-row": n.row + 1, "--_dashboard-columns": n.columns, "--_dashboard-rows": n.rows, "--_dashboard-order": t }), Ce = (n) => n.columns * n.rows;
198
- function It({ title: n, editing: t, children: r }) {
199
- const i = R(null), [M, b] = Q(!1);
197
+ const ke = (n, t) => ({ "--_dashboard-column": n.column + 1, "--_dashboard-row": n.row + 1, "--_dashboard-columns": n.columns, "--_dashboard-rows": n.rows, "--_dashboard-order": t }), Se = (n) => n.columns * n.rows;
198
+ function At({ title: n, editing: t, children: r }) {
199
+ const d = E(null), [M, b] = Q(!1);
200
200
  Z(() => {
201
- const s = i.current;
201
+ const s = d.current;
202
202
  if (!s) return;
203
- const d = () => b(s.scrollHeight > s.clientHeight || s.scrollWidth > s.clientWidth), c = new ResizeObserver(d), w = () => {
204
- c.disconnect(), c.observe(s);
205
- for (const _ of s.children) c.observe(_);
206
- d();
203
+ const c = () => b(s.scrollHeight > s.clientHeight || s.scrollWidth > s.clientWidth), i = new ResizeObserver(c), w = () => {
204
+ i.disconnect(), i.observe(s);
205
+ for (const _ of s.children) i.observe(_);
206
+ c();
207
207
  }, h = new MutationObserver(w);
208
208
  return h.observe(s, { childList: !0 }), w(), () => {
209
- c.disconnect(), h.disconnect();
209
+ i.disconnect(), h.disconnect();
210
210
  };
211
211
  }, []);
212
212
  const a = M && !t;
213
- return /* @__PURE__ */ o("div", { ref: i, className: x.body, "data-widget-body": "", inert: t, ...a ? { role: "group", tabIndex: 0, "aria-label": n } : {}, children: r });
213
+ return /* @__PURE__ */ o("div", { ref: d, className: x.body, "data-widget-body": "", inert: t, ...a ? { role: "group", tabIndex: 0, "aria-label": n } : {}, children: r });
214
214
  }
215
215
  const ie = (n, t) => (r) => {
216
216
  r ? n.set(t, r) : n.delete(t);
217
217
  };
218
- function At({ view: n, editor: t, className: r, children: i, catalogue: M, headingLevel: b = 2, ...a }) {
219
- const s = pe(), d = fe(() => Lt(s), [s]), c = /* @__PURE__ */ new Map();
220
- for (const e of Ie.toArray(i))
221
- _e(e) && e.type === Ne ? c.set(e.props.name, e.props) : _e(e) && e.type === Et && c.set(d.name, d);
218
+ function $t({ view: n, editor: t, className: r, children: d, catalogue: M, headingLevel: b = 2, ...a }) {
219
+ const s = pe(), c = fe(() => Tt(s), [s]), i = /* @__PURE__ */ new Map();
220
+ for (const e of Ie.toArray(d))
221
+ _e(e) && e.type === Ne ? i.set(e.props.name, e.props) : _e(e) && e.type === Et && i.set(c.name, c);
222
222
  const { register: w } = t;
223
- Z(() => w(c));
224
- const h = ve(n, c), _ = h.widgets.flatMap((e) => {
225
- const f = c.get(e.type), y = f?.sizes[e.size];
223
+ Z(() => w(i));
224
+ const h = ve(n, i), _ = h.widgets.flatMap((e) => {
225
+ const f = i.get(e.type), y = f?.sizes[e.size];
226
226
  return f && y ? [{ widget: e, type: f, span: y }] : [];
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((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
- }, { drag: T, placeholder: z, handlers: m } = Nt({
227
+ }), ee = `h${Math.min(6, b + (_.some(({ type: e }) => e === c) ? 1 : 0))}`, K = E(null), [A] = Q(() => /* @__PURE__ */ new Map()), [l] = Q(() => /* @__PURE__ */ new Map()), [u] = Q(() => /* @__PURE__ */ new Map()), g = E(null), C = E(null), { editing: p } = t, S = 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, S) : e, L = (e, f, y) => {
228
+ const N = h.widgets.findIndex((H) => H.id === e), O = Math.max(0, Math.min(S - 1, y));
229
+ N !== O && (t.step(qe(e, O)), P(s.dashboardMoved(f, N + 1, O + 1, S)));
230
+ }, { drag: T, placeholder: z, handlers: m } = Dt({
231
231
  grid: K,
232
232
  cards: A,
233
233
  shown: _.map(({ widget: e, type: f, span: y }) => ({ id: e.id, span: y, title: q(f, e.options) })),
@@ -236,76 +236,76 @@ function At({ view: n, editor: t, className: r, children: i, catalogue: M, headi
236
236
  L(e, q(y.type, y.widget.options), h.widgets.findIndex((N) => N.id === f));
237
237
  },
238
238
  cancelled: (e) => P(s.dashboardDragCancelled(e))
239
- }), S = T ? _.findIndex((e) => e.widget.id === T.id) : -1, v = _.map((e, f) => f);
240
- S >= 0 && v.splice(T.target, 0, ...v.splice(S, 1));
241
- const G = de(v.map((e) => _[e].span), he), X = _.map((e, f) => G[v.indexOf(f)]), [I, be] = Q(null), we = R(null), re = R(null);
239
+ }), k = T ? _.findIndex((e) => e.widget.id === T.id) : -1, v = _.map((e, f) => f);
240
+ k >= 0 && v.splice(T.target, 0, ...v.splice(k, 1));
241
+ const G = de(v.map((e) => _[e].span), he), X = _.map((e, f) => G[v.indexOf(f)]), [I, be] = Q(null), we = E(null), re = E(null);
242
242
  Z(() => {
243
243
  re.current && (A.get(re.current)?.scrollIntoView?.({ block: "nearest" }), re.current = null);
244
244
  });
245
- const te = R(!1);
245
+ const te = E(!1);
246
246
  Z(() => {
247
247
  te.current !== !1 && ((te.current === null ? g.current : l.get(te.current))?.focus(), te.current = !1);
248
248
  });
249
- const J = R(null);
249
+ const J = E(null);
250
250
  Z(() => {
251
251
  const e = J.current;
252
- J.current = null, (e === "add" ? g.current : e === "edit" ? k.current : null)?.focus();
252
+ J.current = null, (e === "add" ? g.current : e === "edit" ? C.current : null)?.focus();
253
253
  });
254
- const Ee = [...c.values()].filter((e) => !M || M.includes(e.name)), Re = (e) => {
255
- const f = { id: Ze(h, e.name), type: e.name, size: e.start, options: e.defaultOptions };
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, O) => p ? {
254
+ const De = [...i.values()].filter((e) => !M || M.includes(e.name)), Ee = (e) => {
255
+ const f = { id: et(h, e.name), type: e.name, size: e.start, options: e.defaultOptions };
256
+ re.current = f.id, t.step(tt(f)), P(s.dashboardAdded(q(e, f.options), S + 1, S + 1));
257
+ }, ce = I ? i.get(h.widgets.find((e) => e.id === I)?.type ?? "") : void 0, le = h.widgets.find((e) => e.id === I), Re = (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": (O ? s.dashboardHeadLocked : s.dashboardHead)(f, N + 1, C),
263
+ "aria-label": (O ? s.dashboardHeadLocked : s.dashboardHead)(f, N + 1, S),
264
264
  "aria-describedby": V,
265
265
  onKeyDown: (H) => {
266
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));
267
+ const $ = { ArrowUp: -1, ArrowDown: 1 }[H.key], D = $ ? h.widgets.findIndex((Y) => Y.id === _[Ht(_.map((ue) => ue.span), he, y, $)]?.widget.id) : { ArrowLeft: N - 1, ArrowRight: N + 1, Home: 0, End: S - 1 }[H.key];
268
+ D !== void 0 && (H.preventDefault(), L(e.id, f, D));
269
269
  }
270
270
  } : { className: x.head }, Le = (e, f, y, N, O, H) => {
271
- const $ = Object.entries(f.sizes).sort(([, E], [, Y]) => Ce(E) - Ce(Y));
272
- return /* @__PURE__ */ D(
271
+ const $ = Object.entries(f.sizes).sort(([, D], [, Y]) => Se(D) - Se(Y));
272
+ return /* @__PURE__ */ R(
273
273
  Xe,
274
274
  {
275
275
  align: "end",
276
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(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: [
278
+ /* @__PURE__ */ o(j, { disabled: !0, children: s.dashboardPlace(O + 1, S) }),
279
+ /* @__PURE__ */ o(j, { disabled: O === 0, onSelect: () => L(e.id, y, 0), children: s.dashboardMoveStart }),
280
+ /* @__PURE__ */ o(j, { disabled: O === 0, onSelect: () => L(e.id, y, O - 1), children: s.dashboardMoveEarlier }),
281
+ /* @__PURE__ */ o(j, { disabled: O === S - 1, onSelect: () => L(e.id, y, O + 1), children: s.dashboardMoveLater }),
282
+ /* @__PURE__ */ o(j, { disabled: O === S - 1, onSelect: () => L(e.id, y, S - 1), children: s.dashboardMoveEnd }),
283
+ H && /* @__PURE__ */ R(ae, { children: [
284
284
  /* @__PURE__ */ o(oe, {}),
285
- /* @__PURE__ */ o(B, { disabled: !0, children: s.dashboardLockedLine })
285
+ /* @__PURE__ */ o(j, { disabled: !0, children: s.dashboardLockedLine })
286
286
  ] }),
287
- !H && $.length > 1 && /* @__PURE__ */ D(ae, { children: [
287
+ !H && $.length > 1 && /* @__PURE__ */ R(ae, { children: [
288
288
  /* @__PURE__ */ o(oe, {}),
289
- $.map(([E, Y]) => /* @__PURE__ */ D(
290
- B,
289
+ $.map(([D, Y]) => /* @__PURE__ */ R(
290
+ j,
291
291
  {
292
292
  role: "menuitemradio",
293
- "aria-checked": E === e.size,
293
+ "aria-checked": D === e.size,
294
294
  onSelect: () => {
295
- t.step(qe(e.id, E)), P(s.dashboardResized(y, s.dashboardSizes[E]));
295
+ t.step(Qe(e.id, D)), P(s.dashboardResized(y, s.dashboardSizes[D]));
296
296
  },
297
297
  children: [
298
- /* @__PURE__ */ o("span", { "aria-hidden": "true", style: { display: "inline-block", width: "1.25em" }, children: E === e.size ? "✓" : "" }),
299
- s.dashboardSizeEntry(s.dashboardSizes[E], vt(Y))
298
+ /* @__PURE__ */ o("span", { "aria-hidden": "true", style: { display: "inline-block", width: "1.25em" }, children: D === e.size ? "✓" : "" }),
299
+ s.dashboardSizeEntry(s.dashboardSizes[D], Nt(Y))
300
300
  ]
301
301
  },
302
- E
302
+ D
303
303
  ))
304
304
  ] }),
305
- !H && f.form && /* @__PURE__ */ D(ae, { children: [
305
+ !H && f.form && /* @__PURE__ */ R(ae, { children: [
306
306
  /* @__PURE__ */ o(oe, {}),
307
307
  /* @__PURE__ */ o(
308
- B,
308
+ j,
309
309
  {
310
310
  onSelect: () => {
311
311
  we.current = u.get(e.id) ?? null, be(e.id);
@@ -316,11 +316,11 @@ function At({ view: n, editor: t, className: r, children: i, catalogue: M, headi
316
316
  ] }),
317
317
  !H && /* @__PURE__ */ o(oe, {}),
318
318
  !H && /* @__PURE__ */ o(
319
- B,
319
+ j,
320
320
  {
321
321
  tone: "danger",
322
322
  onSelect: () => {
323
- te.current = (_[N + 1] ?? _[N - 1])?.widget.id ?? null, t.step(Qe(e.id)), P(s.dashboardRemoved(y));
323
+ te.current = (_[N + 1] ?? _[N - 1])?.widget.id ?? null, t.step(Ze(e.id)), P(s.dashboardRemoved(y));
324
324
  },
325
325
  children: s.dashboardRemove
326
326
  }
@@ -329,7 +329,7 @@ function At({ view: n, editor: t, className: r, children: i, catalogue: M, headi
329
329
  }
330
330
  );
331
331
  };
332
- return /* @__PURE__ */ D(
332
+ return /* @__PURE__ */ R(
333
333
  "div",
334
334
  {
335
335
  role: "group",
@@ -340,7 +340,7 @@ function At({ view: n, editor: t, className: r, children: i, catalogue: M, headi
340
340
  a.onKeyDown?.(e), !(e.key !== "Escape" || e.defaultPrevented || !p || T || t.catalogue || I || e.target.closest('[role="menu"], [role="dialog"]')) && (J.current = "edit", t.cancel());
341
341
  },
342
342
  children: [
343
- t.allowed && /* @__PURE__ */ o("div", { className: x.bar, children: p ? /* @__PURE__ */ D(ae, { children: [
343
+ t.allowed && /* @__PURE__ */ o("div", { className: x.bar, children: p ? /* @__PURE__ */ R(ae, { children: [
344
344
  /* @__PURE__ */ o("span", { className: x.mode, children: s.dashboardEditing }),
345
345
  /* @__PURE__ */ o(F, { size: "sm", disabled: !t.canUndo, onClick: t.undo, children: s.dashboardUndo }),
346
346
  /* @__PURE__ */ o(F, { size: "sm", disabled: !t.canRedo, onClick: t.redo, children: s.dashboardRedo }),
@@ -354,51 +354,51 @@ function At({ view: n, editor: t, className: r, children: i, catalogue: M, headi
354
354
  /* @__PURE__ */ o(F, { size: "sm", variant: "primary", onClick: () => {
355
355
  J.current = "edit", t.done();
356
356
  }, children: s.dashboardDone })
357
- ] }) : /* @__PURE__ */ o(F, { ref: k, size: "sm", onClick: () => {
357
+ ] }) : /* @__PURE__ */ o(F, { ref: C, size: "sm", onClick: () => {
358
358
  J.current = "add", t.edit();
359
359
  }, children: s.dashboardEdit }) }),
360
360
  p && /* @__PURE__ */ o("span", { id: V, hidden: !0, children: s.dashboardHeadHint }),
361
- p && C === 0 && /* @__PURE__ */ o(ne, { children: s.dashboardEmptyEditing }),
362
- !p && C === 0 && /* @__PURE__ */ o(ne, { children: s.dashboardEmpty }),
363
- /* @__PURE__ */ D("div", { className: x.grid, ref: K, children: [
361
+ p && S === 0 && /* @__PURE__ */ o(ne, { children: s.dashboardEmptyEditing }),
362
+ !p && S === 0 && /* @__PURE__ */ o(ne, { children: s.dashboardEmpty }),
363
+ /* @__PURE__ */ R("div", { className: x.grid, ref: K, children: [
364
364
  _.map(({ widget: e, type: f }, y) => {
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
- 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: [
365
+ const N = ke(X[y], v.indexOf(y)), O = q(f, e.options), H = h.widgets.findIndex((ue) => ue.id === e.id), $ = e.locked === !0, D = Re(e, O, y, H, $), Y = p && Le(e, f, O, y, H, $);
366
+ return f === c ? /* @__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__ */ R("div", { ...D, className: se(D.className, x.headingHead), children: [
367
367
  p && /* @__PURE__ */ o(xe, { className: x.grip }),
368
- /* @__PURE__ */ o(je, { level: b, size: "lg", className: x.heading, children: e.options.text }),
368
+ /* @__PURE__ */ o(Be, { 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(O, H), children: [
372
- /* @__PURE__ */ D("div", { ...E, children: [
371
+ ] }) }, e.id) : /* @__PURE__ */ R(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
+ /* @__PURE__ */ R("div", { ...D, children: [
373
373
  p && /* @__PURE__ */ o(xe, { className: x.grip }),
374
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(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 }) }) }) })
379
+ /* @__PURE__ */ o(At, { title: W(O, H), editing: p, children: /* @__PURE__ */ o(Mt, { 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(It, { render: f.children, size: e.size, options: e.options }) }) }) })
380
380
  ] }, e.id);
381
381
  }),
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) })
382
+ k >= 0 && /* @__PURE__ */ o("div", { ref: z, "aria-hidden": "true", "data-placeholder": !0, className: se(x.item, x.placeholder), style: ke(X[k], T.target) })
383
383
  ] }),
384
- /* @__PURE__ */ D(We, { open: t.catalogue, onClose: () => t.setCatalogue(!1), children: [
384
+ /* @__PURE__ */ R(We, { open: t.catalogue, onClose: () => t.setCatalogue(!1), children: [
385
385
  /* @__PURE__ */ o(Ge, { title: s.dashboardCatalogue, description: s.dashboardCatalogueSentence }),
386
- /* @__PURE__ */ o(Ye, { children: /* @__PURE__ */ o("ul", { className: x.catalogue, children: Ee.map((e) => {
386
+ /* @__PURE__ */ o(Ye, { children: /* @__PURE__ */ o("ul", { className: x.catalogue, children: De.map((e) => {
387
387
  const f = e.sizes[e.start];
388
- return /* @__PURE__ */ D("li", { className: x.entry, children: [
388
+ return /* @__PURE__ */ R("li", { className: x.entry, children: [
389
389
  /* @__PURE__ */ o("div", { className: x.footprint, role: "img", "aria-label": s.dashboardFootprint(f.columns, f.rows), children: /* @__PURE__ */ o("span", { style: { width: `${f.columns / he * 100}%`, height: `${Math.min(1, f.rows / 4) * 100}%` } }) }),
390
- /* @__PURE__ */ D("div", { className: x.entryText, children: [
390
+ /* @__PURE__ */ R("div", { className: x.entryText, children: [
391
391
  /* @__PURE__ */ o(ne, { as: "strong", weight: "semibold", children: e.label }),
392
392
  /* @__PURE__ */ o(ne, { as: "span", size: "sm", tone: "secondary", children: e.sentence })
393
393
  ] }),
394
- /* @__PURE__ */ o(F, { size: "sm", "aria-label": s.dashboardAddType(e.label), onClick: () => Re(e), children: s.dashboardAdd })
394
+ /* @__PURE__ */ o(F, { size: "sm", "aria-label": s.dashboardAddType(e.label), onClick: () => Ee(e), children: s.dashboardAdd })
395
395
  ] }, e.name);
396
396
  }) }) })
397
397
  ] }),
398
398
  ce?.form && le && /* @__PURE__ */ o(Ke, { open: !0, anchorRef: we, align: "end", onOpenChange: () => be(null), role: "dialog", "aria-label": s.dashboardOptions, children: /* @__PURE__ */ o("div", { className: x.options, children: ce.form({
399
399
  options: le.options,
400
400
  change: (e) => {
401
- t.step(tt(le.id, e)), P(s.dashboardOptionsChanged(q(ce, e)));
401
+ t.step(nt(le.id, e)), P(s.dashboardOptionsChanged(q(ce, e)));
402
402
  }
403
403
  }) }) })
404
404
  ]
@@ -406,97 +406,100 @@ function At({ view: n, editor: t, className: r, children: i, catalogue: M, headi
406
406
  );
407
407
  }
408
408
  const Oe = (n, t) => JSON.stringify(n) === JSON.stringify(t);
409
- function Bt({ defaultView: n, initialView: t, allowEdit: r = !0, onViewChange: i, onDraftChange: M }) {
410
- const b = R(null);
409
+ function Bt({ defaultView: n, initialView: t, allowEdit: r = !0, onViewChange: d, onDraftChange: M }) {
410
+ const b = E(null);
411
411
  b.current ??= { state: { view: Me(t) ? t : n, draft: null, known: 0 }, listeners: /* @__PURE__ */ new Set(), types: /* @__PURE__ */ new Map(), signature: "" };
412
- const a = b.current, s = pe(), d = R({ defaultView: n, allowEdit: r, onViewChange: i, onDraftChange: M, wording: s });
413
- d.current = { defaultView: n, allowEdit: r, onViewChange: i, onDraftChange: M, wording: s };
414
- const c = fe(() => {
412
+ const a = b.current, s = pe(), c = E({ defaultView: n, allowEdit: r, onViewChange: d, onDraftChange: M, wording: s });
413
+ c.current = { defaultView: n, allowEdit: r, onViewChange: d, onDraftChange: M, wording: s };
414
+ const i = fe(() => {
415
415
  const K = (z) => (a.listeners.add(z), () => void a.listeners.delete(z)), A = () => a.state, l = (z) => {
416
416
  a.state = z, a.listeners.forEach((m) => m());
417
- }, u = (z) => a.types.size ? ve(z, a.types) : Mt(z), g = () => {
418
- !d.current.allowEdit || a.state.draft || (l({ ...a.state, draft: { steps: [u(a.state.view)], at: 0 } }), d.current.onDraftChange?.(!0), P(d.current.wording.dashboardEditing));
419
- }, k = (z) => {
420
- const { view: m, draft: S } = a.state;
421
- if (!S) return;
422
- const v = S.steps[S.at], G = z && !Oe(v, u(m)), X = { ...v, widgets: [...v.widgets, ...kt(m, S.steps[0])] };
423
- l({ ...a.state, view: G ? X : m, draft: null, catalogue: !1 }), d.current.onDraftChange?.(!1);
424
- const { wording: I } = d.current;
425
- P(z ? G ? I.dashboardKept : I.dashboardLeft : I.dashboardCancelled), G && d.current.onViewChange?.(X);
417
+ }, u = (z) => a.types.size ? ve(z, a.types) : Ct(z), g = () => {
418
+ !c.current.allowEdit || a.state.draft || (l({ ...a.state, draft: { steps: [u(a.state.view)], at: 0 } }), c.current.onDraftChange?.(!0), P(c.current.wording.dashboardEditing));
419
+ }, C = (z) => {
420
+ const { view: m, draft: k } = a.state;
421
+ if (!k) return;
422
+ const v = k.steps[k.at], G = z && !Oe(v, u(m)), X = { ...v, widgets: [...v.widgets, ...kt(m, k.steps[0])] };
423
+ l({ ...a.state, view: G ? X : m, draft: null, catalogue: !1 }), c.current.onDraftChange?.(!1);
424
+ const { wording: I } = c.current;
425
+ P(z ? G ? I.dashboardKept : I.dashboardLeft : I.dashboardCancelled), G && c.current.onViewChange?.(X);
426
426
  }, p = (z) => {
427
427
  a.state.draft && l({ ...a.state, catalogue: z });
428
- }, C = (z) => {
428
+ }, S = (z) => {
429
429
  const { draft: m } = a.state;
430
430
  if (!m) return;
431
- const S = m.steps[m.at], v = z(S);
432
- v !== S && l({ ...a.state, draft: { steps: [...m.steps.slice(0, m.at + 1), v], at: m.at + 1 } });
431
+ const k = m.steps[m.at], v = z(k);
432
+ v !== k && l({ ...a.state, draft: { steps: [...m.steps.slice(0, m.at + 1), v], at: m.at + 1 } });
433
433
  }, U = (z, m) => {
434
- const { draft: S } = a.state;
435
- S?.steps[S.at + z] && (l({ ...a.state, draft: { ...S, at: S.at + z } }), P(m));
436
- }, V = () => U(-1, d.current.wording.dashboardUndone), W = () => U(1, d.current.wording.dashboardRedone), L = () => {
437
- a.state.draft && (C(() => u(d.current.defaultView)), P(d.current.wording.dashboardResetDone));
438
- }, T = (z, m, S) => ({
434
+ const { draft: k } = a.state;
435
+ k?.steps[k.at + z] && (l({ ...a.state, draft: { ...k, at: k.at + z } }), P(m));
436
+ }, V = () => U(-1, c.current.wording.dashboardUndone), W = () => U(1, c.current.wording.dashboardRedone), L = () => {
437
+ a.state.draft && (S(() => u(c.current.defaultView)), P(c.current.wording.dashboardResetDone));
438
+ }, T = (z, m, k) => ({
439
439
  allowed: z,
440
440
  editing: m !== null,
441
441
  edit: g,
442
- done: () => k(!0),
443
- cancel: () => k(!1),
444
- catalogue: S,
442
+ done: () => C(!0),
443
+ cancel: () => C(!1),
444
+ catalogue: k,
445
445
  setCatalogue: p,
446
446
  register: (v) => {
447
447
  a.types = v;
448
448
  const G = [...v].map(([X, I]) => `${X}:${I.start}:${JSON.stringify(I.sizes)}`).join("|");
449
449
  G !== a.signature && (a.signature = G, l({ ...a.state, known: a.state.known + 1 }));
450
450
  },
451
- step: C,
451
+ step: S,
452
452
  undo: V,
453
453
  redo: W,
454
454
  reset: L,
455
455
  canUndo: !!m && m.at > 0,
456
456
  canRedo: !!m && m.at < m.steps.length - 1,
457
- canReset: !!m && !Oe(m.steps[m.at], u(d.current.defaultView))
457
+ canReset: !!m && !Oe(m.steps[m.at], u(c.current.defaultView))
458
458
  });
459
459
  return {
460
460
  get: A,
461
461
  subscribe: K,
462
462
  edit: g,
463
- done: () => k(!0),
464
- cancel: () => k(!1),
463
+ done: () => C(!0),
464
+ cancel: () => C(!1),
465
465
  undo: V,
466
466
  redo: W,
467
467
  reset: L,
468
- catalogue: () => p(!0),
468
+ openCatalogue: () => p(!0),
469
469
  read: u,
470
470
  setView: (z) => {
471
- const m = Me(z) ? z : d.current.defaultView;
471
+ const m = Me(z) ? z : c.current.defaultView;
472
472
  l({ ...a.state, view: m, draft: a.state.draft ? { steps: [u(m)], at: 0 } : null });
473
473
  },
474
474
  Dashboard: (z) => {
475
- const { view: m, draft: S, catalogue: v } = ze(K, A, A);
476
- return Pe(At, { ...z, view: S ? S.steps[S.at] : m, editor: T(d.current.allowEdit, S, !!v) });
475
+ const { view: m, draft: k, catalogue: v } = ze(K, A, A);
476
+ return Pe($t, { ...z, view: k ? k.steps[k.at] : m, editor: T(c.current.allowEdit, k, !!v) });
477
477
  }
478
478
  };
479
479
  }, [a]);
480
480
  Z(
481
481
  () => () => {
482
- b.current?.state.draft && d.current.onDraftChange?.(!1);
482
+ b.current?.state.draft && c.current.onDraftChange?.(!1);
483
483
  },
484
484
  []
485
485
  );
486
- const { view: w, draft: h, known: _ } = ze(c.subscribe, c.get, c.get), j = h ? h.steps[h.at] : w, ee = fe(() => c.read(j), [c, j, _]);
486
+ const { view: w, draft: h, known: _ } = ze(i.subscribe, i.get, i.get), B = h ? h.steps[h.at] : w, ee = fe(() => i.read(B), [i, B, _]);
487
487
  return {
488
- Dashboard: c.Dashboard,
488
+ Dashboard: i.Dashboard,
489
489
  WidgetType: Ne,
490
490
  view: ee,
491
- setView: c.setView,
491
+ setView: i.setView,
492
492
  editing: h !== null,
493
- edit: c.edit,
494
- done: c.done,
495
- cancel: c.cancel,
496
- catalogue: c.catalogue,
497
- undo: c.undo,
498
- redo: c.redo,
499
- reset: c.reset
493
+ edit: i.edit,
494
+ done: i.done,
495
+ cancel: i.cancel,
496
+ openCatalogue: i.openCatalogue,
497
+ undo: i.undo,
498
+ redo: i.redo,
499
+ reset: i.reset,
500
+ catalogue: () => {
501
+ Je("@umriss-ui/dashboard", "deprecated:useDashboard catalogue", "useDashboard's catalogue() is deprecated and goes in the next major release; use openCatalogue()."), i.openCatalogue();
502
+ }
500
503
  };
501
504
  }
502
505
  export {
package/dist/index.d.ts CHANGED
@@ -37,7 +37,7 @@ export declare interface DashboardParts {
37
37
  /** Leaves the mode, keeps the changes and reports them once if there are any. */
38
38
  done: () => void;
39
39
  /** Opens the catalogue. Does nothing outside the editing mode. */
40
- catalogue: () => void;
40
+ openCatalogue: () => void;
41
41
  /** Leaves the mode and puts the arrangement back as it was before `edit`. */
42
42
  cancel: () => void;
43
43
  /** Goes one step back in the draft. Does nothing at the first. */
@@ -46,6 +46,9 @@ export declare interface DashboardParts {
46
46
  redo: () => void;
47
47
  /** Steps to the `defaultView`; `undo` brings the arrangement back. */
48
48
  reset: () => void;
49
+ /** The old name of `openCatalogue`.
50
+ @deprecated since 0.58 - use openCatalogue. */
51
+ catalogue: () => void;
49
52
  }
50
53
 
51
54
  /** The props of `Dashboard`. */
@@ -63,7 +66,9 @@ export declare interface DashboardProps extends HTMLAttributes<HTMLDivElement>,
63
66
  }
64
67
 
65
68
  /** The arrangement of a dashboard: which widgets, in what order, at which
66
- sizes, with which options. An object, so that more can join it later. */
69
+ sizes, with which options. An object, so that more can join it later.
70
+ It is the supported storage format: an addition is a minor release, and renaming
71
+ or removing `widgets`, `type` or `size` is a major one. */
67
72
  export declare interface DashboardView {
68
73
  /** The widgets, in the order they are drawn and read. */
69
74
  widgets: ReadonlyArray<DashboardWidget>;
package/docs/llms-full.md CHANGED
@@ -1,4 +1,4 @@
1
- # @umriss-ui/dashboard 0.57.0
1
+ # @umriss-ui/dashboard 0.58.1
2
2
 
3
3
  > React dashboard for data-dense applications - widgets a reader arranges, packed in order on twelve columns.
4
4
 
@@ -775,11 +775,12 @@ Every move, size, removal, addition, undo, redo, reset, "Done" and "Cancel" is a
775
775
  | `editing` *required* | `boolean` | — | Whether the editing mode is on.<br>Shown in: [The editing actions in the application's own header](#dashboard), [Arrange the start screen (Scenarios)](#arrange-the-start-screen) |
776
776
  | `edit` *required* | `() => void` | — | Enters the editing mode. Does nothing where editing is not allowed.<br>Shown in: [The editing actions in the application's own header](#dashboard), [Arrange the start screen (Scenarios)](#arrange-the-start-screen) |
777
777
  | `done` *required* | `() => void` | — | Leaves the mode, keeps the changes and reports them once if there are any.<br>Shown in: [The editing actions in the application's own header](#dashboard), [Arrange the start screen (Scenarios)](#arrange-the-start-screen) |
778
- | `catalogue` *required* | `() => void` | — | Opens the catalogue. Does nothing outside the editing mode.<br>Shown in: [Arrange the start screen (Scenarios)](#arrange-the-start-screen) |
778
+ | `openCatalogue` *required* | `() => void` | — | Opens the catalogue. Does nothing outside the editing mode.<br>Shown in: [Arrange the start screen (Scenarios)](#arrange-the-start-screen) |
779
779
  | `cancel` *required* | `() => void` | — | Leaves the mode and puts the arrangement back as it was before `edit`.<br>Shown in: [Arrange the start screen (Scenarios)](#arrange-the-start-screen) |
780
780
  | `undo` *required* | `() => void` | — | Goes one step back in the draft. Does nothing at the first.<br>Shown in: [The editing actions in the application's own header](#dashboard), [Arrange the start screen (Scenarios)](#arrange-the-start-screen) |
781
781
  | `redo` *required* | `() => void` | — | Goes one step forward again. Does nothing at the last.<br>Shown in: [The editing actions in the application's own header](#dashboard) |
782
782
  | `reset` *required* | `() => void` | — | Steps to the `defaultView`; `undo` brings the arrangement back.<br>Shown in: [Arrange the start screen (Scenarios)](#arrange-the-start-screen) |
783
+ | `catalogue` *required* | `() => void` | — | *Deprecated* since 0.58 - use openCatalogue. The old name of `openCatalogue`. |
783
784
 
784
785
  ##### `DashboardProps`
785
786
 
@@ -860,7 +861,7 @@ Declares no props of its own.
860
861
  - 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)).
861
862
  - Where an arrangement is stored, which default a role gets, several dashboards and what stands in a widget are the application's.
862
863
 
863
- What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/dashboard-v0.57.0/docs/adr/0032-what-umriss-is-not.md).
864
+ What umriss deliberately does not build, and why: [ADR-0032](https://github.com/romanhaendler/umriss-ui/blob/dashboard-v0.58.1/docs/adr/0032-what-umriss-is-not.md).
864
865
 
865
866
  ## API index
866
867
 
@@ -1217,7 +1218,7 @@ function Stage({ shown }: { shown: Case }) {
1217
1218
  rearranging: [
1218
1219
  <Button key="edit" onClick={edit} disabled={parts.editing}>Edit</Button>,
1219
1220
  <Button key="undo" onClick={() => { parts.undo(); setSaid("One step back, not all of them."); }} disabled={!parts.editing}>Undo</Button>,
1220
- <Button key="catalogue" onClick={() => { parts.catalogue(); setSaid("Every widget type with its name, a sentence and the room it takes. A new widget shows something at once and stands at the end."); }} disabled={!parts.editing}>Add a widget</Button>,
1221
+ <Button key="catalogue" onClick={() => { parts.openCatalogue(); setSaid("Every widget type with its name, a sentence and the room it takes. A new widget shows something at once and stands at the end."); }} disabled={!parts.editing}>Add a widget</Button>,
1221
1222
  <Button key="done" onClick={() => { parts.done(); setSaid("Only now, and once, the application is told the whole arrangement."); }} disabled={!parts.editing}>Done</Button>,
1222
1223
  ],
1223
1224
  wrong: [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umriss-ui/dashboard",
3
- "version": "0.57.0",
3
+ "version": "0.58.1",
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",
@@ -58,14 +58,14 @@
58
58
  "node": ">=22"
59
59
  },
60
60
  "peerDependencies": {
61
- "@umriss-ui/core": "^0.57.0",
61
+ "@umriss-ui/core": "^0.58.0",
62
62
  "react": "^19",
63
63
  "react-dom": "^19"
64
64
  },
65
65
  "devDependencies": {
66
66
  "@fontsource/geist-mono": "^5.3.0",
67
67
  "@fontsource/geist-sans": "^5.3.0",
68
- "@umriss-ui/core": "0.57.0",
68
+ "@umriss-ui/core": "0.58.1",
69
69
  "@umriss-ui/demo": "0.0.0",
70
70
  "@types/node": "^22.20.2",
71
71
  "@types/react": "^19.0.0",