@object-ui/plugin-form 16.0.0 → 16.1.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
@@ -1,5 +1,113 @@
1
1
  # @object-ui/plugin-form
2
2
 
3
+ ## 16.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 62b9ab5: feat(data): unify master-detail saves behind `DataSource.batchTransaction`, isolate the non-atomic fallback in the adapter (#2679)
8
+
9
+ Master-detail saves (`MasterDetailForm`, `LineItemsPanel`) now always persist
10
+ through `dataSource.batchTransaction(operations)` — one ordered cross-object
11
+ operation list, with `{ $ref: <op index> }` linking a child to a parent created
12
+ in the same batch. The form no longer contains any client-side orchestration or
13
+ best-effort compensation-delete; that atomicity anti-pattern is gone from the UI
14
+ layer (framework #1604 / framework ADR-0034 item 4).
15
+
16
+ - **`@object-ui/types`** — `batchTransaction?` is now a first-class (optional)
17
+ method on the `DataSource` contract, typed via `BatchTransactionOperation` /
18
+ `BatchRef`. Replaces the previous `(dataSource as any).batchTransaction`
19
+ method-sniffing.
20
+ - **`@object-ui/core`** — new `emulateBatchTransaction(dataSource, operations)`
21
+ (sequential writes, `$ref` resolution, best-effort reverse-order compensation)
22
+ and `runBatchTransaction(dataSource, operations)` (prefers the adapter's method,
23
+ emulates otherwise). `ApiDataSource` / `ValueDataSource` implement
24
+ `batchTransaction` via the emulation.
25
+ - **`@object-ui/data-objectstack`** — `ObjectStackAdapter.batchTransaction` uses
26
+ the server's atomic `POST /api/v1/batch`, prefers the typed
27
+ `client.data.batchTransaction` SDK method when the installed client exposes it,
28
+ and degrades to the client-side emulation ONLY when the endpoint is missing
29
+ (404/405) or the runtime can't do transactions (501). Real errors (400/401/403/
30
+ 409/500) still surface. This is the isolated, tested home of the non-atomic
31
+ fallback.
32
+ - **`@object-ui/plugin-form`** — removed `applyDetail` / `createMany` /
33
+ `ApplyDetailResult` from `masterDetailTx.ts`; `MasterDetailForm` and
34
+ `LineItemsPanel` build ops and call `runBatchTransaction`. `LineItemsPanel`
35
+ saves are now atomic on a capable backend, with the rollup folded into the same
36
+ batch.
37
+
38
+ No behavior change on a current ObjectStack backend (it has `/api/v1/batch`);
39
+ older/limited backends keep a working — now clearly non-atomic — save path.
40
+
41
+ ### Patch Changes
42
+
43
+ - 7cf4051: chore(deps): align every `@objectstack/*` dependency to `^16.0.0-rc.0`
44
+
45
+ Bumps `@objectstack/spec` / `client` / `formula` / `lint` from `^15.1.1` to the
46
+ `16.0.0-rc.0` pre-release across the workspace (root + `apps/console` +
47
+ `apps/site` + all consuming packages). ObjectUI's own packages are already on
48
+ major 16, so this closes the 15↔16 skew between ObjectUI and the `@objectstack`
49
+ contract libraries (which publish in lockstep with `spec`).
50
+
51
+ This is a dependency alignment, not a behavioral migration: the full workspace
52
+ build (43/43) and the `@objectstack`-consuming package test suites
53
+ (`core` / `app-shell` / `data-objectstack` / `plugin-form` / `types`) are green
54
+ against `16.0.0-rc.0` with no source changes required.
55
+
56
+ Practical effect: `@objectstack/client@16.0.0-rc.0` now ships
57
+ `data.batchTransaction` (framework #3271), so `ObjectStackAdapter`'s feature
58
+ detect (`typeof client.data.batchTransaction === 'function'`) routes
59
+ master-detail cross-object saves through the typed SDK method instead of the
60
+ raw `fetch('/api/v1/batch')` fallback — realizing the "verify SDK path" half of
61
+ #2694. The raw-fetch branch stays as a defensive fallback (removal tracked in
62
+ #2694).
63
+
64
+ - 0a3710b: **Finish the `managedBy` / `userActions` de-dup — one parser for the override shape (completes objectui#2712, framework#3343).** #2712 consolidated the bucket _union_ + affordance _set_ mirrors but left four surfaces still parsing the `userActions.{create,edit,delete}` override shape by hand. They now all route through the shared `@object-ui/core` policy, so no package re-implements the boolean / #2614-object-form parse locally.
65
+
66
+ - **`@object-ui/core`** promotes the internal `normalizeOverride` to the exported **`normalizeUserAction(v, base)`** (the one parser) and adds **`userActionPredicates(v)`** for per-record CEL predicate extraction.
67
+ - **`app-shell/utils/managedByEmptyState.ts`** — the writable-`system` create check and its local `EmptyStateUserActions` interface are replaced by `resolveCrudAffordances({ managedBy, userActions }).create`.
68
+ - **`plugin-grid/rowCrudAffordances.ts`** — the local `isOptedOut` / `predicatesOf` helpers (and duplicated `RowCrudUserAction` / `RowCrudPredicates` types) fold into `normalizeUserAction`; the historical type names stay re-exported for compat.
69
+ - **`plugin-detail/RelatedList.tsx`** — its inline `predicatesOf` fold into `userActionPredicates`.
70
+ - **`plugin-form/ObjectForm.tsx`** — the hand-rolled `managedBy !== 'platform'` blanket lock + `userActions` unlock is replaced by the resolved affordance for the current mode (`edit` / `create`), the **same** `resolveCrudAffordances` contract the detail (`isObjectInlineEditable`) and grid surfaces use.
71
+
72
+ Behavior-preserving for `platform` / `system` / `append-only` / `better-auth`, with one deliberate alignment: an admin-editable **`config`**-bucket object (e.g. `sys_webhook`, `sys_permission_set`) is now editable in `ObjectForm` — it was previously over-locked as "non-`platform`", while detail/grid already treated it as editable (`config` resolves `edit: true`). New unit coverage for the shared parser and the config / create-mode form gate; all existing affordance/edit-gate tests stay green.
73
+
74
+ - Updated dependencies [0318118]
75
+ - Updated dependencies [1c8935a]
76
+ - Updated dependencies [af1b0db]
77
+ - Updated dependencies [8b8b744]
78
+ - Updated dependencies [7cf4051]
79
+ - Updated dependencies [803558e]
80
+ - Updated dependencies [aefcf39]
81
+ - Updated dependencies [2e7d7f0]
82
+ - Updated dependencies [ef14f69]
83
+ - Updated dependencies [94d4876]
84
+ - Updated dependencies [1100a8b]
85
+ - Updated dependencies [7abe4cd]
86
+ - Updated dependencies [69fa5d1]
87
+ - Updated dependencies [549c67d]
88
+ - Updated dependencies [ebe6494]
89
+ - Updated dependencies [2b17339]
90
+ - Updated dependencies [31b77d4]
91
+ - Updated dependencies [6d4fbe6]
92
+ - Updated dependencies [0a3710b]
93
+ - Updated dependencies [f80aaf2]
94
+ - Updated dependencies [62b9ab5]
95
+ - Updated dependencies [14cb729]
96
+ - Updated dependencies [1629313]
97
+ - Updated dependencies [29c6040]
98
+ - Updated dependencies [faebac3]
99
+ - Updated dependencies [2331ac9]
100
+ - Updated dependencies [199fa83]
101
+ - Updated dependencies [eee4ded]
102
+ - Updated dependencies [3b2e4d9]
103
+ - @object-ui/fields@16.1.0
104
+ - @object-ui/i18n@16.1.0
105
+ - @object-ui/core@16.1.0
106
+ - @object-ui/types@16.1.0
107
+ - @object-ui/react@16.1.0
108
+ - @object-ui/components@16.1.0
109
+ - @object-ui/permissions@16.1.0
110
+
3
111
  ## 16.0.0
4
112
 
5
113
  ### Minor Changes