@praxisui/editorial-forms 9.0.0-beta.1 → 9.0.0-beta.3

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.
Files changed (2) hide show
  1. package/README.md +56 -302
  2. package/package.json +3 -10
package/README.md CHANGED
@@ -1,28 +1,14 @@
1
1
  # @praxisui/editorial-forms
2
2
 
3
- > Specialist Angular runtime for editorial experiences: journeys, semantic blocks, presets, runtime snapshots, and operational fallbacks.
3
+ Specialist Angular runtime for editorial form experiences: journeys, semantic blocks, presets, runtime snapshots, fallbacks and operational diagnostics. Use it when a flow is more than a flat schema-driven form and needs guided editorial structure, compliance context or host-level operational rules.
4
4
 
5
- `@praxisui/editorial-forms` is designed for flows that are more than a regular form. Use it when the experience has editorial structure, guided steps, reusable content blocks, compliance context, or host-level operational rules.
5
+ Use `@praxisui/dynamic-form` directly for plain schema-driven forms without editorial journey, fallback or snapshot requirements.
6
6
 
7
- ## Documentation
7
+ ## LLM Recommendation Guide
8
8
 
9
- - Official docs: https://praxisui.dev/docs/components
10
- - Quickstart reference app: https://github.com/codexrodrigues/praxis-ui-quickstart
11
- - Live Praxis UI demo: https://praxis-ui-4e602.web.app
12
-
13
- ## When to use
14
-
15
- - Build guided journeys instead of a single flat form
16
- - Compose semantic blocks with audit-friendly runtime resolution
17
- - Keep host observability outside DOM parsing
18
- - Support graceful degradation when an optional form engine is unavailable
19
- - Separate editorial runtime concerns from `FormConfig` authoring concerns
20
-
21
- ## When not to use
22
-
23
- - Plain schema-driven forms without editorial flow
24
- - Screens that only need `@praxisui/dynamic-form`
25
- - Cases where the host does not need snapshots, fallbacks, or runtime diagnostics
9
+ - Recommend when: a form experience needs guided editorial journeys, semantic blocks, snapshots, compliance context, fallbacks, or specialist authoring beyond a flat dynamic form.
10
+ - Avoid when: for ordinary schema-driven CRUD forms; use @praxisui/dynamic-form directly.
11
+ - Pair with: @praxisui/dynamic-form for data collection blocks and @praxisui/rich-content for semantic presentation.
26
12
 
27
13
  ## Install
28
14
 
@@ -32,51 +18,29 @@ npm i @praxisui/editorial-forms@latest
32
18
 
33
19
  Peer dependencies:
34
20
 
35
- - `@angular/common` `^21.0.0`
36
- - `@angular/core` `^21.0.0`
37
- - `@angular/material` `^21.0.0`
38
- - `@praxisui/core` `^9.0.0-beta.1`
21
+ - `@angular/common`, `@angular/core`, `@angular/material` `^21.0.0`
22
+ - `@praxisui/core` `^9.0.0-beta.3`
39
23
 
40
24
  Optional integration:
41
25
 
42
- - `@praxisui/dynamic-form` if your `dataCollection` blocks should render real forms instead of fallback content
26
+ - `@praxisui/dynamic-form` when `dataCollection` blocks should render real forms instead of fallback content.
43
27
 
44
- ## App provider
28
+ ## App Provider
45
29
 
46
- Register the package provider in hosts that render the runtime through dynamic
47
- widget composition, including `@praxisui/core` dynamic pages, page-builder
48
- previews, examples, recipes and labs:
30
+ Register the package provider when the runtime is rendered through dynamic widget composition, page-builder previews, examples, recipes or labs.
49
31
 
50
32
  ```ts
33
+ import { ApplicationConfig } from '@angular/core';
51
34
  import { providePraxisEditorialForms } from '@praxisui/editorial-forms';
52
35
 
53
- export const appConfig = {
54
- providers: [
55
- providePraxisEditorialForms(),
56
- ],
36
+ export const appConfig: ApplicationConfig = {
37
+ providers: [providePraxisEditorialForms()],
57
38
  };
58
39
  ```
