@praxisui/metadata-editor 8.0.0-beta.11 → 8.0.0-beta.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/README.md +26 -0
- package/fesm2022/praxisui-metadata-editor.mjs +348 -1
- package/index.d.ts +4 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -122,6 +122,32 @@ Funcionalidades:
|
|
|
122
122
|
- `SchemaNormalizerService` — normaliza defaults, converte valores e aplica opções de provider.
|
|
123
123
|
- `ContextValidatorRegistryService` — registrador de validadores contextuais.
|
|
124
124
|
|
|
125
|
+
## Agentic Authoring Contract
|
|
126
|
+
|
|
127
|
+
`praxis-metadata-editor` publica um manifesto executavel em `PRAXIS_METADATA_EDITOR_AUTHORING_MANIFEST`.
|
|
128
|
+
|
|
129
|
+
Esse contrato governa a edicao estrutural de metadata:
|
|
130
|
+
|
|
131
|
+
- propriedades canonicas de `FieldMetadata`
|
|
132
|
+
- troca de `controlType` com descoberta em dynamic-fields
|
|
133
|
+
- `optionSource`
|
|
134
|
+
- cascatas e `dependencyFilterMap`
|
|
135
|
+
- cobertura do renderer visual
|
|
136
|
+
- regras de validacao
|
|
137
|
+
- hints/contexto
|
|
138
|
+
- normalizacao de schema
|
|
139
|
+
|
|
140
|
+
O manifesto nao cria shapes paralelos para hosts. Quando a metadata vier de backend `x-ui`, a edicao deve preservar a semantica canonica, especialmente `x-ui.optionSource.dependsOn` e `x-ui.optionSource.dependencyFilterMap`. Suporte apenas por JSON cru nao e aceito quando a propriedade exige cobertura visual no editor.
|
|
141
|
+
|
|
142
|
+
Regras do contrato:
|
|
143
|
+
|
|
144
|
+
- `FieldMetadata` e o documento canonico editado.
|
|
145
|
+
- `controlType` precisa existir na descoberta de dynamic-fields e na cobertura visual do metadata-editor.
|
|
146
|
+
- cascatas devem preservar campos existentes, evitar ciclos e manter a distincao entre a forma backend `x-ui.optionSource.dependsOn`/`dependencyFilterMap` e o contrato de save do editor em `dependencyFields`/`dependencyFilterMap`.
|
|
147
|
+
- normalizacao nao pode remover propriedades canonicas avancadas.
|
|
148
|
+
- round-trip deve preservar abrir, editar, aplicar/salvar, reabrir e consumo runtime.
|
|
149
|
+
- cada operacao declara target, resolver, ambiguity policy, preconditions, validators, effects, affected paths e `submissionImpact` tipado.
|
|
150
|
+
|
|
125
151
|
## Build e Publicação
|
|
126
152
|
|
|
127
153
|
```bash
|
|
@@ -8724,6 +8724,353 @@ const METADATA_EDITOR_AI_CAPABILITY_CATALOG = {
|
|
|
8724
8724
|
enums: {},
|
|
8725
8725
|
};
|
|
8726
8726
|
|
|
8727
|
+
const fieldMetadataPropertySchema = {
|
|
8728
|
+
type: 'object',
|
|
8729
|
+
required: ['path', 'value'],
|
|
8730
|
+
properties: {
|
|
8731
|
+
path: {
|
|
8732
|
+
enum: [
|
|
8733
|
+
'name',
|
|
8734
|
+
'label',
|
|
8735
|
+
'description',
|
|
8736
|
+
'controlType',
|
|
8737
|
+
'placeholder',
|
|
8738
|
+
'defaultValue',
|
|
8739
|
+
'group',
|
|
8740
|
+
'order',
|
|
8741
|
+
'required',
|
|
8742
|
+
'disabled',
|
|
8743
|
+
'readOnly',
|
|
8744
|
+
'hidden',
|
|
8745
|
+
'source',
|
|
8746
|
+
'transient',
|
|
8747
|
+
'submitPolicy',
|
|
8748
|
+
'hint',
|
|
8749
|
+
'helpText',
|
|
8750
|
+
'tooltip',
|
|
8751
|
+
'options',
|
|
8752
|
+
'optionSource',
|
|
8753
|
+
'validators',
|
|
8754
|
+
'conditionalRequired',
|
|
8755
|
+
'conditionalDisplay',
|
|
8756
|
+
'visibleIn',
|
|
8757
|
+
'ariaLabel',
|
|
8758
|
+
'ariaDescribedBy',
|
|
8759
|
+
],
|
|
8760
|
+
},
|
|
8761
|
+
value: {},
|
|
8762
|
+
merge: { type: 'boolean' },
|
|
8763
|
+
},
|
|
8764
|
+
};
|
|
8765
|
+
const optionSourceSchema = {
|
|
8766
|
+
type: 'object',
|
|
8767
|
+
minProperties: 1,
|
|
8768
|
+
properties: {
|
|
8769
|
+
kind: { enum: ['static', 'remote', 'resource', 'lookup'] },
|
|
8770
|
+
resource: { type: 'string' },
|
|
8771
|
+
endpoint: { type: 'string' },
|
|
8772
|
+
valueField: { type: 'string' },
|
|
8773
|
+
labelField: { type: 'string' },
|
|
8774
|
+
dependsOn: { type: 'string' },
|
|
8775
|
+
dependencyFilterMap: { type: 'object' },
|
|
8776
|
+
options: { type: 'array' },
|
|
8777
|
+
},
|
|
8778
|
+
};
|
|
8779
|
+
const cascadeSchema = {
|
|
8780
|
+
type: 'object',
|
|
8781
|
+
required: ['dependentField'],
|
|
8782
|
+
properties: {
|
|
8783
|
+
dependentField: { type: 'string' },
|
|
8784
|
+
sourceField: { type: 'string' },
|
|
8785
|
+
strategy: { enum: ['replace', 'merge'] },
|
|
8786
|
+
debounceMs: { type: 'number' },
|
|
8787
|
+
loadMode: { enum: ['immediate', 'manual', 'respectLoadOn'] },
|
|
8788
|
+
dependencyFilterMap: { type: 'object' },
|
|
8789
|
+
},
|
|
8790
|
+
};
|
|
8791
|
+
const PRAXIS_METADATA_EDITOR_AUTHORING_MANIFEST = {
|
|
8792
|
+
schemaVersion: '1.0.0',
|
|
8793
|
+
componentId: 'praxis-metadata-editor',
|
|
8794
|
+
ownerPackage: '@praxisui/metadata-editor',
|
|
8795
|
+
configSchemaId: 'FieldMetadata',
|
|
8796
|
+
manifestVersion: '1.0.0',
|
|
8797
|
+
runtimeInputs: [
|
|
8798
|
+
{ name: 'controlType', type: 'FieldControlType', description: 'Canonical control type used to resolve editor property coverage.' },
|
|
8799
|
+
{ name: 'seed', type: 'Partial<FieldMetadata | FieldDefinition>', description: 'Initial canonical field metadata used to hydrate the editor.' },
|
|
8800
|
+
{ name: 'fields', type: 'Array<FieldMetadata | FieldDefinition>', description: 'Available fields used by cascade authoring and context validation.' },
|
|
8801
|
+
{ name: 'properties', type: 'EditorProperty[]', description: 'Renderer property catalog resolved from ConfigRegistryService.' },
|
|
8802
|
+
{ name: 'form', type: 'FormGroup', description: 'Dynamic form generated from canonical editor properties by DynamicFormFactoryService.' },
|
|
8803
|
+
],
|
|
8804
|
+
editableTargets: [
|
|
8805
|
+
{ kind: 'fieldMetadata', resolver: 'field-metadata-json-path', description: 'Canonical FieldMetadata root and property paths.' },
|
|
8806
|
+
{ kind: 'controlType', resolver: 'dynamic-fields-control-type-discovery', description: 'Control type selected from dynamic-fields discovery and editor config registry.' },
|
|
8807
|
+
{ kind: 'optionSource', resolver: 'field-metadata-option-source', description: 'Canonical option source including backend x-ui option source fields where applicable.' },
|
|
8808
|
+
{ kind: 'cascade', resolver: 'metadata-editor-cascade-rules', description: 'Cascade dependencies and dependency filter mappings edited through CascadeManagerTab.' },
|
|
8809
|
+
{ kind: 'renderer', resolver: 'metadata-editor-renderer-property', description: 'Dynamic editor renderer property coverage and editor component mapping.' },
|
|
8810
|
+
{ kind: 'validation', resolver: 'field-metadata-validation-rules', description: 'Field validation rules and contextual validators.' },
|
|
8811
|
+
{ kind: 'contextHint', resolver: 'metadata-editor-context-hints', description: 'Authoring hints, help text and contextual guidance for metadata editors.' },
|
|
8812
|
+
{ kind: 'normalization', resolver: 'metadata-editor-schema-normalizer', description: 'Schema normalization and seed hydration rules.' },
|
|
8813
|
+
],
|
|
8814
|
+
operations: [
|
|
8815
|
+
{
|
|
8816
|
+
operationId: 'fieldMetadata.property.set',
|
|
8817
|
+
title: 'Set FieldMetadata property',
|
|
8818
|
+
scope: 'fieldMetadataPath',
|
|
8819
|
+
targetKind: 'fieldMetadata',
|
|
8820
|
+
target: { kind: 'fieldMetadata', resolver: 'field-metadata-json-path', ambiguityPolicy: 'fail', required: true },
|
|
8821
|
+
inputSchema: fieldMetadataPropertySchema,
|
|
8822
|
+
effects: [{ kind: 'compile-domain-patch', handler: 'metadata-field-property-set', handlerContract: {
|
|
8823
|
+
reads: ['fieldMetadata', 'fieldMetadataPath', 'SchemaNormalizerService'],
|
|
8824
|
+
writes: ['fieldMetadata'],
|
|
8825
|
+
identityKeys: ['field.name', 'path'],
|
|
8826
|
+
inputSchema: fieldMetadataPropertySchema,
|
|
8827
|
+
failureModes: ['unknown-field-metadata-path', 'non-canonical-shape', 'readonly-field', 'normalization-failed'],
|
|
8828
|
+
description: 'Sets a canonical FieldMetadata property through a governed metadata path and re-runs schema normalization.',
|
|
8829
|
+
} }],
|
|
8830
|
+
destructive: false,
|
|
8831
|
+
requiresConfirmation: false,
|
|
8832
|
+
validators: ['field-metadata-shape-canonical', 'field-path-supported-by-editor', 'metadata-round-trip'],
|
|
8833
|
+
affectedPaths: ['fieldMetadata'],
|
|
8834
|
+
submissionImpact: 'affects-schema-backed-data',
|
|
8835
|
+
preconditions: ['field-metadata-loaded'],
|
|
8836
|
+
},
|
|
8837
|
+
{
|
|
8838
|
+
operationId: 'controlType.set',
|
|
8839
|
+
title: 'Set control type',
|
|
8840
|
+
scope: 'controlType',
|
|
8841
|
+
targetKind: 'controlType',
|
|
8842
|
+
target: { kind: 'controlType', resolver: 'dynamic-fields-control-type-discovery', ambiguityPolicy: 'fail', required: true },
|
|
8843
|
+
inputSchema: {
|
|
8844
|
+
type: 'object',
|
|
8845
|
+
required: ['controlType'],
|
|
8846
|
+
properties: {
|
|
8847
|
+
controlType: { type: 'string' },
|
|
8848
|
+
preserveCompatibleProperties: { type: 'boolean' },
|
|
8849
|
+
},
|
|
8850
|
+
},
|
|
8851
|
+
effects: [{ kind: 'compile-domain-patch', handler: 'metadata-control-type-set', handlerContract: {
|
|
8852
|
+
reads: ['FieldControlType', 'ConfigRegistryService', 'dynamic-fields-discovery', 'fieldMetadata'],
|
|
8853
|
+
writes: ['fieldMetadata.controlType', 'properties', 'normalizedSeed'],
|
|
8854
|
+
identityKeys: ['field.name', 'controlType'],
|
|
8855
|
+
inputSchema: { type: 'object', required: ['controlType'], properties: { controlType: { type: 'string' }, preserveCompatibleProperties: { type: 'boolean' } } },
|
|
8856
|
+
failureModes: ['control-type-not-discovered', 'editor-coverage-missing', 'incompatible-metadata-preservation'],
|
|
8857
|
+
description: 'Changes control type only when dynamic-fields discovery and metadata-editor config registry both expose renderer/editor coverage.',
|
|
8858
|
+
} }],
|
|
8859
|
+
destructive: false,
|
|
8860
|
+
requiresConfirmation: false,
|
|
8861
|
+
validators: ['control-type-exists-in-discovery', 'editor-coverage-exists', 'metadata-round-trip'],
|
|
8862
|
+
affectedPaths: ['fieldMetadata.controlType', 'properties', 'normalizedSeed'],
|
|
8863
|
+
submissionImpact: 'affects-schema-backed-data',
|
|
8864
|
+
preconditions: ['dynamic-fields-discovery-loaded'],
|
|
8865
|
+
},
|
|
8866
|
+
{
|
|
8867
|
+
operationId: 'optionSource.configure',
|
|
8868
|
+
title: 'Configure option source',
|
|
8869
|
+
scope: 'dataBinding',
|
|
8870
|
+
targetKind: 'optionSource',
|
|
8871
|
+
target: { kind: 'optionSource', resolver: 'field-metadata-option-source', ambiguityPolicy: 'fail', required: false },
|
|
8872
|
+
inputSchema: optionSourceSchema,
|
|
8873
|
+
effects: [{ kind: 'compile-domain-patch', handler: 'metadata-option-source-configure', handlerContract: {
|
|
8874
|
+
reads: ['fieldMetadata.optionSource', 'backend.x-ui.optionSource', 'SchemaNormalizerService'],
|
|
8875
|
+
writes: ['fieldMetadata.optionSource'],
|
|
8876
|
+
identityKeys: ['field.name', 'optionSource.kind', 'optionSource.resource'],
|
|
8877
|
+
inputSchema: optionSourceSchema,
|
|
8878
|
+
failureModes: ['invalid-option-source-kind', 'remote-source-missing-governed-resource', 'dependency-filter-map-invalid'],
|
|
8879
|
+
description: 'Configures canonical optionSource fields while preserving backend x-ui dependsOn and dependencyFilterMap semantics.',
|
|
8880
|
+
} }],
|
|
8881
|
+
destructive: false,
|
|
8882
|
+
requiresConfirmation: false,
|
|
8883
|
+
validators: ['option-source-shape-canonical', 'remote-option-source-governed', 'cascade-backend-shape-preserved', 'metadata-round-trip'],
|
|
8884
|
+
affectedPaths: ['fieldMetadata.optionSource'],
|
|
8885
|
+
submissionImpact: 'affects-remote-binding',
|
|
8886
|
+
preconditions: ['field-metadata-loaded'],
|
|
8887
|
+
},
|
|
8888
|
+
{
|
|
8889
|
+
operationId: 'cascade.configure',
|
|
8890
|
+
title: 'Configure cascade rule',
|
|
8891
|
+
scope: 'interaction',
|
|
8892
|
+
targetKind: 'cascade',
|
|
8893
|
+
target: { kind: 'cascade', resolver: 'metadata-editor-cascade-rules', ambiguityPolicy: 'fail', required: false },
|
|
8894
|
+
inputSchema: cascadeSchema,
|
|
8895
|
+
effects: [{ kind: 'compile-domain-patch', handler: 'metadata-cascade-configure', handlerContract: {
|
|
8896
|
+
reads: ['CascadeManagerTabComponent', 'CascadeRulesService', 'fields', 'fieldMetadata.optionSource', 'fieldMetadata.dependencyFields', 'fieldMetadata.dependencyFilterMap'],
|
|
8897
|
+
writes: ['fieldMetadata.dependencyFields', 'fieldMetadata.enableDependencyCascade', 'fieldMetadata.resetOnDependentChange', 'fieldMetadata.dependencyFilterMap', 'fieldMetadata.dependencyValuePath', 'fieldMetadata.dependencyMergeStrategy', 'fieldMetadata.dependencyDebounceMs', 'fieldMetadata.dependencyLoadOnChange'],
|
|
8898
|
+
identityKeys: ['dependentField', 'sourceField'],
|
|
8899
|
+
inputSchema: cascadeSchema,
|
|
8900
|
+
failureModes: ['dependent-field-not-found', 'source-field-not-found', 'cascade-cycle-detected', 'dependency-filter-map-invalid'],
|
|
8901
|
+
description: 'Applies cascade dependencies through CascadeRulesService using the metadata-editor save contract while preserving backend x-ui optionSource dependency semantics during hydration.',
|
|
8902
|
+
} }],
|
|
8903
|
+
destructive: false,
|
|
8904
|
+
requiresConfirmation: false,
|
|
8905
|
+
validators: ['cascade-fields-exist', 'cascade-cycle-free', 'cascade-backend-shape-preserved', 'metadata-round-trip'],
|
|
8906
|
+
affectedPaths: ['fieldMetadata.dependencyFields', 'fieldMetadata.enableDependencyCascade', 'fieldMetadata.resetOnDependentChange', 'fieldMetadata.dependencyFilterMap', 'fieldMetadata.dependencyValuePath', 'fieldMetadata.dependencyMergeStrategy', 'fieldMetadata.dependencyDebounceMs', 'fieldMetadata.dependencyLoadOnChange'],
|
|
8907
|
+
submissionImpact: 'config-only',
|
|
8908
|
+
preconditions: ['field-list-loaded'],
|
|
8909
|
+
},
|
|
8910
|
+
{
|
|
8911
|
+
operationId: 'renderer.configure',
|
|
8912
|
+
title: 'Configure renderer coverage',
|
|
8913
|
+
scope: 'editorCoverage',
|
|
8914
|
+
targetKind: 'renderer',
|
|
8915
|
+
target: { kind: 'renderer', resolver: 'metadata-editor-renderer-property', ambiguityPolicy: 'fail', required: true },
|
|
8916
|
+
inputSchema: {
|
|
8917
|
+
type: 'object',
|
|
8918
|
+
required: ['propertyName', 'editorType'],
|
|
8919
|
+
properties: {
|
|
8920
|
+
propertyName: { type: 'string' },
|
|
8921
|
+
editorType: { type: 'string' },
|
|
8922
|
+
group: { type: 'string' },
|
|
8923
|
+
required: { type: 'boolean' },
|
|
8924
|
+
options: { type: 'array' },
|
|
8925
|
+
},
|
|
8926
|
+
},
|
|
8927
|
+
effects: [{ kind: 'compile-domain-patch', handler: 'metadata-renderer-configure', handlerContract: {
|
|
8928
|
+
reads: ['DynamicEditorRendererComponent', 'EditorComponentRegistryService', 'ConfigRegistryService', 'EditorProperty'],
|
|
8929
|
+
writes: ['properties', 'editorCoverage'],
|
|
8930
|
+
identityKeys: ['controlType', 'propertyName'],
|
|
8931
|
+
inputSchema: { type: 'object', required: ['propertyName', 'editorType'], properties: { propertyName: { type: 'string' }, editorType: { type: 'string' }, group: { type: 'string' } } },
|
|
8932
|
+
failureModes: ['editor-type-not-registered', 'property-not-covered', 'json-only-coverage-not-accepted'],
|
|
8933
|
+
description: 'Configures visual renderer coverage for a metadata property and rejects JSON-only support for required visual authoring.',
|
|
8934
|
+
} }],
|
|
8935
|
+
destructive: false,
|
|
8936
|
+
requiresConfirmation: false,
|
|
8937
|
+
validators: ['renderer-editor-type-registered', 'visual-editor-coverage-required', 'editor-coverage-exists', 'metadata-round-trip'],
|
|
8938
|
+
affectedPaths: ['properties', 'editorCoverage'],
|
|
8939
|
+
submissionImpact: 'config-only',
|
|
8940
|
+
preconditions: ['config-registry-loaded'],
|
|
8941
|
+
},
|
|
8942
|
+
{
|
|
8943
|
+
operationId: 'validationRule.add',
|
|
8944
|
+
title: 'Add validation rule',
|
|
8945
|
+
scope: 'fieldMetadataPath',
|
|
8946
|
+
targetKind: 'validation',
|
|
8947
|
+
target: { kind: 'validation', resolver: 'field-metadata-validation-rules', ambiguityPolicy: 'fail', required: false },
|
|
8948
|
+
inputSchema: {
|
|
8949
|
+
type: 'object',
|
|
8950
|
+
required: ['rule'],
|
|
8951
|
+
properties: {
|
|
8952
|
+
rule: { type: 'object' },
|
|
8953
|
+
message: { type: 'string' },
|
|
8954
|
+
contextValidatorId: { type: 'string' },
|
|
8955
|
+
},
|
|
8956
|
+
},
|
|
8957
|
+
effects: [{ kind: 'compile-domain-patch', handler: 'metadata-validation-rule-add', handlerContract: {
|
|
8958
|
+
reads: ['fieldMetadata.validators', 'ContextValidatorRegistryService', 'DynamicFormFactoryService'],
|
|
8959
|
+
writes: ['fieldMetadata.validators'],
|
|
8960
|
+
identityKeys: ['field.name', 'rule.type', 'contextValidatorId'],
|
|
8961
|
+
inputSchema: { type: 'object', required: ['rule'], properties: { rule: { type: 'object' }, message: { type: 'string' }, contextValidatorId: { type: 'string' } } },
|
|
8962
|
+
failureModes: ['validation-rule-invalid', 'context-validator-not-registered', 'duplicate-validation-rule'],
|
|
8963
|
+
description: 'Adds a canonical validation rule and verifies contextual validator availability before persistence.',
|
|
8964
|
+
} }],
|
|
8965
|
+
destructive: false,
|
|
8966
|
+
requiresConfirmation: false,
|
|
8967
|
+
validators: ['validation-rule-canonical', 'context-validator-registered', 'metadata-round-trip'],
|
|
8968
|
+
affectedPaths: ['fieldMetadata.validators'],
|
|
8969
|
+
submissionImpact: 'affects-submission',
|
|
8970
|
+
preconditions: ['field-metadata-loaded'],
|
|
8971
|
+
},
|
|
8972
|
+
{
|
|
8973
|
+
operationId: 'contextHint.set',
|
|
8974
|
+
title: 'Set metadata context hint',
|
|
8975
|
+
scope: 'meta',
|
|
8976
|
+
targetKind: 'contextHint',
|
|
8977
|
+
target: { kind: 'contextHint', resolver: 'metadata-editor-context-hints', ambiguityPolicy: 'fail', required: false },
|
|
8978
|
+
inputSchema: {
|
|
8979
|
+
type: 'object',
|
|
8980
|
+
required: ['hintPath', 'value'],
|
|
8981
|
+
properties: {
|
|
8982
|
+
hintPath: { enum: ['hint', 'helpText', 'description', 'tooltip', 'ariaLabel', 'ariaDescribedBy'] },
|
|
8983
|
+
value: {},
|
|
8984
|
+
localeKey: { type: 'string' },
|
|
8985
|
+
},
|
|
8986
|
+
},
|
|
8987
|
+
effects: [{ kind: 'compile-domain-patch', handler: 'metadata-context-hint-set', handlerContract: {
|
|
8988
|
+
reads: ['fieldMetadata.hint', 'fieldMetadata.helpText', 'fieldMetadata.description', 'fieldMetadata.tooltip', 'fieldMetadata.ariaLabel', 'fieldMetadata.ariaDescribedBy', 'metadata-editor-i18n'],
|
|
8989
|
+
writes: ['fieldMetadata.hint', 'fieldMetadata.helpText', 'fieldMetadata.description', 'fieldMetadata.tooltip', 'fieldMetadata.ariaLabel', 'fieldMetadata.ariaDescribedBy'],
|
|
8990
|
+
identityKeys: ['field.name', 'hintPath'],
|
|
8991
|
+
inputSchema: { type: 'object', required: ['hintPath', 'value'], properties: { hintPath: { enum: ['hint', 'helpText', 'description', 'tooltip', 'ariaLabel', 'ariaDescribedBy'] }, value: {}, localeKey: { type: 'string' } } },
|
|
8992
|
+
failureModes: ['hint-path-not-canonical', 'hint-value-not-serializable', 'i18n-key-missing'],
|
|
8993
|
+
description: 'Sets structured FieldMetadata hint/help/accessibility text through canonical metadata paths and metadata-editor i18n constraints.',
|
|
8994
|
+
} }],
|
|
8995
|
+
destructive: false,
|
|
8996
|
+
requiresConfirmation: false,
|
|
8997
|
+
validators: ['context-hint-shape-canonical', 'context-hint-i18n-compatible', 'metadata-round-trip'],
|
|
8998
|
+
affectedPaths: ['fieldMetadata.hint', 'fieldMetadata.helpText', 'fieldMetadata.description', 'fieldMetadata.tooltip', 'fieldMetadata.ariaLabel', 'fieldMetadata.ariaDescribedBy'],
|
|
8999
|
+
submissionImpact: 'visual-only',
|
|
9000
|
+
preconditions: ['field-metadata-loaded'],
|
|
9001
|
+
},
|
|
9002
|
+
{
|
|
9003
|
+
operationId: 'normalization.apply',
|
|
9004
|
+
title: 'Apply schema normalization',
|
|
9005
|
+
scope: 'runtimeCoverage',
|
|
9006
|
+
targetKind: 'normalization',
|
|
9007
|
+
target: { kind: 'normalization', resolver: 'metadata-editor-schema-normalizer', ambiguityPolicy: 'fail', required: false },
|
|
9008
|
+
inputSchema: {
|
|
9009
|
+
type: 'object',
|
|
9010
|
+
properties: {
|
|
9011
|
+
mode: { enum: ['hydrate-seed', 'coerce-types', 'apply-defaults', 'preserve-advanced-properties'] },
|
|
9012
|
+
preserveUnknownCanonicalFields: { type: 'boolean' },
|
|
9013
|
+
},
|
|
9014
|
+
},
|
|
9015
|
+
effects: [{ kind: 'compile-domain-patch', handler: 'metadata-normalization-apply', handlerContract: {
|
|
9016
|
+
reads: ['SchemaNormalizerService', 'fieldMetadata', 'properties', 'DynamicFormFactoryService'],
|
|
9017
|
+
writes: ['normalizedSeed', 'form', 'fieldMetadata'],
|
|
9018
|
+
identityKeys: ['field.name', 'controlType', 'mode'],
|
|
9019
|
+
inputSchema: { type: 'object', properties: { mode: { enum: ['hydrate-seed', 'coerce-types', 'apply-defaults', 'preserve-advanced-properties'] }, preserveUnknownCanonicalFields: { type: 'boolean' } } },
|
|
9020
|
+
failureModes: ['normalizer-missing', 'type-coercion-failed', 'advanced-property-lost', 'runtime-editor-drift'],
|
|
9021
|
+
description: 'Runs metadata-editor schema normalization while preserving canonical advanced FieldMetadata properties and editor/runtime round-trip.',
|
|
9022
|
+
} }],
|
|
9023
|
+
destructive: false,
|
|
9024
|
+
requiresConfirmation: false,
|
|
9025
|
+
validators: ['normalization-preserves-canonical-fields', 'runtime-editor-round-trip', 'metadata-round-trip'],
|
|
9026
|
+
affectedPaths: ['normalizedSeed', 'form', 'fieldMetadata'],
|
|
9027
|
+
submissionImpact: 'config-only',
|
|
9028
|
+
preconditions: ['field-metadata-loaded', 'editor-properties-loaded'],
|
|
9029
|
+
},
|
|
9030
|
+
],
|
|
9031
|
+
validators: [
|
|
9032
|
+
{ validatorId: 'field-metadata-shape-canonical', level: 'error', code: 'METADATA_FIELD_SHAPE_CANONICAL', description: 'Edited metadata must remain compatible with canonical FieldMetadata.' },
|
|
9033
|
+
{ validatorId: 'field-path-supported-by-editor', level: 'error', code: 'METADATA_FIELD_PATH_SUPPORTED', description: 'Edited paths must be supported by visual editor coverage or explicitly delegated.' },
|
|
9034
|
+
{ validatorId: 'control-type-exists-in-discovery', level: 'error', code: 'METADATA_CONTROL_TYPE_DISCOVERED', description: 'Control type must exist in dynamic-fields discovery.' },
|
|
9035
|
+
{ validatorId: 'editor-coverage-exists', level: 'error', code: 'METADATA_EDITOR_COVERAGE_EXISTS', description: 'Control type and property must have metadata-editor coverage.' },
|
|
9036
|
+
{ validatorId: 'option-source-shape-canonical', level: 'error', code: 'METADATA_OPTION_SOURCE_CANONICAL', description: 'Option source must use canonical FieldMetadata/x-ui shape.' },
|
|
9037
|
+
{ validatorId: 'remote-option-source-governed', level: 'error', code: 'METADATA_REMOTE_OPTION_SOURCE_GOVERNED', description: 'Remote option sources must resolve through governed resource or endpoint metadata.' },
|
|
9038
|
+
{ validatorId: 'cascade-fields-exist', level: 'error', code: 'METADATA_CASCADE_FIELDS_EXIST', description: 'Cascade source and dependent fields must exist.' },
|
|
9039
|
+
{ validatorId: 'cascade-cycle-free', level: 'error', code: 'METADATA_CASCADE_CYCLE_FREE', description: 'Cascade dependencies must not create cycles.' },
|
|
9040
|
+
{ validatorId: 'cascade-backend-shape-preserved', level: 'error', code: 'METADATA_CASCADE_BACKEND_SHAPE_PRESERVED', description: 'Cascade config must preserve x-ui optionSource dependsOn and dependencyFilterMap semantics.' },
|
|
9041
|
+
{ validatorId: 'renderer-editor-type-registered', level: 'error', code: 'METADATA_RENDERER_TYPE_REGISTERED', description: 'Renderer editor type must be registered.' },
|
|
9042
|
+
{ validatorId: 'visual-editor-coverage-required', level: 'error', code: 'METADATA_VISUAL_COVERAGE_REQUIRED', description: 'JSON-only support is not accepted for required visual authoring coverage.' },
|
|
9043
|
+
{ validatorId: 'validation-rule-canonical', level: 'error', code: 'METADATA_VALIDATION_RULE_CANONICAL', description: 'Validation rule must use canonical metadata shape.' },
|
|
9044
|
+
{ validatorId: 'context-validator-registered', level: 'error', code: 'METADATA_CONTEXT_VALIDATOR_REGISTERED', description: 'Contextual validator must be registered before use.' },
|
|
9045
|
+
{ validatorId: 'context-hint-shape-canonical', level: 'error', code: 'METADATA_CONTEXT_HINT_CANONICAL', description: 'Context hints must remain structured metadata, not free-form host-only strings.' },
|
|
9046
|
+
{ validatorId: 'context-hint-i18n-compatible', level: 'warning', code: 'METADATA_CONTEXT_HINT_I18N_COMPATIBLE', description: 'Authoring hint text must remain compatible with metadata-editor i18n.' },
|
|
9047
|
+
{ validatorId: 'normalization-preserves-canonical-fields', level: 'error', code: 'METADATA_NORMALIZATION_PRESERVES_FIELDS', description: 'Normalization must not drop canonical advanced FieldMetadata properties.' },
|
|
9048
|
+
{ validatorId: 'runtime-editor-round-trip', level: 'error', code: 'METADATA_RUNTIME_EDITOR_ROUND_TRIP', description: 'Runtime and editor must consume the same normalized metadata shape.' },
|
|
9049
|
+
{ validatorId: 'metadata-round-trip', level: 'error', code: 'METADATA_ROUND_TRIP', description: 'Open, edit, apply/save, reopen and runtime consume must preserve metadata.' },
|
|
9050
|
+
],
|
|
9051
|
+
roundTripRequirements: [
|
|
9052
|
+
'FieldMetadata is the canonical edited document shape; backend x-ui-derived metadata must not be rewritten into host-only aliases.',
|
|
9053
|
+
'Control type changes require both dynamic-fields discovery and metadata-editor visual coverage.',
|
|
9054
|
+
'Option source cascades preserve x-ui optionSource.dependsOn and optionSource.dependencyFilterMap semantics.',
|
|
9055
|
+
'JSON-only support is incomplete when visual editor coverage is required.',
|
|
9056
|
+
'Schema normalization must preserve advanced canonical properties through open, edit, apply/save, reopen and runtime consumption.',
|
|
9057
|
+
],
|
|
9058
|
+
examples: [
|
|
9059
|
+
{ id: 'set-label', request: 'Set this field label to Customer name.', operationId: 'fieldMetadata.property.set', params: { path: 'label', value: 'Customer name' }, isPositive: true },
|
|
9060
|
+
{ id: 'set-control-type', request: 'Change this field to a select control.', operationId: 'controlType.set', params: { controlType: 'select', preserveCompatibleProperties: true }, isPositive: true },
|
|
9061
|
+
{ id: 'configure-remote-options', request: 'Load options from the customers resource using id and name.', operationId: 'optionSource.configure', params: { kind: 'resource', resource: 'customers', valueField: 'id', labelField: 'name' }, isPositive: true },
|
|
9062
|
+
{ id: 'configure-cascade', request: 'Filter city options when state changes.', operationId: 'cascade.configure', params: { dependentField: 'city', sourceField: 'state', dependencyFilterMap: { stateId: 'state.id' } }, isPositive: true },
|
|
9063
|
+
{ id: 'configure-renderer', request: 'Expose placeholder in the visual editor as a text field.', operationId: 'renderer.configure', params: { propertyName: 'placeholder', editorType: 'text', group: 'Presentation' }, isPositive: true },
|
|
9064
|
+
{ id: 'add-required-validation', request: 'Make this field required with a validation message.', operationId: 'validationRule.add', params: { rule: { type: 'required' }, message: 'Required field' }, isPositive: true },
|
|
9065
|
+
{ id: 'set-context-hint', request: 'Add a contextual hint for sales users.', operationId: 'contextHint.set', params: { hintPath: 'helpText', value: 'Use the legal customer name.' }, isPositive: true },
|
|
9066
|
+
{ id: 'normalize-seed', request: 'Normalize this imported field metadata while preserving advanced properties.', operationId: 'normalization.apply', params: { mode: 'preserve-advanced-properties', preserveUnknownCanonicalFields: true }, isPositive: true },
|
|
9067
|
+
{ id: 'reject-unknown-control', request: 'Use an unknown control type named magic-picker.', operationId: 'controlType.set', params: { controlType: 'magic-picker' }, isPositive: false },
|
|
9068
|
+
{ id: 'reject-json-only-coverage', request: 'Support this field only by editing raw JSON.', operationId: 'renderer.configure', params: { propertyName: 'optionSource', editorType: 'json' }, isPositive: false },
|
|
9069
|
+
{ id: 'reject-cascade-cycle', request: 'Make field A depend on B and B depend on A.', operationId: 'cascade.configure', params: { dependentField: 'a', sourceField: 'b' }, isPositive: false },
|
|
9070
|
+
{ id: 'reject-host-only-option-source', request: 'Save a host-only URL string as the option source.', operationId: 'optionSource.configure', params: { kind: 'remote', endpoint: 'local-only://options' }, isPositive: false },
|
|
9071
|
+
],
|
|
9072
|
+
};
|
|
9073
|
+
|
|
8727
9074
|
/** Metadata for Praxis Metadata Editor component */
|
|
8728
9075
|
const PRAXIS_METADATA_EDITOR_COMPONENT_METADATA = {
|
|
8729
9076
|
id: 'praxis-metadata-editor',
|
|
@@ -8778,4 +9125,4 @@ function providePraxisMetadataEditorMetadata() {
|
|
|
8778
9125
|
* Generated bundle index. Do not edit.
|
|
8779
9126
|
*/
|
|
8780
9127
|
|
|
8781
|
-
export { CascadeManagerTabComponent, CascadeRulesService, ConfigRegistryService, ContextValidatorRegistryService, DynamicEditorRendererComponent, DynamicFormFactoryService, EditorComponentRegistryService, FieldMetadataEditorComponent, METADATA_EDITOR_AI_CAPABILITIES, METADATA_EDITOR_AI_CAPABILITY_CATALOG, PRAXIS_METADATA_EDITOR_COMPONENT_METADATA, SchemaNormalizerService, providePraxisMetadataEditorMetadata };
|
|
9128
|
+
export { CascadeManagerTabComponent, CascadeRulesService, ConfigRegistryService, ContextValidatorRegistryService, DynamicEditorRendererComponent, DynamicFormFactoryService, EditorComponentRegistryService, FieldMetadataEditorComponent, METADATA_EDITOR_AI_CAPABILITIES, METADATA_EDITOR_AI_CAPABILITY_CATALOG, PRAXIS_METADATA_EDITOR_AUTHORING_MANIFEST, PRAXIS_METADATA_EDITOR_COMPONENT_METADATA, SchemaNormalizerService, providePraxisMetadataEditorMetadata };
|
package/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ValidatorFn, FormBuilder, FormGroup, AbstractControl } from '@angular/forms';
|
|
2
|
-
import { FieldControlType, FieldDefinition, FieldMetadata, IconPickerService, AiCapabilityCatalog, ComponentDocMeta } from '@praxisui/core';
|
|
2
|
+
import { FieldControlType, FieldDefinition, FieldMetadata, IconPickerService, AiCapabilityCatalog, ComponentAuthoringManifest, ComponentDocMeta } from '@praxisui/core';
|
|
3
3
|
import * as i0 from '@angular/core';
|
|
4
4
|
import { Type, OnChanges, SimpleChanges, OnInit, EventEmitter, Provider } from '@angular/core';
|
|
5
5
|
import { MatDialog } from '@angular/material/dialog';
|
|
@@ -300,10 +300,12 @@ interface AiComponentCapabilities {
|
|
|
300
300
|
declare const METADATA_EDITOR_AI_CAPABILITIES: AiComponentCapabilities;
|
|
301
301
|
declare const METADATA_EDITOR_AI_CAPABILITY_CATALOG: AiCapabilityCatalog;
|
|
302
302
|
|
|
303
|
+
declare const PRAXIS_METADATA_EDITOR_AUTHORING_MANIFEST: ComponentAuthoringManifest;
|
|
304
|
+
|
|
303
305
|
/** Metadata for Praxis Metadata Editor component */
|
|
304
306
|
declare const PRAXIS_METADATA_EDITOR_COMPONENT_METADATA: ComponentDocMeta;
|
|
305
307
|
/** Provider para auto-registrar metadados do componente Metadata Editor. */
|
|
306
308
|
declare function providePraxisMetadataEditorMetadata(): Provider;
|
|
307
309
|
|
|
308
|
-
export { CascadeManagerTabComponent, CascadeRulesService, ConfigRegistryService, ContextValidatorRegistryService, DynamicEditorRendererComponent, DynamicFormFactoryService, EditorComponentRegistryService, FieldMetadataEditorComponent, METADATA_EDITOR_AI_CAPABILITIES, METADATA_EDITOR_AI_CAPABILITY_CATALOG, PRAXIS_METADATA_EDITOR_COMPONENT_METADATA, SchemaNormalizerService, providePraxisMetadataEditorMetadata };
|
|
310
|
+
export { CascadeManagerTabComponent, CascadeRulesService, ConfigRegistryService, ContextValidatorRegistryService, DynamicEditorRendererComponent, DynamicFormFactoryService, EditorComponentRegistryService, FieldMetadataEditorComponent, METADATA_EDITOR_AI_CAPABILITIES, METADATA_EDITOR_AI_CAPABILITY_CATALOG, PRAXIS_METADATA_EDITOR_AUTHORING_MANIFEST, PRAXIS_METADATA_EDITOR_COMPONENT_METADATA, SchemaNormalizerService, providePraxisMetadataEditorMetadata };
|
|
309
311
|
export type { CascadeRuleViewModel, ConfigMap, EditorProperty };
|
package/package.json
CHANGED