@praxisui/editorial-forms 8.0.0-beta.2 → 8.0.0-beta.20
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 +87 -6
- package/fesm2022/praxisui-editorial-forms.mjs +519 -15
- package/index.d.ts +12 -7
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -40,6 +40,31 @@ Optional integration:
|
|
|
40
40
|
|
|
41
41
|
- `@praxisui/dynamic-form` if your `dataCollection` blocks should render real forms instead of fallback content
|
|
42
42
|
|
|
43
|
+
## App provider
|
|
44
|
+
|
|
45
|
+
Register the package provider in hosts that render the runtime through dynamic
|
|
46
|
+
widget composition, including `@praxisui/core` dynamic pages, page-builder
|
|
47
|
+
previews, examples, recipes and labs:
|
|
48
|
+
|
|
49
|
+
```ts
|
|
50
|
+
import { providePraxisEditorialForms } from '@praxisui/editorial-forms';
|
|
51
|
+
|
|
52
|
+
export const appConfig = {
|
|
53
|
+
providers: [
|
|
54
|
+
providePraxisEditorialForms(),
|
|
55
|
+
],
|
|
56
|
+
};
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
`providePraxisEditorialForms()` registers the package dynamic widget metadata for
|
|
60
|
+
`praxis-editorial-form-runtime`. It does not register the optional
|
|
61
|
+
`@praxisui/dynamic-form` adapter and does not create a global singleton runtime
|
|
62
|
+
graph.
|
|
63
|
+
|
|
64
|
+
Without this provider, hosts may still use `EditorialFormRuntimeComponent`
|
|
65
|
+
directly through a standalone import, but `DynamicWidgetLoader` cannot discover
|
|
66
|
+
`praxis-editorial-form-runtime` from a JSON page definition.
|
|
67
|
+
|
|
43
68
|
## Core concepts
|
|
44
69
|
|
|
45
70
|
- `solution`: canonical editorial definition
|
|
@@ -78,18 +103,21 @@ import {
|
|
|
78
103
|
export class EditorialRuntimeDemoComponent {
|
|
79
104
|
solution: EditorialRuntimeInput['solution'] = {
|
|
80
105
|
solutionId: 'privacy-consent',
|
|
106
|
+
version: '1.0.0',
|
|
107
|
+
problemType: 'generic',
|
|
108
|
+
title: 'Privacy consent',
|
|
81
109
|
journeys: [
|
|
82
110
|
{
|
|
83
|
-
|
|
84
|
-
|
|
111
|
+
journeyId: 'privacy-consent-journey',
|
|
112
|
+
label: 'Privacy consent',
|
|
85
113
|
steps: [
|
|
86
114
|
{
|
|
87
|
-
|
|
88
|
-
|
|
115
|
+
stepId: 'review',
|
|
116
|
+
label: 'Review and confirm',
|
|
89
117
|
blocks: [
|
|
90
118
|
{
|
|
91
|
-
|
|
92
|
-
|
|
119
|
+
blockId: 'consent-form',
|
|
120
|
+
kind: 'dataCollection',
|
|
93
121
|
formBlockId: 'consent-form',
|
|
94
122
|
},
|
|
95
123
|
],
|
|
@@ -144,6 +172,34 @@ Recommended host usage:
|
|
|
144
172
|
- use `operationalEvent` for technical telemetry, not as primary user-facing UI content
|
|
145
173
|
- keep `runtimeContext` immutable from the host side; the runtime now emits refreshed state as blocks and adapters materialize `formData`
|
|
146
174
|
|
|
175
|
+
## Dynamic widget composition
|
|
176
|
+
|
|
177
|
+
The runtime publishes `praxis-editorial-form-runtime` as dynamic widget metadata
|
|
178
|
+
with these canonical component ports:
|
|
179
|
+
|
|
180
|
+
Inputs:
|
|
181
|
+
|
|
182
|
+
- `solution`
|
|
183
|
+
- `instance`
|
|
184
|
+
- `runtimeContext`
|
|
185
|
+
- `hostConfig`
|
|
186
|
+
|
|
187
|
+
Outputs:
|
|
188
|
+
|
|
189
|
+
- `snapshotChange`
|
|
190
|
+
- `fallbackChange`
|
|
191
|
+
- `operationalEvent`
|
|
192
|
+
|
|
193
|
+
Nested dynamic page links must target these ports through
|
|
194
|
+
`composition.links` using `component-port` endpoints. When the editorial runtime
|
|
195
|
+
is nested inside a container such as Tabs or Expansion, persist the nested child
|
|
196
|
+
identity through `nestedPath` and keep the terminal segment as a widget segment
|
|
197
|
+
with stable `key` and `componentType: "praxis-editorial-form-runtime"`.
|
|
198
|
+
|
|
199
|
+
Do not expose `widgetEvent`, `bindingPath`, host-specific aliases, or
|
|
200
|
+
container-owned child-specific ports as the final contract for editorial runtime
|
|
201
|
+
composition.
|
|
202
|
+
|
|
147
203
|
## Presentation layer
|
|
148
204
|
|
|
149
205
|
The runtime now supports an optional `presentation` contract inside the editorial `solution`.
|
|
@@ -267,6 +323,7 @@ Without this provider, `dataCollection` blocks degrade to an accessible fallback
|
|
|
267
323
|
## Public API highlights
|
|
268
324
|
|
|
269
325
|
- `EditorialFormRuntimeComponent`
|
|
326
|
+
- `PRAXIS_EDITORIAL_FORMS_AUTHORING_MANIFEST`
|
|
270
327
|
- `resolveEditorialRuntimeSnapshot(...)`
|
|
271
328
|
- `EditorialDataBlockAdapter`
|
|
272
329
|
- `EDITORIAL_DATA_BLOCK_ADAPTER`
|
|
@@ -293,6 +350,30 @@ Presentation model types from `@praxisui/core`:
|
|
|
293
350
|
- `EditorialStepperConfig`
|
|
294
351
|
- `EditorialStepVisualConfig`
|
|
295
352
|
|
|
353
|
+
## Agentic authoring contract
|
|
354
|
+
|
|
355
|
+
`PRAXIS_EDITORIAL_FORMS_AUTHORING_MANIFEST` is the executable AI authoring contract for this package.
|
|
356
|
+
|
|
357
|
+
The manifest governs editorial document orchestration:
|
|
358
|
+
|
|
359
|
+
- `snapshot.set`
|
|
360
|
+
- `fallback.configure`
|
|
361
|
+
- `presentation.configure`
|
|
362
|
+
- `adapter.bind`
|
|
363
|
+
- `dataBlock.add`
|
|
364
|
+
- `dataBlock.remove`
|
|
365
|
+
- `fieldBinding.set`
|
|
366
|
+
|
|
367
|
+
Boundary rules:
|
|
368
|
+
|
|
369
|
+
- `solution`, `instance` and `runtimeContext` resolve into `EditorialRuntimeSnapshot` without hidden drift
|
|
370
|
+
- `fallback` must be explicit and backed by diagnostics
|
|
371
|
+
- `presentation` only changes `solution.presentation`; it must not mutate domain data
|
|
372
|
+
- `dataCollection` blocks require a registered adapter that supports the requested context
|
|
373
|
+
- `dataBlock` authoring uses canonical `blockId` and `kind`; `id` and `type` are not accepted aliases
|
|
374
|
+
- `snapshot.set` updates canonical runtime inputs (`solution`, `instance.context`, and `runtimeContext`) and does not persist active journey state as `instance.journeyId`
|
|
375
|
+
- `FieldMetadata` shape changes are delegated to `@praxisui/metadata-editor` and dynamic-fields discovery instead of being redefined here
|
|
376
|
+
|
|
296
377
|
## Resolution and fallback behavior
|
|
297
378
|
|
|
298
379
|
The resolved snapshot formalizes:
|
|
@@ -1,22 +1,10 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import {
|
|
2
|
+
import { InjectionToken, makeEnvironmentProviders, inject, DestroyRef, viewChild, ViewContainerRef, input, output, signal, computed, effect, ChangeDetectionStrategy, Component, ENVIRONMENT_INITIALIZER, reflectComponentType, Input } from '@angular/core';
|
|
3
|
+
import { PraxisI18nService, PraxisIconDirective, DynamicWidgetLoaderDirective, ComponentMetadataRegistry, providePraxisI18n } from '@praxisui/core';
|
|
3
4
|
import { CommonModule } from '@angular/common';
|
|
4
|
-
import { PraxisI18nService, PraxisIconDirective, DynamicWidgetLoaderDirective, providePraxisI18n } from '@praxisui/core';
|
|
5
5
|
import * as i1 from '@angular/material/icon';
|
|
6
6
|
import { MatIconModule } from '@angular/material/icon';
|
|
7
7
|
|
|
8
|
-
/**
|
|
9
|
-
* Root provider entrypoint for the editorial runtime package.
|
|
10
|
-
*
|
|
11
|
-
* Intentionally minimal in v1:
|
|
12
|
-
* - no global singleton graph yet
|
|
13
|
-
* - no dependency on @praxisui/dynamic-form
|
|
14
|
-
* - safe to consume from apps without pulling generic form authoring
|
|
15
|
-
*/
|
|
16
|
-
function providePraxisEditorialForms() {
|
|
17
|
-
return makeEnvironmentProviders([]);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
8
|
const DEFAULT_EDITORIAL_RUNTIME_HOST_CONFIG = {
|
|
21
9
|
emitOperationalEvents: true,
|
|
22
10
|
forwardAdapterOperationalEvents: true,
|
|
@@ -3775,6 +3763,522 @@ function formatScopeLabel(labelName, label, id) {
|
|
|
3775
3763
|
return null;
|
|
3776
3764
|
}
|
|
3777
3765
|
|
|
3766
|
+
const EDITORIAL_FORM_RUNTIME_PORTS = [
|
|
3767
|
+
{
|
|
3768
|
+
id: 'solution',
|
|
3769
|
+
label: 'Editorial solution',
|
|
3770
|
+
direction: 'input',
|
|
3771
|
+
semanticKind: 'config-fragment',
|
|
3772
|
+
schema: {
|
|
3773
|
+
id: 'EditorialSolutionDefinition',
|
|
3774
|
+
kind: 'ts-type',
|
|
3775
|
+
ref: 'EditorialSolutionDefinition',
|
|
3776
|
+
},
|
|
3777
|
+
description: 'Canonical editorial solution definition consumed by the runtime.',
|
|
3778
|
+
exposure: { public: true, group: 'config' },
|
|
3779
|
+
},
|
|
3780
|
+
{
|
|
3781
|
+
id: 'instance',
|
|
3782
|
+
label: 'Editorial instance',
|
|
3783
|
+
direction: 'input',
|
|
3784
|
+
semanticKind: 'config-fragment',
|
|
3785
|
+
schema: {
|
|
3786
|
+
id: 'EditorialTemplateInstance',
|
|
3787
|
+
kind: 'ts-type',
|
|
3788
|
+
ref: 'EditorialTemplateInstance',
|
|
3789
|
+
},
|
|
3790
|
+
description: 'Runtime instance with persisted context, overrides and selected template reference.',
|
|
3791
|
+
exposure: { public: true, group: 'config' },
|
|
3792
|
+
},
|
|
3793
|
+
{
|
|
3794
|
+
id: 'runtimeContext',
|
|
3795
|
+
label: 'Runtime context',
|
|
3796
|
+
direction: 'input',
|
|
3797
|
+
semanticKind: 'view-context',
|
|
3798
|
+
schema: {
|
|
3799
|
+
id: 'Record<string, unknown>',
|
|
3800
|
+
kind: 'ts-type',
|
|
3801
|
+
ref: 'Record<string, unknown>',
|
|
3802
|
+
},
|
|
3803
|
+
description: 'Host-provided context merged with the editorial instance context.',
|
|
3804
|
+
exposure: { public: true, group: 'context' },
|
|
3805
|
+
},
|
|
3806
|
+
{
|
|
3807
|
+
id: 'snapshotChange',
|
|
3808
|
+
label: 'Snapshot change',
|
|
3809
|
+
direction: 'output',
|
|
3810
|
+
semanticKind: 'event',
|
|
3811
|
+
cardinality: 'stream',
|
|
3812
|
+
schema: {
|
|
3813
|
+
id: 'EditorialRuntimeSnapshot',
|
|
3814
|
+
kind: 'ts-type',
|
|
3815
|
+
ref: 'EditorialRuntimeSnapshot',
|
|
3816
|
+
},
|
|
3817
|
+
description: 'Resolved editorial runtime snapshot emitted when solution, instance or context changes.',
|
|
3818
|
+
exposure: { public: true, group: 'events' },
|
|
3819
|
+
},
|
|
3820
|
+
{
|
|
3821
|
+
id: 'fallbackChange',
|
|
3822
|
+
label: 'Fallback change',
|
|
3823
|
+
direction: 'output',
|
|
3824
|
+
semanticKind: 'status',
|
|
3825
|
+
cardinality: 'stream',
|
|
3826
|
+
schema: {
|
|
3827
|
+
id: 'EditorialRuntimeFallbackState',
|
|
3828
|
+
kind: 'ts-type',
|
|
3829
|
+
ref: 'EditorialRuntimeFallbackState',
|
|
3830
|
+
},
|
|
3831
|
+
description: 'Operational fallback state emitted when diagnostics affect runtime health.',
|
|
3832
|
+
exposure: { public: true, group: 'status' },
|
|
3833
|
+
},
|
|
3834
|
+
{
|
|
3835
|
+
id: 'operationalEvent',
|
|
3836
|
+
label: 'Operational event',
|
|
3837
|
+
direction: 'output',
|
|
3838
|
+
semanticKind: 'diagnostic',
|
|
3839
|
+
cardinality: 'stream',
|
|
3840
|
+
schema: {
|
|
3841
|
+
id: 'EditorialRuntimeOperationalEvent',
|
|
3842
|
+
kind: 'ts-type',
|
|
3843
|
+
ref: 'EditorialRuntimeOperationalEvent',
|
|
3844
|
+
},
|
|
3845
|
+
description: 'Technical event stream for diagnostics, blocking errors and adapter state.',
|
|
3846
|
+
exposure: { public: true, advanced: true, group: 'diagnostics' },
|
|
3847
|
+
},
|
|
3848
|
+
];
|
|
3849
|
+
const EDITORIAL_FORM_RUNTIME_COMPONENT_METADATA = {
|
|
3850
|
+
id: 'praxis-editorial-form-runtime',
|
|
3851
|
+
componentType: 'praxis-editorial-form-runtime',
|
|
3852
|
+
selector: 'praxis-editorial-form-runtime',
|
|
3853
|
+
component: EditorialFormRuntimeComponent,
|
|
3854
|
+
friendlyName: 'Praxis Editorial Form Runtime',
|
|
3855
|
+
displayName: 'Praxis Editorial Form Runtime',
|
|
3856
|
+
description: 'Guided editorial runtime for solution and instance driven form experiences.',
|
|
3857
|
+
icon: 'article',
|
|
3858
|
+
lib: '@praxisui/editorial-forms',
|
|
3859
|
+
tags: ['widget', 'editorial', 'forms', 'runtime', 'guided-flow'],
|
|
3860
|
+
inputs: [
|
|
3861
|
+
{
|
|
3862
|
+
name: 'solution',
|
|
3863
|
+
type: 'EditorialSolutionDefinition | null',
|
|
3864
|
+
description: 'Canonical editorial solution definition.',
|
|
3865
|
+
},
|
|
3866
|
+
{
|
|
3867
|
+
name: 'instance',
|
|
3868
|
+
type: 'EditorialTemplateInstance | null',
|
|
3869
|
+
description: 'Editorial instance with context and overrides.',
|
|
3870
|
+
},
|
|
3871
|
+
{
|
|
3872
|
+
name: 'runtimeContext',
|
|
3873
|
+
type: 'Record<string, unknown> | null',
|
|
3874
|
+
description: 'Host context merged into the resolved runtime context.',
|
|
3875
|
+
},
|
|
3876
|
+
{
|
|
3877
|
+
name: 'hostConfig',
|
|
3878
|
+
type: 'EditorialRuntimeHostConfig | null',
|
|
3879
|
+
description: 'Host controls for operational event forwarding.',
|
|
3880
|
+
},
|
|
3881
|
+
],
|
|
3882
|
+
outputs: [
|
|
3883
|
+
{
|
|
3884
|
+
name: 'snapshotChange',
|
|
3885
|
+
type: 'EditorialRuntimeSnapshot',
|
|
3886
|
+
description: 'Resolved snapshot emitted by the editorial runtime.',
|
|
3887
|
+
},
|
|
3888
|
+
{
|
|
3889
|
+
name: 'fallbackChange',
|
|
3890
|
+
type: 'EditorialRuntimeFallbackState',
|
|
3891
|
+
description: 'Fallback state emitted when diagnostics affect runtime health.',
|
|
3892
|
+
},
|
|
3893
|
+
{
|
|
3894
|
+
name: 'operationalEvent',
|
|
3895
|
+
type: 'EditorialRuntimeOperationalEvent',
|
|
3896
|
+
description: 'Operational diagnostics event stream.',
|
|
3897
|
+
},
|
|
3898
|
+
],
|
|
3899
|
+
ports: EDITORIAL_FORM_RUNTIME_PORTS,
|
|
3900
|
+
layoutHints: {
|
|
3901
|
+
recommendedCols: 6,
|
|
3902
|
+
recommendedRows: 6,
|
|
3903
|
+
minCols: 4,
|
|
3904
|
+
minRows: 4,
|
|
3905
|
+
},
|
|
3906
|
+
};
|
|
3907
|
+
function providePraxisEditorialFormRuntimeMetadata() {
|
|
3908
|
+
return {
|
|
3909
|
+
provide: ENVIRONMENT_INITIALIZER,
|
|
3910
|
+
multi: true,
|
|
3911
|
+
useFactory: (registry) => () => {
|
|
3912
|
+
registry.register(EDITORIAL_FORM_RUNTIME_COMPONENT_METADATA);
|
|
3913
|
+
},
|
|
3914
|
+
deps: [ComponentMetadataRegistry],
|
|
3915
|
+
};
|
|
3916
|
+
}
|
|
3917
|
+
|
|
3918
|
+
/**
|
|
3919
|
+
* Root provider entrypoint for the editorial runtime package.
|
|
3920
|
+
*
|
|
3921
|
+
* Registers the public DynamicWidgetLoader metadata for
|
|
3922
|
+
* praxis-editorial-form-runtime in ComponentMetadataRegistry. This is the
|
|
3923
|
+
* canonical setup hook for hosts that render editorial forms through dynamic
|
|
3924
|
+
* composition; it does not introduce a separate global runtime singleton graph.
|
|
3925
|
+
*/
|
|
3926
|
+
function providePraxisEditorialForms() {
|
|
3927
|
+
return makeEnvironmentProviders([
|
|
3928
|
+
providePraxisEditorialFormRuntimeMetadata(),
|
|
3929
|
+
]);
|
|
3930
|
+
}
|
|
3931
|
+
|
|
3932
|
+
const snapshotSetSchema = {
|
|
3933
|
+
type: 'object',
|
|
3934
|
+
required: ['solutionId'],
|
|
3935
|
+
properties: {
|
|
3936
|
+
solutionId: { type: 'string' },
|
|
3937
|
+
instanceId: { type: 'string' },
|
|
3938
|
+
journeyId: { type: 'string' },
|
|
3939
|
+
stepId: { type: 'string' },
|
|
3940
|
+
runtimeContextPatch: { type: 'object' },
|
|
3941
|
+
instanceContextPatch: { type: 'object' },
|
|
3942
|
+
preserveDiagnostics: { type: 'boolean' },
|
|
3943
|
+
},
|
|
3944
|
+
};
|
|
3945
|
+
const fallbackConfigureSchema = {
|
|
3946
|
+
type: 'object',
|
|
3947
|
+
required: ['mode'],
|
|
3948
|
+
properties: {
|
|
3949
|
+
mode: { enum: ['normal', 'warning', 'degraded', 'blocked'] },
|
|
3950
|
+
diagnosticCode: { type: 'string' },
|
|
3951
|
+
progressionBlocked: { type: 'boolean' },
|
|
3952
|
+
requiresEngineAttention: { type: 'boolean' },
|
|
3953
|
+
scope: {
|
|
3954
|
+
type: 'object',
|
|
3955
|
+
properties: {
|
|
3956
|
+
journeyId: { type: 'string' },
|
|
3957
|
+
stepId: { type: 'string' },
|
|
3958
|
+
blockId: { type: 'string' },
|
|
3959
|
+
},
|
|
3960
|
+
},
|
|
3961
|
+
},
|
|
3962
|
+
};
|
|
3963
|
+
const presentationConfigureSchema = {
|
|
3964
|
+
type: 'object',
|
|
3965
|
+
minProperties: 1,
|
|
3966
|
+
properties: {
|
|
3967
|
+
layout: {
|
|
3968
|
+
type: 'object',
|
|
3969
|
+
properties: {
|
|
3970
|
+
orientation: { enum: ['horizontal', 'vertical'] },
|
|
3971
|
+
density: { enum: ['compact', 'comfortable', 'relaxed'] },
|
|
3972
|
+
maxWidth: { type: 'string' },
|
|
3973
|
+
shellVariant: { type: 'string' },
|
|
3974
|
+
spacing: { type: 'object' },
|
|
3975
|
+
responsive: { type: 'object' },
|
|
3976
|
+
},
|
|
3977
|
+
},
|
|
3978
|
+
theme: { type: 'object' },
|
|
3979
|
+
stepper: {
|
|
3980
|
+
type: 'object',
|
|
3981
|
+
properties: {
|
|
3982
|
+
visible: { type: 'boolean' },
|
|
3983
|
+
orientation: { enum: ['horizontal', 'vertical'] },
|
|
3984
|
+
showLabels: { type: 'boolean' },
|
|
3985
|
+
showDescriptions: { type: 'boolean' },
|
|
3986
|
+
showConnectors: { type: 'boolean' },
|
|
3987
|
+
connectorStyle: { type: 'string' },
|
|
3988
|
+
allowStepJump: { type: 'boolean' },
|
|
3989
|
+
},
|
|
3990
|
+
},
|
|
3991
|
+
},
|
|
3992
|
+
};
|
|
3993
|
+
const adapterBindSchema = {
|
|
3994
|
+
type: 'object',
|
|
3995
|
+
required: ['adapterId', 'dataBlockType'],
|
|
3996
|
+
properties: {
|
|
3997
|
+
adapterId: { type: 'string' },
|
|
3998
|
+
dataBlockType: { enum: ['dataCollection'] },
|
|
3999
|
+
componentRef: { type: 'string' },
|
|
4000
|
+
requiredInputs: {
|
|
4001
|
+
type: 'array',
|
|
4002
|
+
items: { type: 'string' },
|
|
4003
|
+
},
|
|
4004
|
+
forwardOperationalEvents: { type: 'boolean' },
|
|
4005
|
+
fallbackModeWhenMissing: { enum: ['warning', 'degraded', 'blocked'] },
|
|
4006
|
+
},
|
|
4007
|
+
};
|
|
4008
|
+
const dataBlockAddSchema = {
|
|
4009
|
+
type: 'object',
|
|
4010
|
+
required: ['journeyId', 'stepId', 'block'],
|
|
4011
|
+
properties: {
|
|
4012
|
+
journeyId: { type: 'string' },
|
|
4013
|
+
stepId: { type: 'string' },
|
|
4014
|
+
insert: {
|
|
4015
|
+
type: 'object',
|
|
4016
|
+
properties: {
|
|
4017
|
+
mode: { enum: ['append', 'insertBefore', 'insertAfter'] },
|
|
4018
|
+
relativeToBlockId: { type: 'string' },
|
|
4019
|
+
},
|
|
4020
|
+
},
|
|
4021
|
+
block: {
|
|
4022
|
+
type: 'object',
|
|
4023
|
+
required: ['blockId', 'kind'],
|
|
4024
|
+
properties: {
|
|
4025
|
+
blockId: { type: 'string' },
|
|
4026
|
+
kind: { enum: ['dataCollection', 'introHero', 'selectionCards', 'reviewSections', 'successPanel'] },
|
|
4027
|
+
formBlockId: { type: 'string' },
|
|
4028
|
+
formConfigRef: { type: 'string' },
|
|
4029
|
+
title: { type: 'string' },
|
|
4030
|
+
description: { type: 'string' },
|
|
4031
|
+
visibility: { type: 'array' },
|
|
4032
|
+
},
|
|
4033
|
+
},
|
|
4034
|
+
},
|
|
4035
|
+
};
|
|
4036
|
+
const dataBlockRemoveSchema = {
|
|
4037
|
+
type: 'object',
|
|
4038
|
+
required: ['journeyId', 'stepId', 'blockId'],
|
|
4039
|
+
properties: {
|
|
4040
|
+
journeyId: { type: 'string' },
|
|
4041
|
+
stepId: { type: 'string' },
|
|
4042
|
+
blockId: { type: 'string' },
|
|
4043
|
+
requireNoFieldBindings: { type: 'boolean' },
|
|
4044
|
+
},
|
|
4045
|
+
};
|
|
4046
|
+
const fieldBindingSetSchema = {
|
|
4047
|
+
type: 'object',
|
|
4048
|
+
required: ['blockId', 'fieldName', 'contextPath'],
|
|
4049
|
+
properties: {
|
|
4050
|
+
blockId: { type: 'string' },
|
|
4051
|
+
fieldName: { type: 'string' },
|
|
4052
|
+
contextPath: { type: 'string' },
|
|
4053
|
+
mode: { enum: ['read', 'write', 'readWrite'] },
|
|
4054
|
+
valueMode: { enum: ['merge', 'replace'] },
|
|
4055
|
+
delegateFieldMetadataTo: { enum: ['praxis-metadata-editor'] },
|
|
4056
|
+
},
|
|
4057
|
+
};
|
|
4058
|
+
const PRAXIS_EDITORIAL_FORMS_AUTHORING_MANIFEST = {
|
|
4059
|
+
schemaVersion: '1.0.0',
|
|
4060
|
+
componentId: 'praxis-editorial-forms',
|
|
4061
|
+
ownerPackage: '@praxisui/editorial-forms',
|
|
4062
|
+
configSchemaId: 'EditorialRuntimeInput',
|
|
4063
|
+
manifestVersion: '1.0.0',
|
|
4064
|
+
runtimeInputs: [
|
|
4065
|
+
{ name: 'solution', type: 'EditorialSolutionDefinition | null', description: 'Canonical editorial solution definition with journeys, steps, blocks and presentation.' },
|
|
4066
|
+
{ name: 'instance', type: 'EditorialTemplateInstance | null', description: 'Runtime instance with selected journey, context, overrides and compatibility form configs.' },
|
|
4067
|
+
{ name: 'runtimeContext', type: 'Record<string, unknown> | null', description: 'Host-provided immutable context merged into the resolved editorial snapshot.' },
|
|
4068
|
+
{ name: 'hostConfig', type: 'EditorialRuntimeHostConfig | null', description: 'Host controls for operational event and adapter event forwarding.' },
|
|
4069
|
+
{ name: 'snapshotChange', type: 'EditorialRuntimeSnapshot', description: 'Resolved runtime snapshot emitted to hosts for product UX and audit derivation.' },
|
|
4070
|
+
{ name: 'fallbackChange', type: 'EditorialRuntimeFallbackState', description: 'Operational fallback state emitted when diagnostics affect runtime health.' },
|
|
4071
|
+
{ name: 'operationalEvent', type: 'EditorialRuntimeOperationalEvent', description: 'Technical diagnostics event stream for logs, monitoring and runbooks.' },
|
|
4072
|
+
],
|
|
4073
|
+
editableTargets: [
|
|
4074
|
+
{ kind: 'snapshot', resolver: 'editorial-runtime-snapshot', description: 'Resolved editorial state from solution, instance and runtime context.' },
|
|
4075
|
+
{ kind: 'fallback', resolver: 'editorial-runtime-fallback-state', description: 'Explicit operational fallback state derived from runtime diagnostics.' },
|
|
4076
|
+
{ kind: 'presentation', resolver: 'editorial-solution-presentation', description: 'Editorial presentation contract under solution.presentation.' },
|
|
4077
|
+
{ kind: 'adapter', resolver: 'editorial-data-block-adapter-registry', description: 'Optional dataCollection adapter binding and compatibility requirements.' },
|
|
4078
|
+
{ kind: 'dataBlock', resolver: 'editorial-journey-step-block-by-id', description: 'Editorial blocks inside journey steps, including dataCollection and presentational blocks.' },
|
|
4079
|
+
{ kind: 'fieldBinding', resolver: 'editorial-data-block-field-binding', description: 'Field-to-runtime-context binding for dataCollection blocks without redefining FieldMetadata.' },
|
|
4080
|
+
],
|
|
4081
|
+
operations: [
|
|
4082
|
+
{
|
|
4083
|
+
operationId: 'snapshot.set',
|
|
4084
|
+
title: 'Set editorial snapshot inputs',
|
|
4085
|
+
scope: 'global',
|
|
4086
|
+
targetKind: 'snapshot',
|
|
4087
|
+
target: { kind: 'snapshot', resolver: 'editorial-runtime-snapshot', ambiguityPolicy: 'fail', required: false },
|
|
4088
|
+
inputSchema: snapshotSetSchema,
|
|
4089
|
+
effects: [{ kind: 'compile-domain-patch', handler: 'editorial-snapshot-set', handlerContract: {
|
|
4090
|
+
reads: ['EditorialSolutionDefinition', 'EditorialTemplateInstance', 'runtimeContext', 'resolveEditorialRuntimeSnapshot'],
|
|
4091
|
+
writes: ['solution.solutionId', 'instance.instanceId', 'instance.context', 'runtimeContext'],
|
|
4092
|
+
identityKeys: ['solutionId', 'instanceId', 'journeyId'],
|
|
4093
|
+
inputSchema: snapshotSetSchema,
|
|
4094
|
+
failureModes: ['solution-not-found', 'journey-not-found', 'step-not-found', 'snapshot-shape-invalid', 'diagnostics-lost'],
|
|
4095
|
+
description: 'Compiles a deterministic patch to editorial runtime inputs, validates the requested journey/step against the resolved snapshot and requires diagnostics to be preserved.',
|
|
4096
|
+
} }],
|
|
4097
|
+
validators: ['snapshot-shape-canonical', 'journey-exists', 'step-exists', 'diagnostics-preserved', 'editorial-round-trip'],
|
|
4098
|
+
affectedPaths: ['solution.solutionId', 'instance.instanceId', 'instance.context', 'runtimeContext'],
|
|
4099
|
+
submissionImpact: 'config-only',
|
|
4100
|
+
preconditions: ['editorial-runtime-inputs-loaded'],
|
|
4101
|
+
destructive: false,
|
|
4102
|
+
requiresConfirmation: false,
|
|
4103
|
+
},
|
|
4104
|
+
{
|
|
4105
|
+
operationId: 'fallback.configure',
|
|
4106
|
+
title: 'Configure explicit fallback behavior',
|
|
4107
|
+
scope: 'meta',
|
|
4108
|
+
targetKind: 'fallback',
|
|
4109
|
+
target: { kind: 'fallback', resolver: 'editorial-runtime-fallback-state', ambiguityPolicy: 'fail', required: false },
|
|
4110
|
+
inputSchema: fallbackConfigureSchema,
|
|
4111
|
+
effects: [{ kind: 'compile-domain-patch', handler: 'editorial-fallback-configure', handlerContract: {
|
|
4112
|
+
reads: ['EditorialRuntimeDiagnostics', 'deriveRuntimeFallbackState', 'EditorialRuntimeFallbackScope'],
|
|
4113
|
+
writes: ['hostConfig.emitOperationalEvents', 'snapshot.diagnostics.items'],
|
|
4114
|
+
identityKeys: ['mode', 'diagnosticCode', 'scope.journeyId', 'scope.stepId'],
|
|
4115
|
+
inputSchema: fallbackConfigureSchema,
|
|
4116
|
+
failureModes: ['fallback-mode-invalid', 'blocking-diagnostic-missing', 'scope-not-found', 'implicit-degradation-not-allowed'],
|
|
4117
|
+
description: 'Requires fallback policy to be explicit and tied to snapshot diagnostics, because fallback state is derived by deriveRuntimeFallbackState instead of persisted as domain data.',
|
|
4118
|
+
} }],
|
|
4119
|
+
validators: ['fallback-explicit', 'fallback-diagnostic-backed', 'fallback-scope-exists', 'editorial-round-trip'],
|
|
4120
|
+
affectedPaths: ['hostConfig.emitOperationalEvents', 'snapshot.diagnostics.items'],
|
|
4121
|
+
submissionImpact: 'config-only',
|
|
4122
|
+
preconditions: ['snapshot-resolved'],
|
|
4123
|
+
destructive: false,
|
|
4124
|
+
requiresConfirmation: false,
|
|
4125
|
+
},
|
|
4126
|
+
{
|
|
4127
|
+
operationId: 'presentation.configure',
|
|
4128
|
+
title: 'Configure editorial presentation',
|
|
4129
|
+
scope: 'skin',
|
|
4130
|
+
targetKind: 'presentation',
|
|
4131
|
+
target: { kind: 'presentation', resolver: 'editorial-solution-presentation', ambiguityPolicy: 'fail', required: false },
|
|
4132
|
+
inputSchema: presentationConfigureSchema,
|
|
4133
|
+
effects: [{ kind: 'compile-domain-patch', handler: 'editorial-presentation-configure', handlerContract: {
|
|
4134
|
+
reads: ['solution.presentation', 'buildRuntimeLayoutCss', 'buildRuntimeCssVars', 'resolveRuntimeOrientation'],
|
|
4135
|
+
writes: ['solution.presentation.layout', 'solution.presentation.theme', 'solution.presentation.stepper'],
|
|
4136
|
+
identityKeys: ['solutionId', 'presentation.layout.orientation', 'presentation.stepper.orientation'],
|
|
4137
|
+
inputSchema: presentationConfigureSchema,
|
|
4138
|
+
failureModes: ['presentation-key-unsupported', 'theme-token-invalid', 'domain-data-mutation-detected', 'renderer-coverage-missing'],
|
|
4139
|
+
description: 'Applies presentation-only changes under solution.presentation and rejects changes that mutate editorial domain data.',
|
|
4140
|
+
} }],
|
|
4141
|
+
validators: ['presentation-supported-by-runtime', 'presentation-does-not-mutate-domain-data', 'theme-tokens-valid', 'editorial-round-trip'],
|
|
4142
|
+
affectedPaths: ['solution.presentation.layout', 'solution.presentation.theme', 'solution.presentation.stepper'],
|
|
4143
|
+
submissionImpact: 'visual-only',
|
|
4144
|
+
preconditions: ['solution-loaded'],
|
|
4145
|
+
destructive: false,
|
|
4146
|
+
requiresConfirmation: false,
|
|
4147
|
+
},
|
|
4148
|
+
{
|
|
4149
|
+
operationId: 'adapter.bind',
|
|
4150
|
+
title: 'Bind data block adapter',
|
|
4151
|
+
scope: 'dataBinding',
|
|
4152
|
+
targetKind: 'adapter',
|
|
4153
|
+
target: { kind: 'adapter', resolver: 'editorial-data-block-adapter-registry', ambiguityPolicy: 'fail', required: true },
|
|
4154
|
+
inputSchema: adapterBindSchema,
|
|
4155
|
+
effects: [{ kind: 'compile-domain-patch', handler: 'editorial-adapter-bind', handlerContract: {
|
|
4156
|
+
reads: ['EDITORIAL_DATA_BLOCK_ADAPTER', 'EditorialDataBlockAdapterRegistry', 'EditorialDataBlockContext', 'ComponentDocMeta'],
|
|
4157
|
+
writes: ['hostConfig.forwardAdapterOperationalEvents', 'snapshot.diagnostics.items'],
|
|
4158
|
+
identityKeys: ['adapterId', 'dataBlockType'],
|
|
4159
|
+
inputSchema: adapterBindSchema,
|
|
4160
|
+
failureModes: ['adapter-not-registered', 'adapter-does-not-support-data-block', 'adapter-component-invalid', 'fallback-policy-missing'],
|
|
4161
|
+
description: 'Validates the external provider binding for a dataCollection adapter and records the host operational-event policy required when the adapter is missing or incompatible.',
|
|
4162
|
+
} }],
|
|
4163
|
+
validators: ['adapter-exists', 'adapter-supports-data-block', 'adapter-component-valid', 'fallback-explicit', 'editorial-round-trip'],
|
|
4164
|
+
affectedPaths: ['hostConfig.forwardAdapterOperationalEvents', 'snapshot.diagnostics.items'],
|
|
4165
|
+
submissionImpact: 'config-only',
|
|
4166
|
+
preconditions: ['adapter-registry-loaded'],
|
|
4167
|
+
destructive: false,
|
|
4168
|
+
requiresConfirmation: false,
|
|
4169
|
+
},
|
|
4170
|
+
{
|
|
4171
|
+
operationId: 'dataBlock.add',
|
|
4172
|
+
title: 'Add editorial data block',
|
|
4173
|
+
scope: 'section',
|
|
4174
|
+
targetKind: 'dataBlock',
|
|
4175
|
+
target: { kind: 'dataBlock', resolver: 'editorial-journey-step-block-by-id', ambiguityPolicy: 'fail', required: true },
|
|
4176
|
+
inputSchema: dataBlockAddSchema,
|
|
4177
|
+
effects: [{ kind: 'compile-domain-patch', handler: 'editorial-data-block-add', handlerContract: {
|
|
4178
|
+
reads: ['EditorialSolutionDefinition.journeys', 'EditorialResolvedStep.blocks', 'EditorialDataBlockAdapterRegistry'],
|
|
4179
|
+
writes: ['solution.journeys[].steps[].blocks'],
|
|
4180
|
+
identityKeys: ['journeyId', 'stepId', 'block.blockId'],
|
|
4181
|
+
inputSchema: dataBlockAddSchema,
|
|
4182
|
+
failureModes: ['journey-not-found', 'step-not-found', 'duplicate-block-id', 'data-collection-config-unresolved', 'adapter-not-registered'],
|
|
4183
|
+
description: 'Adds a canonical editorial block to a step and validates dataCollection readiness without redefining Dynamic Form config semantics.',
|
|
4184
|
+
} }],
|
|
4185
|
+
validators: ['data-block-id-unique', 'journey-exists', 'step-exists', 'adapter-supports-data-block', 'editorial-round-trip'],
|
|
4186
|
+
affectedPaths: ['solution.journeys[].steps[].blocks'],
|
|
4187
|
+
submissionImpact: 'config-only',
|
|
4188
|
+
preconditions: ['solution-loaded'],
|
|
4189
|
+
destructive: false,
|
|
4190
|
+
requiresConfirmation: false,
|
|
4191
|
+
},
|
|
4192
|
+
{
|
|
4193
|
+
operationId: 'dataBlock.remove',
|
|
4194
|
+
title: 'Remove editorial data block',
|
|
4195
|
+
scope: 'section',
|
|
4196
|
+
targetKind: 'dataBlock',
|
|
4197
|
+
target: { kind: 'dataBlock', resolver: 'editorial-journey-step-block-by-id', ambiguityPolicy: 'fail', required: true },
|
|
4198
|
+
inputSchema: dataBlockRemoveSchema,
|
|
4199
|
+
effects: [{ kind: 'compile-domain-patch', handler: 'editorial-data-block-remove', handlerContract: {
|
|
4200
|
+
reads: ['EditorialSolutionDefinition.journeys', 'EditorialResolvedStep.blocks', 'fieldBinding'],
|
|
4201
|
+
writes: ['solution.journeys[].steps[].blocks'],
|
|
4202
|
+
identityKeys: ['journeyId', 'stepId', 'blockId'],
|
|
4203
|
+
inputSchema: dataBlockRemoveSchema,
|
|
4204
|
+
failureModes: ['journey-not-found', 'step-not-found', 'block-not-found', 'field-bindings-still-reference-block'],
|
|
4205
|
+
description: 'Removes a block by stable id and rejects removal when governed field bindings still reference the block.',
|
|
4206
|
+
} }],
|
|
4207
|
+
destructive: true,
|
|
4208
|
+
requiresConfirmation: true,
|
|
4209
|
+
validators: ['data-block-exists', 'field-binding-target-exists', 'editorial-round-trip'],
|
|
4210
|
+
affectedPaths: ['solution.journeys[].steps[].blocks'],
|
|
4211
|
+
submissionImpact: 'config-only',
|
|
4212
|
+
preconditions: ['solution-loaded', 'explicit-confirmation-provided'],
|
|
4213
|
+
},
|
|
4214
|
+
{
|
|
4215
|
+
operationId: 'fieldBinding.set',
|
|
4216
|
+
title: 'Set editorial field binding',
|
|
4217
|
+
scope: 'fieldMetadataPath',
|
|
4218
|
+
targetKind: 'fieldBinding',
|
|
4219
|
+
target: { kind: 'fieldBinding', resolver: 'editorial-data-block-field-binding', ambiguityPolicy: 'fail', required: true },
|
|
4220
|
+
inputSchema: fieldBindingSetSchema,
|
|
4221
|
+
effects: [{ kind: 'compile-domain-patch', handler: 'editorial-field-binding-set', handlerContract: {
|
|
4222
|
+
reads: ['EditorialDataCollectionBlock', 'resolvedFormConfig.fieldMetadata', 'runtimeContext.formData', 'PRAXIS_METADATA_EDITOR_AUTHORING_MANIFEST'],
|
|
4223
|
+
writes: ['runtimeContext.formData'],
|
|
4224
|
+
identityKeys: ['blockId', 'fieldName', 'contextPath'],
|
|
4225
|
+
inputSchema: fieldBindingSetSchema,
|
|
4226
|
+
failureModes: ['block-not-found', 'field-not-found', 'context-path-invalid', 'field-metadata-delegation-required', 'domain-data-mutation-detected'],
|
|
4227
|
+
description: 'Sets the governed runtimeContext.formData path used by dataCollection adapters and delegates FieldMetadata shape changes to the metadata-editor manifest.',
|
|
4228
|
+
} }],
|
|
4229
|
+
validators: ['field-binding-target-exists', 'field-binding-path-valid', 'delegates-field-metadata', 'editorial-round-trip'],
|
|
4230
|
+
affectedPaths: ['runtimeContext.formData'],
|
|
4231
|
+
submissionImpact: 'affects-schema-backed-data',
|
|
4232
|
+
preconditions: ['data-block-resolved', 'field-metadata-loaded'],
|
|
4233
|
+
destructive: false,
|
|
4234
|
+
requiresConfirmation: false,
|
|
4235
|
+
},
|
|
4236
|
+
],
|
|
4237
|
+
validators: [
|
|
4238
|
+
{ validatorId: 'snapshot-shape-canonical', level: 'error', code: 'EDITORIAL_SNAPSHOT_SHAPE_CANONICAL', description: 'Resolved snapshot must remain compatible with EditorialRuntimeSnapshot.' },
|
|
4239
|
+
{ validatorId: 'journey-exists', level: 'error', code: 'EDITORIAL_JOURNEY_EXISTS', description: 'Target journey must exist in the editorial solution.' },
|
|
4240
|
+
{ validatorId: 'step-exists', level: 'error', code: 'EDITORIAL_STEP_EXISTS', description: 'Target step must exist in the selected journey.' },
|
|
4241
|
+
{ validatorId: 'diagnostics-preserved', level: 'error', code: 'EDITORIAL_DIAGNOSTICS_PRESERVED', description: 'Patch compilation must not drop runtime diagnostics.' },
|
|
4242
|
+
{ validatorId: 'fallback-explicit', level: 'error', code: 'EDITORIAL_FALLBACK_EXPLICIT', description: 'Fallback behavior must be explicit instead of implied by missing adapter or hidden diagnostics.' },
|
|
4243
|
+
{ validatorId: 'fallback-diagnostic-backed', level: 'error', code: 'EDITORIAL_FALLBACK_DIAGNOSTIC_BACKED', description: 'Warning, degraded and blocked fallback states must be backed by diagnostics.' },
|
|
4244
|
+
{ validatorId: 'fallback-scope-exists', level: 'error', code: 'EDITORIAL_FALLBACK_SCOPE_EXISTS', description: 'Fallback scope must resolve to an existing journey, step or block.' },
|
|
4245
|
+
{ validatorId: 'presentation-supported-by-runtime', level: 'error', code: 'EDITORIAL_PRESENTATION_SUPPORTED', description: 'Presentation keys must be supported by the runtime or intentionally diagnosed as unsupported.' },
|
|
4246
|
+
{ validatorId: 'presentation-does-not-mutate-domain-data', level: 'error', code: 'EDITORIAL_PRESENTATION_DOMAIN_SAFE', description: 'Presentation changes must not mutate solution journeys, blocks, field metadata or runtime context data.' },
|
|
4247
|
+
{ validatorId: 'theme-tokens-valid', level: 'error', code: 'EDITORIAL_THEME_TOKENS_VALID', description: 'Theme tokens must be valid runtime CSS variable inputs.' },
|
|
4248
|
+
{ validatorId: 'adapter-exists', level: 'error', code: 'EDITORIAL_ADAPTER_EXISTS', description: 'Requested adapter must exist in EditorialDataBlockAdapterRegistry.' },
|
|
4249
|
+
{ validatorId: 'adapter-supports-data-block', level: 'error', code: 'EDITORIAL_ADAPTER_SUPPORTS_DATA_BLOCK', description: 'Requested adapter must support the target data block context.' },
|
|
4250
|
+
{ validatorId: 'adapter-component-valid', level: 'error', code: 'EDITORIAL_ADAPTER_COMPONENT_VALID', description: 'Adapter component must expose the inputs required by the adapter contract.' },
|
|
4251
|
+
{ validatorId: 'data-block-id-unique', level: 'error', code: 'EDITORIAL_DATA_BLOCK_ID_UNIQUE', description: 'Block ids must be unique within the resolved editorial step.' },
|
|
4252
|
+
{ validatorId: 'data-block-exists', level: 'error', code: 'EDITORIAL_DATA_BLOCK_EXISTS', description: 'Target data block must exist before destructive or binding operations.' },
|
|
4253
|
+
{ validatorId: 'field-binding-target-exists', level: 'error', code: 'EDITORIAL_FIELD_BINDING_TARGET_EXISTS', description: 'Field binding must target an existing dataCollection block and field.' },
|
|
4254
|
+
{ validatorId: 'field-binding-path-valid', level: 'error', code: 'EDITORIAL_FIELD_BINDING_PATH_VALID', description: 'Field binding context path must be deterministic and inside governed runtime context data.' },
|
|
4255
|
+
{ validatorId: 'delegates-field-metadata', level: 'error', code: 'EDITORIAL_DELEGATES_FIELD_METADATA', description: 'FieldMetadata shape changes must be delegated to the metadata-editor manifest instead of duplicated here.' },
|
|
4256
|
+
{ validatorId: 'editorial-round-trip', level: 'error', code: 'EDITORIAL_ROUND_TRIP', description: 'Open, edit, apply/save, reopen and runtime consume must preserve the editorial document.' },
|
|
4257
|
+
],
|
|
4258
|
+
roundTripRequirements: [
|
|
4259
|
+
'EditorialRuntimeInput is the package-level authoring document; solution, instance and runtimeContext must resolve into EditorialRuntimeSnapshot without drift.',
|
|
4260
|
+
'Fallback behavior must be explicit and backed by diagnostics; missing adapters cannot be hidden as successful rendering.',
|
|
4261
|
+
'Presentation changes are constrained to solution.presentation and must not mutate journeys, blocks, FormConfig, FieldMetadata or runtimeContext domain data.',
|
|
4262
|
+
'dataCollection blocks require an adapter that exists and supports the requested context, while Dynamic Form config semantics remain owned by @praxisui/dynamic-form.',
|
|
4263
|
+
'FieldMetadata authoring is delegated to praxis-metadata-editor and dynamic-fields discovery; this manifest only governs editorial binding and orchestration.',
|
|
4264
|
+
'Destructive block removal requires confirmation and must reject references from existing field bindings.',
|
|
4265
|
+
],
|
|
4266
|
+
examples: [
|
|
4267
|
+
{ id: 'select-journey', request: 'Set the onboarding journey as the active editorial path.', operationId: 'snapshot.set', params: { solutionId: 'customer-onboarding', journeyId: 'onboarding' }, isPositive: true },
|
|
4268
|
+
{ id: 'merge-runtime-context', request: 'Prefill the runtime context with the selected plan.', operationId: 'snapshot.set', params: { solutionId: 'plan-signup', runtimeContextPatch: { selectedPlan: 'pro' } }, isPositive: true },
|
|
4269
|
+
{ id: 'configure-blocked-fallback', request: 'Block progression when the required dataCollection adapter is missing.', operationId: 'fallback.configure', params: { mode: 'blocked', diagnosticCode: 'data-collection-adapter-missing', progressionBlocked: true }, isPositive: true },
|
|
4270
|
+
{ id: 'configure-stepper', request: 'Use a vertical compact stepper with hidden descriptions.', operationId: 'presentation.configure', params: { layout: { orientation: 'vertical', density: 'compact' }, stepper: { showDescriptions: false } }, isPositive: true },
|
|
4271
|
+
{ id: 'bind-dynamic-form-adapter', request: 'Bind the dynamic-form adapter for dataCollection blocks.', operationId: 'adapter.bind', params: { adapterId: 'dynamic-form', dataBlockType: 'dataCollection', requiredInputs: ['config', 'formId', 'editorialContext'], fallbackModeWhenMissing: 'blocked' }, isPositive: true },
|
|
4272
|
+
{ id: 'add-data-block', request: 'Add a consent form block to the review step.', operationId: 'dataBlock.add', params: { journeyId: 'privacy', stepId: 'review', block: { blockId: 'consent-form', kind: 'dataCollection', formBlockId: 'consent-form' } }, isPositive: true },
|
|
4273
|
+
{ id: 'remove-block', request: 'Remove the unused legacy consent block.', operationId: 'dataBlock.remove', params: { journeyId: 'privacy', stepId: 'review', blockId: 'legacy-consent', requireNoFieldBindings: true }, isPositive: true },
|
|
4274
|
+
{ id: 'set-field-binding', request: 'Bind the email field into runtimeContext.formData.email.', operationId: 'fieldBinding.set', params: { blockId: 'contact-form', fieldName: 'email', contextPath: 'formData.email', mode: 'readWrite', delegateFieldMetadataTo: 'praxis-metadata-editor' }, isPositive: true },
|
|
4275
|
+
{ id: 'reject-presentation-domain-mutation', request: 'Change presentation and also rewrite the collected email value.', operationId: 'presentation.configure', params: { layout: { density: 'relaxed' }, runtimeContextPatch: { formData: { email: 'changed@example.com' } } }, isPositive: false },
|
|
4276
|
+
{ id: 'reject-missing-adapter', request: 'Render a dataCollection block with an adapter that is not registered.', operationId: 'adapter.bind', params: { adapterId: 'unknown-form-engine', dataBlockType: 'dataCollection' }, isPositive: false },
|
|
4277
|
+
{ id: 'reject-duplicate-block', request: 'Add another block using the existing consent-form id.', operationId: 'dataBlock.add', params: { journeyId: 'privacy', stepId: 'review', block: { blockId: 'consent-form', kind: 'dataCollection', formBlockId: 'consent-form-copy' } }, isPositive: false },
|
|
4278
|
+
{ id: 'reject-field-metadata-duplication', request: 'Change the control type inside editorial forms instead of metadata editor.', operationId: 'fieldBinding.set', params: { blockId: 'contact-form', fieldName: 'email', contextPath: 'formData.email', controlType: 'select' }, isPositive: false },
|
|
4279
|
+
],
|
|
4280
|
+
};
|
|
4281
|
+
|
|
3778
4282
|
const REQUIRED_DYNAMIC_FORM_INPUTS = ['config', 'formId', 'editorialContext'];
|
|
3779
4283
|
function readRuntimeFormData(runtimeContext) {
|
|
3780
4284
|
const formData = runtimeContext?.['formData'];
|
|
@@ -4301,4 +4805,4 @@ function getHarnessDataEngineComponent() {
|
|
|
4301
4805
|
* Generated bundle index. Do not edit.
|
|
4302
4806
|
*/
|
|
4303
4807
|
|
|
4304
|
-
export { DEFAULT_EDITORIAL_RUNTIME_HOST_CONFIG, EDITORIAL_DATA_BLOCK_ADAPTER, EditorialBlockRendererComponent, EditorialDataBlockAdapterRegistry, EditorialDataCollectionBlockOutletComponent, EditorialFormRuntimeComponent, EditorialIntroHeroBlockComponent, EditorialReviewSectionsBlockComponent, EditorialRuntimeState, EditorialSelectionCardsBlockComponent, EditorialStepperComponent, EditorialSuccessPanelBlockComponent, HarnessDataEngineComponent, PRAXIS_EDITORIAL_FORMS_EN_US, PRAXIS_EDITORIAL_FORMS_PT_BR, buildRuntimeCssVars, buildRuntimeLayoutCss, createEditorialDynamicFormAdapter, createEditorialRuntimeHarnessCatalog, createPraxisEditorialFormsI18nConfig, deriveRuntimeFallbackState, getHarnessDataEngineComponent, getStepDisplayState, getValueAtPath, getVisibleBlocks, isBlockVisible, matchesVisibilityRule, provideEditorialDataBlockAdapter, provideEditorialDynamicFormAdapter, providePraxisEditorialForms, providePraxisEditorialFormsI18n, resolveActiveJourney, resolveActiveStep, resolveDensity, resolveEditorialDataBlockAdapter, resolveEditorialDataBlockFormConfig, resolveEditorialDataBlockFormConfigDetails, resolveEditorialRuntimeSnapshot, resolveRuntimeOrientation, resolveShellVariant };
|
|
4808
|
+
export { DEFAULT_EDITORIAL_RUNTIME_HOST_CONFIG, EDITORIAL_DATA_BLOCK_ADAPTER, EDITORIAL_FORM_RUNTIME_COMPONENT_METADATA, EditorialBlockRendererComponent, EditorialDataBlockAdapterRegistry, EditorialDataCollectionBlockOutletComponent, EditorialFormRuntimeComponent, EditorialIntroHeroBlockComponent, EditorialReviewSectionsBlockComponent, EditorialRuntimeState, EditorialSelectionCardsBlockComponent, EditorialStepperComponent, EditorialSuccessPanelBlockComponent, HarnessDataEngineComponent, PRAXIS_EDITORIAL_FORMS_AUTHORING_MANIFEST, PRAXIS_EDITORIAL_FORMS_EN_US, PRAXIS_EDITORIAL_FORMS_PT_BR, buildRuntimeCssVars, buildRuntimeLayoutCss, createEditorialDynamicFormAdapter, createEditorialRuntimeHarnessCatalog, createPraxisEditorialFormsI18nConfig, deriveRuntimeFallbackState, getHarnessDataEngineComponent, getStepDisplayState, getValueAtPath, getVisibleBlocks, isBlockVisible, matchesVisibilityRule, provideEditorialDataBlockAdapter, provideEditorialDynamicFormAdapter, providePraxisEditorialFormRuntimeMetadata, providePraxisEditorialForms, providePraxisEditorialFormsI18n, resolveActiveJourney, resolveActiveStep, resolveDensity, resolveEditorialDataBlockAdapter, resolveEditorialDataBlockFormConfig, resolveEditorialDataBlockFormConfigDetails, resolveEditorialRuntimeSnapshot, resolveRuntimeOrientation, resolveShellVariant };
|
package/index.d.ts
CHANGED
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
import * as _angular_core from '@angular/core';
|
|
2
|
-
import { EnvironmentProviders, Type, InjectionToken } from '@angular/core';
|
|
2
|
+
import { EnvironmentProviders, Provider, Type, InjectionToken } from '@angular/core';
|
|
3
3
|
import * as _praxisui_core from '@praxisui/core';
|
|
4
|
-
import { EditorialProblemType, EditorialWizardPresentation, EditorialThemePreset, EditorialCompliancePreset, EditorialStepKind, EditorialIconSpec, EditorialStepVisualConfig, EditorialBlock, EditorialDataCollectionBlock, EditorialSolutionDefinition, EditorialTemplateInstance, PraxisTranslationParams, FormConfig, EditorialLayoutConfig, EditorialStepperConfig, EditorialOrientation, EditorialThemeTokens, EditorialBlockVisibilityRule, PraxisI18nDictionary, PraxisI18nConfig, EditorialIntroHeroBlock, EditorialHeroBlock, EditorialRichTextBlock, EditorialPolicyListBlock, EditorialTimelineStepsBlock, EditorialReviewSummaryBlock, EditorialReviewSectionsBlock, EditorialContextSummaryBlock, EditorialSelectionCardsBlock, EditorialInfoCardsBlock, EditorialSuccessPanelBlock, EditorialFaqAccordionBlock, EditorialPresentationalAction, EditorialReviewSectionField } from '@praxisui/core';
|
|
4
|
+
import { ComponentAuthoringManifest, EditorialProblemType, EditorialWizardPresentation, EditorialThemePreset, EditorialCompliancePreset, EditorialStepKind, EditorialIconSpec, EditorialStepVisualConfig, EditorialBlock, EditorialDataCollectionBlock, EditorialSolutionDefinition, EditorialTemplateInstance, PraxisTranslationParams, ComponentDocMeta, FormConfig, EditorialLayoutConfig, EditorialStepperConfig, EditorialOrientation, EditorialThemeTokens, EditorialBlockVisibilityRule, PraxisI18nDictionary, PraxisI18nConfig, EditorialIntroHeroBlock, EditorialHeroBlock, EditorialRichTextBlock, EditorialPolicyListBlock, EditorialTimelineStepsBlock, EditorialReviewSummaryBlock, EditorialReviewSectionsBlock, EditorialContextSummaryBlock, EditorialSelectionCardsBlock, EditorialInfoCardsBlock, EditorialSuccessPanelBlock, EditorialFaqAccordionBlock, EditorialPresentationalAction, EditorialReviewSectionField } from '@praxisui/core';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Root provider entrypoint for the editorial runtime package.
|
|
8
8
|
*
|
|
9
|
-
*
|
|
10
|
-
* -
|
|
11
|
-
*
|
|
12
|
-
*
|
|
9
|
+
* Registers the public DynamicWidgetLoader metadata for
|
|
10
|
+
* praxis-editorial-form-runtime in ComponentMetadataRegistry. This is the
|
|
11
|
+
* canonical setup hook for hosts that render editorial forms through dynamic
|
|
12
|
+
* composition; it does not introduce a separate global runtime singleton graph.
|
|
13
13
|
*/
|
|
14
14
|
declare function providePraxisEditorialForms(): EnvironmentProviders;
|
|
15
15
|
|
|
16
|
+
declare const PRAXIS_EDITORIAL_FORMS_AUTHORING_MANIFEST: ComponentAuthoringManifest;
|
|
17
|
+
|
|
16
18
|
type EditorialRuntimeDiagnosticSeverity = 'info' | 'warning' | 'error';
|
|
17
19
|
type EditorialRuntimeDiagnosticScopeKind = 'global' | 'journey' | 'step' | 'block';
|
|
18
20
|
type EditorialRuntimeDiagnosticCode = 'solution-missing' | 'theme-preset-not-found' | 'compliance-preset-not-found' | 'compliance-preset-problem-type-mismatch' | 'presentation-config-unsupported' | 'context-required-missing' | 'compliance-context-required-missing' | 'compliance-evidence-missing' | 'compliance-acceptance-missing' | 'data-collection-config-missing' | 'data-collection-config-ambiguous' | 'data-collection-adapter-missing' | 'data-collection-invalid' | 'instance-journey-block-conflict' | 'journey-override-target-missing' | 'step-override-target-missing' | 'block-override-invalid' | 'block-override-conflict' | 'block-override-target-missing';
|
|
@@ -257,6 +259,9 @@ declare class EditorialFormRuntimeComponent {
|
|
|
257
259
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<EditorialFormRuntimeComponent, "praxis-editorial-form-runtime", never, { "solution": { "alias": "solution"; "required": false; "isSignal": true; }; "instance": { "alias": "instance"; "required": false; "isSignal": true; }; "runtimeContext": { "alias": "runtimeContext"; "required": false; "isSignal": true; }; "hostConfig": { "alias": "hostConfig"; "required": false; "isSignal": true; }; }, { "snapshotChange": "snapshotChange"; "fallbackChange": "fallbackChange"; "operationalEvent": "operationalEvent"; }, never, never, true, never>;
|
|
258
260
|
}
|
|
259
261
|
|
|
262
|
+
declare const EDITORIAL_FORM_RUNTIME_COMPONENT_METADATA: ComponentDocMeta;
|
|
263
|
+
declare function providePraxisEditorialFormRuntimeMetadata(): Provider;
|
|
264
|
+
|
|
260
265
|
type EditorialDataBlockComponentInputs = Record<string, unknown>;
|
|
261
266
|
interface EditorialDataBlockValueChangeEvent {
|
|
262
267
|
formData: Record<string, unknown>;
|
|
@@ -748,5 +753,5 @@ interface EditorialRuntimeHarnessCatalog {
|
|
|
748
753
|
declare function createEditorialRuntimeHarnessCatalog(): EditorialRuntimeHarnessCatalog;
|
|
749
754
|
declare function getHarnessDataEngineComponent(): Type<unknown>;
|
|
750
755
|
|
|
751
|
-
export { DEFAULT_EDITORIAL_RUNTIME_HOST_CONFIG, EDITORIAL_DATA_BLOCK_ADAPTER, EditorialBlockRendererComponent, EditorialDataBlockAdapterRegistry, EditorialDataCollectionBlockOutletComponent, EditorialFormRuntimeComponent, EditorialIntroHeroBlockComponent, EditorialReviewSectionsBlockComponent, EditorialRuntimeState, EditorialSelectionCardsBlockComponent, EditorialStepperComponent, EditorialSuccessPanelBlockComponent, HarnessDataEngineComponent, PRAXIS_EDITORIAL_FORMS_EN_US, PRAXIS_EDITORIAL_FORMS_PT_BR, buildRuntimeCssVars, buildRuntimeLayoutCss, createEditorialDynamicFormAdapter, createEditorialRuntimeHarnessCatalog, createPraxisEditorialFormsI18nConfig, deriveRuntimeFallbackState, getHarnessDataEngineComponent, getStepDisplayState, getValueAtPath, getVisibleBlocks, isBlockVisible, matchesVisibilityRule, provideEditorialDataBlockAdapter, provideEditorialDynamicFormAdapter, providePraxisEditorialForms, providePraxisEditorialFormsI18n, resolveActiveJourney, resolveActiveStep, resolveDensity, resolveEditorialDataBlockAdapter, resolveEditorialDataBlockFormConfig, resolveEditorialDataBlockFormConfigDetails, resolveEditorialRuntimeSnapshot, resolveRuntimeOrientation, resolveShellVariant };
|
|
756
|
+
export { DEFAULT_EDITORIAL_RUNTIME_HOST_CONFIG, EDITORIAL_DATA_BLOCK_ADAPTER, EDITORIAL_FORM_RUNTIME_COMPONENT_METADATA, EditorialBlockRendererComponent, EditorialDataBlockAdapterRegistry, EditorialDataCollectionBlockOutletComponent, EditorialFormRuntimeComponent, EditorialIntroHeroBlockComponent, EditorialReviewSectionsBlockComponent, EditorialRuntimeState, EditorialSelectionCardsBlockComponent, EditorialStepperComponent, EditorialSuccessPanelBlockComponent, HarnessDataEngineComponent, PRAXIS_EDITORIAL_FORMS_AUTHORING_MANIFEST, PRAXIS_EDITORIAL_FORMS_EN_US, PRAXIS_EDITORIAL_FORMS_PT_BR, buildRuntimeCssVars, buildRuntimeLayoutCss, createEditorialDynamicFormAdapter, createEditorialRuntimeHarnessCatalog, createPraxisEditorialFormsI18nConfig, deriveRuntimeFallbackState, getHarnessDataEngineComponent, getStepDisplayState, getValueAtPath, getVisibleBlocks, isBlockVisible, matchesVisibilityRule, provideEditorialDataBlockAdapter, provideEditorialDynamicFormAdapter, providePraxisEditorialFormRuntimeMetadata, providePraxisEditorialForms, providePraxisEditorialFormsI18n, resolveActiveJourney, resolveActiveStep, resolveDensity, resolveEditorialDataBlockAdapter, resolveEditorialDataBlockFormConfig, resolveEditorialDataBlockFormConfigDetails, resolveEditorialRuntimeSnapshot, resolveRuntimeOrientation, resolveShellVariant };
|
|
752
757
|
export type { DynamicFormCompatibleComponent, EditorialDataBlockAdapter, EditorialDataBlockAdapterResolution, EditorialDataBlockAdapterResolutionStatus, EditorialDataBlockComponentInputs, EditorialDataBlockContext, EditorialDataBlockResolution, EditorialDataBlockValueChangeEvent, EditorialDynamicFormAdapterOptions, EditorialResolvedBlock, EditorialResolvedBlockBase, EditorialResolvedBlockCompositionEntry, EditorialResolvedBlockCompositionOperation, EditorialResolvedBlockProvenance, EditorialResolvedBlockSourceKind, EditorialResolvedBlockSourceRef, EditorialResolvedDataCollectionBlock, EditorialResolvedDataCollectionState, EditorialResolvedJourney, EditorialResolvedStep, EditorialRuntimeDiagnostic, EditorialRuntimeDiagnosticCode, EditorialRuntimeDiagnosticScopeKind, EditorialRuntimeDiagnosticSeverity, EditorialRuntimeDiagnostics, EditorialRuntimeFallbackMode, EditorialRuntimeFallbackScope, EditorialRuntimeFallbackState, EditorialRuntimeFixture, EditorialRuntimeHarnessCatalog, EditorialRuntimeHostConfig, EditorialRuntimeInput, EditorialRuntimeOperationalEvent, EditorialRuntimeOperationalEventBase, EditorialRuntimeOperationalEventSeverity, EditorialRuntimeOperationalEventType, EditorialRuntimeSnapshot, PraxisEditorialFormsI18nOptions, ResolveEditorialRuntimeSnapshotInput };
|
package/package.json
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@praxisui/editorial-forms",
|
|
3
|
-
"version": "8.0.0-beta.
|
|
3
|
+
"version": "8.0.0-beta.20",
|
|
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": "^20.0.0",
|
|
7
7
|
"@angular/core": "^20.0.0",
|
|
8
|
-
"@praxisui/core": "^8.0.0-beta.
|
|
8
|
+
"@praxisui/core": "^8.0.0-beta.20",
|
|
9
|
+
"@angular/material": "^20.0.0"
|
|
9
10
|
},
|
|
10
11
|
"dependencies": {
|
|
11
12
|
"tslib": "^2.3.0"
|