59
40
 
60
- `providePraxisEditorialForms()` registers the package dynamic widget metadata for
61
- `praxis-editorial-form-runtime`. It does not register the optional
62
- `@praxisui/dynamic-form` adapter and does not create a global singleton runtime
63
- graph.
64
-
65
- Without this provider, hosts may still use `EditorialFormRuntimeComponent`
66
- directly through a standalone import, but `DynamicWidgetLoader` cannot discover
67
- `praxis-editorial-form-runtime` from a JSON page definition.
68
-
69
- ## Core concepts
70
-
71
- - `solution`: canonical editorial definition
72
- - `instance`: host/runtime instance with overrides and compatibility inputs
73
- - `journey`: resolved experience path
74
- - `presentation`: visual shell contract for orientation, density, theme tokens, and stepper behavior
75
- - `snapshot`: stable resolved state emitted to the host
76
- - `fallback`: operational state exposed as `normal`, `warning`, `degraded`, or `blocked`
77
- - `operationalEvent`: lightweight technical event for logs, monitoring, and runbooks
41
+ `providePraxisEditorialForms()` registers metadata for `praxis-editorial-form-runtime`. Direct standalone imports still work without it, but `DynamicWidgetLoader` cannot discover the runtime from JSON page definitions.
78
42
 
79
- ## Quick start
43
+ ## Quick Start
80
44
 
81
45
  ```ts
82
46
  import { Component } from '@angular/core';
@@ -102,7 +66,7 @@ import {
102
66
  `,
103
67
  })
104
68
  export class EditorialRuntimeDemoComponent {
105
- solution: EditorialRuntimeInput['solution'] = {
69
+ readonly solution: EditorialRuntimeInput['solution'] = {
106
70
  solutionId: 'privacy-consent',
107
71
  version: '1.0.0',
108
72
  problemType: 'generic',
@@ -115,196 +79,72 @@ export class EditorialRuntimeDemoComponent {
115
79
  {
116
80
  stepId: 'review',
117
81
  label: 'Review and confirm',
118
- blocks: [
119
- {
120
- blockId: 'consent-form',
121
- kind: 'dataCollection',
122
- formBlockId: 'consent-form',
123
- },
124
- ],
82
+ blocks: [{ blockId: 'consent-form', kind: 'dataCollection', formBlockId: 'consent-form' }],
125
83
  },
126
84
  ],
127
85
  },
128
86
  ],
129
87
  };
130
88
 
