@praxisui/page-builder 9.0.62 → 9.0.63

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/README.md CHANGED
@@ -65,11 +65,20 @@ export class PageAuthoringComponent {
65
65
 
66
66
  The persisted document remains `WidgetPageDefinition` from `@praxisui/core`. Page Builder edits that canonical document; it does not introduce a separate page DSL.
67
67
 
68
+ For a page created by governed AI authoring, reopen the complete
69
+ `ConfigDocument<WidgetPageDefinition>` returned by
70
+ `ApiConfigStorage.loadConfigDocument()` and bind it through
71
+ `[authoringDocument]`. This preserves payload, strong ETag and the server-attested
72
+ `UiCompositionPlan` in one revision. The builder verifies both canonical hashes
73
+ before using the plan as semantic context for another turn; a stale or tampered
74
+ source fails closed.
75
+
68
76
  ## Runtime Contract
69
77
 
70
78
  `praxis-dynamic-page-builder` accepts:
71
79
 
72
80
  - `page`: `WidgetPageDefinition | string`
81
+ - `authoringDocument`: canonical Config response containing payload, ETag and optional semantic source; takes precedence over `page`
73
82
  - `context`: runtime context shared with widgets and composition links
74
83
  - `enableCustomization`: enables builder and child authoring affordances; when `false`, the same
75
84
  runtime remains mounted in presentation mode without editing chrome
@@ -130,6 +139,12 @@ It emits:
130
139
  - `agenticAuthoringSharedRuleHandoff`: governed shared-rule continuation handoff
131
140
  - `pageRestart`, `savedPageDeleteRequested`
132
141
 
142
+ Do not use Angular two-way binding `[(page)]` for an authoring draft unless the
143
+ host intentionally wants runtime state to become part of that draft.
144
+ `pageChange` includes runtime composition updates. Bind `[page]` and feed only
145
+ `pageAuthoringChange` back into the source document when persisted authoring and
146
+ runtime projections must remain separate.
147
+
133
148
  ## Governed page persistence
134
149
 
135
150
  Page Builder owns the authoring lifecycle but the host owns persistence. Keep
@@ -304,6 +319,16 @@ pipeline and its materializing step, allowing registry-aware preflight to compar
304
319
  the transformed contract with the target port. Do not relax target compatibility
305
320
  or relabel the source port to hide a transformation.
306
321
 
322
+ Use `fallbackValue` when a projection that can resolve to `undefined` must
323
+ deliver an explicit total value such as `null`. Use `select-case` when the
324
+ result itself changes according to canonical Json Logic. Every branch requires
325
+ `when` and `value`, and the transform requires `defaultValue`; conditions are
326
+ validated against the same `event`, `payload`, `state`, `context` and implicit
327
+ `source` roots used by Core. Unless `output.stableShape` is explicitly `false`,
328
+ all branch values must preserve the JSON shape of `defaultValue`. Malformed
329
+ sources, outputs, cases and conditions fail before `WidgetPageDefinition`
330
+ materialization rather than degrading silently at runtime.
331
+
307
332
  The official Employee Operations case is an executable regression for this boundary. Its first-class `*.ui-composition-plan.json` artifact expresses 22 persisted links as one `selectionSyncs` declaration, two `contextScopes` declarations and one explicit transformed binding, while compilation preserves the same 22 source/target paths, guards, transforms and policies. This reduces the wiring declarations from 22 to 4 (82%) without hiding the executable graph from runtime inspection, audit or the public JSON viewer. Context scopes are deliberately limited to direct inheritance: a value that must be wrapped or reshaped remains an explicit binding with a canonical transform.
308
333
 
309
334
  Page-owned copy can remain compact in the authoring plan. When a `PraxisTextValue` descriptor declares only `{ key }` and the key exists in `i18n.dictionaries[fallbackLocale]`, both canonical compilers materialize that message as the descriptor's runtime `text` fallback. The persisted `WidgetPageDefinition` therefore stays portable while authors do not repeat the same fallback beside every key. Explicit `text` still wins and unknown keys remain untouched, so the compiler never invents copy.