@object-ui/plugin-dashboard 4.0.10 → 4.0.12

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
@@ -1,5 +1,28 @@
1
1
  # @object-ui/plugin-dashboard
2
2
 
3
+ ## 4.0.12
4
+
5
+ ### Patch Changes
6
+
7
+ - @object-ui/types@4.0.12
8
+ - @object-ui/core@4.0.12
9
+ - @object-ui/i18n@4.0.12
10
+ - @object-ui/react@4.0.12
11
+ - @object-ui/components@4.0.12
12
+ - @object-ui/fields@4.0.12
13
+
14
+ ## 4.0.11
15
+
16
+ ### Patch Changes
17
+
18
+ - Updated dependencies [1909bc3]
19
+ - @object-ui/i18n@4.0.11
20
+ - @object-ui/components@4.0.11
21
+ - @object-ui/fields@4.0.11
22
+ - @object-ui/react@4.0.11
23
+ - @object-ui/types@4.0.11
24
+ - @object-ui/core@4.0.11
25
+
3
26
  ## 4.0.10
4
27
 
5
28
  ### Patch Changes
package/README.md CHANGED
@@ -270,6 +270,50 @@ auto-detection.
270
270
  }
271
271
  ```
272
272
 
273
+ ## DashboardGridLayout — persisting drag / resize edits
274
+
275
+ ### DashboardRenderer — design-mode widget reorder
276
+
277
+ When `DashboardRenderer` is used in design mode (`designMode={true}` plus an
278
+ `onWidgetsReorder` callback), widgets become sortable via
279
+ [**@dnd-kit**](https://dndkit.com/). Dragging a widget over another inserts
280
+ it at that index (insertion semantics, not swap) — the array order *is* the
281
+ visual order because widgets render with `gridColumn: span W`. The renderer
282
+ calls `onWidgetsReorder(nextWidgets)` with the reordered array; the host (e.g.
283
+ `DashboardView`) is responsible for persisting the change via its DataSource.
284
+
285
+ A 5px pointer-activation distance keeps click-to-select working on the same
286
+ widget surface.
287
+
288
+ ## DashboardGridLayout — persisting drag / resize edits
289
+
290
+ `DashboardGridLayout` (registered as schema `type: 'dashboard-grid'`) has an
291
+ inline **"Edit Layout"** mode that lets users drag and resize widgets via
292
+ `react-grid-layout`. When the user clicks **Save Layout**, the new grid
293
+ coordinates are merged back into `schema.widgets[].layout` and handed off
294
+ through the `onSchemaChange` callback.
295
+
296
+ ```tsx
297
+ <DashboardGridLayout
298
+ schema={dashboard}
299
+ // ✅ Preferred — write the updated schema through your data adapter.
300
+ onSchemaChange={(next) => client.meta.saveItem('dashboard', next.name, next)}
301
+ />
302
+ ```
303
+
304
+ If `onSchemaChange` is **not** provided, layout edits stay in component
305
+ state and are lost on refresh — a `console.warn` is emitted in development
306
+ to flag the missing wiring. The component never writes to `localStorage`
307
+ or any other storage on its own: persistence is the parent's concern,
308
+ delegated to whatever data adapter you have injected (REST, ObjectQL,
309
+ file system, …) per the protocol-agnostic architecture rule.
310
+
311
+ > ⚠️ **Removed in 3.4:** the legacy `persistLayoutKey` prop and its
312
+ > built-in localStorage fallback have been removed. Previously a shared
313
+ > default key `'dashboard-layout'` caused layouts to bleed across
314
+ > dashboards. If you still want a browser-local cache for a demo, do it
315
+ > in the parent inside `onSchemaChange`.
316
+
273
317
  <!-- release-metadata:v3.3.0 -->
274
318
 
275
319
  ## Compatibility