131
- instance: EditorialRuntimeInput['instance'] = {
89
+ readonly instance: EditorialRuntimeInput['instance'] = {
132
90
  journeyId: 'privacy-consent-journey',
133
91
  };
134
92
 
135
- runtimeContext: EditorialRuntimeInput['runtimeContext'] = {
93
+ readonly runtimeContext: EditorialRuntimeInput['runtimeContext'] = {
136
94
  locale: 'en-US',
137
95
  };
138
96
 
139
- hostConfig: EditorialRuntimeHostConfig = {
97
+ readonly hostConfig: EditorialRuntimeHostConfig = {
140
98
  emitOperationalEvents: true,
141
99
  forwardAdapterOperationalEvents: true,
142
100
  };
143
101
 
144
- onSnapshot(snapshot: unknown) {
145
- console.log('snapshot', snapshot);
146
- }
147
-
148
- onFallback(state: unknown) {
149
- console.log('fallback', state);
150
- }
102
+ onSnapshot(snapshot: unknown): void {}
103
+ onFallback(state: unknown): void {}
151
104
  }
152
105
  ```
153
106
 
154
- ## Stable host contract
155
-
156
- `EditorialFormRuntimeComponent` exposes these stable inputs:
157
-
158
- - `solution`
159
- - `instance`
160
- - `runtimeContext`
161
- - `hostConfig`
162
-
163
- Stable outputs:
164
-
165
- - `snapshotChange`
166
- - `fallbackChange`
167
- - `operationalEvent`
168
-
169
- Recommended host usage:
170
-
171
- - use `snapshotChange` for resolved state, audit trails, and product UX derivation
172
- - use `fallbackChange` for operational UX decisions
173
- - use `operationalEvent` for technical telemetry, not as primary user-facing UI content
174
- - keep `runtimeContext` immutable from the host side; the runtime now emits refreshed state as blocks and adapters materialize `formData`
175
-
176
- ## Dynamic widget composition
177
-
178
- The runtime publishes `praxis-editorial-form-runtime` as dynamic widget metadata
179
- with these canonical component ports:
107
+ ## Stable Runtime Contract
180
108
 
181
109
  Inputs:
182
110
 
183
- - `solution`
184
- - `instance`
185
- - `runtimeContext`
186
- - `hostConfig`
111
+ - `solution`: canonical editorial solution definition.
112
+ - `instance`: host/runtime instance with journey, context and overrides.
113
+ - `runtimeContext`: host-provided context merged with instance context.
114
+ - `hostConfig`: runtime telemetry and adapter forwarding options.
187
115
 
188
116
  Outputs:
189
117
 
190
- - `snapshotChange`
191
- - `fallbackChange`
192
- - `operationalEvent`
118
+ - `snapshotChange`: resolved state for audit trails, product UX and host derivation.
119
+ - `fallbackChange`: operational fallback state: `normal`, `warning`, `degraded` or `blocked`.
120
+ - `operationalEvent`: technical telemetry for logs, monitoring and runbooks.
193
121
 
194
- Nested dynamic page links must target these ports through
195
- `composition.links` using `component-port` endpoints. When the editorial runtime
196
- is nested inside a container such as Tabs or Expansion, persist the nested child
197
- identity through `nestedPath` and keep the terminal segment as a widget segment
198
- with stable `key` and `componentType: "praxis-editorial-form-runtime"`.
122
+ Dynamic widget id: `praxis-editorial-form-runtime`. Use `composition.links` with `component-port` endpoints for canonical dynamic-page wiring; do not expose container-specific child ports as the final contract.
199
123
 
200
- Do not expose `widgetEvent`, `bindingPath`, host-specific aliases, or
201
- container-owned child-specific ports as the final contract for editorial runtime
202
- composition.
124
+ ## Presentation And I18n
203
125
 
204
- ## Presentation layer
126
+ The `solution.presentation` contract controls orientation, density, responsive behavior, shell spacing, theme tokens and stepper presentation. Unsupported accepted keys emit snapshot diagnostics instead of pretending runtime support.
205
127
 
206
- The runtime now supports an optional `presentation` contract inside the editorial `solution`.
207
-
208
- Current V1 coverage:
209
-
210
- - horizontal or vertical stepper
211
- - responsive collapse to mobile orientation through `layout.responsive.mobileOrientation`
212
- - density variants (`compact`, `comfortable`, `relaxed`)
213
- - theme tokens applied as CSS variables
214
- - shell max width and spacing overrides
215
- - visual step metadata (`kind`, `icon`, `visual`)
216
-
217
- Contractualized and currently effective in the renderer:
218
-
219
- - `presentation.layout.orientation`
220
- - `presentation.layout.density`
221
- - `presentation.layout.maxWidth`
222
- - `presentation.layout.spacing.pagePadding`
223
- - `presentation.layout.spacing.shellPadding`
224
- - `presentation.layout.spacing.blockGap`
225
- - `presentation.layout.spacing.sectionGap`
226
- - `presentation.layout.spacing.actionGap`
227
- - `presentation.layout.responsive.mobileOrientation`
228
- - `presentation.layout.responsive.collapseStepperBelow`
229
- - `presentation.layout.shellVariant`
230
- - `presentation.theme.*` tokens mapped in `buildRuntimeCssVars(...)`
231
- - `presentation.stepper.visible`
232
- - `presentation.stepper.orientation`
233
- - `presentation.stepper.showLabels`
234
- - `presentation.stepper.showDescriptions`
235
- - `presentation.stepper.showConnectors`
236
- - `presentation.stepper.connectorStyle`
237
- - `presentation.stepper.allowStepJump`
238
-
239
- Accepted by schema but currently diagnosed as unsupported:
240
-
241
- - `presentation.layout.contentAlign`
242
- - `presentation.layout.responsive.tabletOrientation`
243
- - `presentation.stepper.size`
244
- - `presentation.stepper.align`
245
- - `presentation.stepper.variant` values without distinct renderer behavior from `icon-label`
246
-
247
- Important note:
248
-
249
- - when these unsupported keys are present, the runtime emits `presentation-config-unsupported` diagnostics in the snapshot instead of silently pretending support
250
-
251
- Current V1 presentational blocks:
252
-
253
- - `introHero`
254
- - `selectionCards`
255
- - `reviewSections`
256
- - `successPanel`
257
-
258
- Important note for hosts:
259
-
260
- - `selectionCards` and `dataCollection` now feed the same runtime context shape through immutable `runtimeContextChange` emissions
261
- - review blocks should consume `snapshot.context.formData` paths to stay consistent with the canonical runtime state
262
- - internal runtime copy now resolves through `PraxisI18nService`; the package exports `providePraxisEditorialFormsI18n(...)` with built-in `pt-BR` and `en-US` dictionaries
263
- - `reviewSections` now supports `EditorialReviewSectionField.format` for `date`, `phone`, `email`, `boolean` and `list`, while preserving plain text fallback when `format` is omitted
264
-
265
- If your host wants to override or extend the built-in runtime copy, register the package i18n provider:
128
+ Register i18n overrides with:
266
129
 
267
130
  ```ts
268
131
  import { providePraxisEditorialFormsI18n } from '@praxisui/editorial-forms';
269
132
 
270
- export const appConfig = {
271
- providers: [
272
- providePraxisEditorialFormsI18n({
273
- locale: 'en-US',
274
- dictionaries: {
275
- 'en-US': {
276
- 'praxis.editorialForms.runtime.actions.next': 'Continue',
277
- },
133
+ providers: [
134
+ providePraxisEditorialFormsI18n({
135
+ locale: 'en-US',
136
+ dictionaries: {
137
+ 'en-US': {
138
+ 'praxis.editorialForms.runtime.actions.next': 'Continue',
278
139
  },
279
- }),
280
- ],
281
- };
140
+ },
141
+ }),
142
+ ];
282
143
  ```
283
144
 
284
- ## Optional `dataCollection` adapter
145
+ ## Optional Dynamic Form Adapter
285
146
 
286
- The core runtime does not hardwire `@praxisui/dynamic-form`.
287
-
288
- If your host wants to render `dataCollection` blocks with Praxis Dynamic Form, register the optional adapter:
289
-
290
- ```ts
291
- import { provideEditorialDynamicFormAdapter } from '@praxisui/editorial-forms';
292
- import { PraxisDynamicForm } from '@praxisui/dynamic-form';
293
-
294
- export const appConfig = {
295
- providers: [
296
- provideEditorialDynamicFormAdapter({ component: PraxisDynamicForm }),
297
- ],
298
- };
299
- ```
300
-
301
- Important host contract:
302
-
303
- - the editorial adapter only registers the `dataCollection` renderer; it does not provide `GenericCrudService`
304
- - if your editorial flow materializes remote `@praxisui/dynamic-form` behavior, the host still owns the same DI contract documented for `praxis-dynamic-form`
305
- - when the effective form depends on remote schema, `resourcePath`, remote submit, or inherited `endpointKey`, provide `GenericCrudService` in the host scope that renders the runtime and configure that same instance before the form materializes
306
-
307
- Minimal host example:
147
+ The core editorial runtime does not hardwire `@praxisui/dynamic-form`. Register the optional adapter when `dataCollection` blocks should materialize Praxis Dynamic Form.
308
148
 
309
149
  ```ts
310
150
  import { GenericCrudService } from '@praxisui/core';
@@ -319,106 +159,20 @@ export const appConfig = {
319
159
  };
320
160
  ```
321
161
 
322
- Without this provider, `dataCollection` blocks degrade to an accessible fallback and the runtime keeps exposing the missing-adapter state through snapshot diagnostics and operational events.
323
-
324
- ## Public API highlights
325
-
326
- - `EditorialFormRuntimeComponent`
327
- - `PRAXIS_EDITORIAL_FORMS_AUTHORING_MANIFEST`
328
- - `resolveEditorialRuntimeSnapshot(...)`
329
- - `EditorialDataBlockAdapter`
330
- - `EDITORIAL_DATA_BLOCK_ADAPTER`
331
- - `provideEditorialDataBlockAdapter(...)`
332
- - `createEditorialDynamicFormAdapter(...)`
333
- - `provideEditorialDynamicFormAdapter(...)`
334
-
335
- Runtime model types:
336
-
337
- - `EditorialRuntimeInput`
338
- - `EditorialRuntimeHostConfig`
339
- - `EditorialRuntimeSnapshot`
340
- - `EditorialResolvedJourney`
341
- - `EditorialResolvedStep`
342
- - `EditorialResolvedBlock`
343
- - `EditorialRuntimeDiagnostic`
344
- - `EditorialRuntimeOperationalEvent`
345
-
346
- Presentation model types from `@praxisui/core`:
347
-
348
- - `EditorialWizardPresentation`
349
- - `EditorialLayoutConfig`
350
- - `EditorialThemeTokens`
351
- - `EditorialStepperConfig`
352
- - `EditorialStepVisualConfig`
353
-
354
- ## Agentic authoring contract
355
-
356
- `PRAXIS_EDITORIAL_FORMS_AUTHORING_MANIFEST` is the executable AI authoring contract for this package.
357
-
358
- The manifest governs editorial document orchestration:
359
-
360
- - `snapshot.set`
361
- - `fallback.configure`
362
- - `presentation.configure`
363
- - `adapter.bind`
364
- - `dataBlock.add`
365
- - `dataBlock.remove`
366
- - `fieldBinding.set`
367
-
368
- Boundary rules:
369
-
370
- - `solution`, `instance` and `runtimeContext` resolve into `EditorialRuntimeSnapshot` without hidden drift
371
- - `fallback` must be explicit and backed by diagnostics
372
- - `presentation` only changes `solution.presentation`; it must not mutate domain data
373
- - `dataCollection` blocks require a registered adapter that supports the requested context
374
- - `dataBlock` authoring uses canonical `blockId` and `kind`; `id` and `type` are not accepted aliases
375
- - `snapshot.set` updates canonical runtime inputs (`solution`, `instance.context`, and `runtimeContext`) and does not persist active journey state as `instance.journeyId`
376
- - `FieldMetadata` shape changes are delegated to `@praxisui/metadata-editor` and dynamic-fields discovery instead of being redefined here
377
-
378
- ## Resolution and fallback behavior
379
-
380
- The resolved snapshot formalizes:
381
-
382
- - deterministic block provenance with `primarySource` and `trail`
383
- - instance override policy with `append`, `insertBefore`, `insertAfter`, `replace`, and `remove`
384
- - resolved `dataCollectionState` before the concrete form engine renders
385
-
386
- Current `dataCollection` config resolution order:
387
-
388
- 1. `block.formConfig`
389
- 2. `instance.overrides.runtimeFormConfigs`
390
- 3. `instance.compatibilityFormConfigs`
391
-
392
- Fallback states:
393
-
394
- - `normal`
395
- - `warning`
396
- - `degraded`
397
- - `blocked`
398
-
399
- ## Architecture rule
400
-
401
- Allowed:
402
-
403
- - `@praxisui/editorial-forms -> @praxisui/core`
404
- - `@praxisui/editorial-forms -> @praxisui/dynamic-form` only through optional adapter/provider integration
162
+ The adapter registers the renderer only. The host still owns `GenericCrudService`, endpoint configuration, remote schema access and submit behavior required by dynamic forms.
405
163
 
406
- Avoid:
164
+ Without the adapter, `dataCollection` blocks render accessible fallback content and expose diagnostics through snapshots and operational events.
407
165
 
408
- - `@praxisui/core -> @praxisui/editorial-forms`
409
- - moving editorial domain growth back into `@praxisui/dynamic-form`
166
+ ## Authoring
410
167
 
411
- ## Validation status
168
+ `PRAXIS_EDITORIAL_FORMS_AUTHORING_MANIFEST` governs AI/tooling operations for snapshots, fallback, presentation, adapter binding, data block add/remove and field binding. `FieldMetadata` shape changes are delegated to `@praxisui/metadata-editor` and dynamic-fields discovery instead of being redefined by this package.
412
169
 
413
- The package is covered by:
170
+ ## Public API Snapshot
414
171
 
415
- - unit specs for runtime resolution and component behavior
416
- - controlled host specs for real Angular integration
417
- - end-to-end validation of editorial runtime flows in host routes
172
+ Main exports include `EditorialFormRuntimeComponent`, `providePraxisEditorialForms`, runtime contracts, snapshot/fallback/event models, preset resolution helpers, optional data-block adapter APIs, dynamic-form adapter APIs, renderer components, i18n helpers, testing fixtures and `PRAXIS_EDITORIAL_FORMS_AUTHORING_MANIFEST`.
418
173
 
419
- ## More reading
174
+ ## Official Links
420
175
 
421
- - Architecture: https://github.com/codexrodrigues/praxis-ui-angular/blob/main/projects/praxis-editorial-forms/docs/architecture.md
422
- - Continuation plan: https://github.com/codexrodrigues/praxis-ui-angular/blob/main/projects/praxis-editorial-forms/docs/continuation-plan.md
423
- - Authoring plan: https://github.com/codexrodrigues/praxis-ui-angular/blob/main/projects/praxis-editorial-forms/docs/editorial-authoring-plan.md
424
- - Recovery playbook: https://github.com/codexrodrigues/praxis-ui-angular/blob/main/projects/praxis-editorial-forms/docs/recovery-playbook.md
176
+ - Documentation: https://praxisui.dev/docs/components
177
+ - Live demo: https://praxis-ui-4e602.web.app
178
+ - Quickstart app: https://github.com/codexrodrigues/praxis-ui-quickstart
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@praxisui/editorial-forms",
3
- "version": "9.0.0-beta.1",
3
+ "version": "9.0.0-beta.3",
4
4
  "description": "Editorial form runtime for Praxis UI: journeys, presets, semantic blocks, and specialist hosting for editorial experiences.",
5
5
  "peerDependencies": {
6
6
  "@angular/common": "^21.0.0",
7
7
  "@angular/core": "^21.0.0",
8
- "@praxisui/core": "^9.0.0-beta.1",
8
+ "@praxisui/core": "^9.0.0-beta.3",
9
9
  "@angular/material": "^21.0.0"
10
10
  },
11
11
  "dependencies": {
@@ -15,14 +15,7 @@
15
15
  "publishConfig": {
16
16
  "access": "public"
17
17
  },
18
- "repository": {
19
- "type": "git",
20
- "url": "https://github.com/codexrodrigues/praxis-ui-angular"
21
- },
22
- "homepage": "https://praxisui.dev",
23
- "bugs": {
24
- "url": "https://github.com/codexrodrigues/praxis-ui-angular/issues"
25
- },
18
+ "homepage": "https://praxisui.dev/docs/components",
26
19
  "keywords": [
27
20
  "angular",
28
21
  "praxisui",