@praxisui/metadata-editor 10.0.0-rc.6 → 10.0.0-rc.60
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 +7 -0
- package/ai/component-registry.json +281 -17
- package/fesm2022/praxisui-metadata-editor.mjs +3199 -394
- package/package.json +5 -5
- package/types/praxisui-metadata-editor.d.ts +95 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@praxisui/metadata-editor",
|
|
3
|
-
"version": "10.0.0-rc.
|
|
3
|
+
"version": "10.0.0-rc.60",
|
|
4
4
|
"description": "Metadata editor for Praxis UI fields and components with runtime integration.",
|
|
5
5
|
"peerDependencies": {
|
|
6
6
|
"@angular/common": "^21.0.0",
|
|
@@ -8,10 +8,10 @@
|
|
|
8
8
|
"@angular/cdk": "^21.0.0",
|
|
9
9
|
"@angular/forms": "^21.0.0",
|
|
10
10
|
"@angular/material": "^21.0.0",
|
|
11
|
-
"@praxisui/ai": "^10.0.0-rc.
|
|
12
|
-
"@praxisui/core": "^10.0.0-rc.
|
|
13
|
-
"@praxisui/dynamic-fields": "^10.0.0-rc.
|
|
14
|
-
"@praxisui/settings-panel": "^10.0.0-rc.
|
|
11
|
+
"@praxisui/ai": "^10.0.0-rc.60",
|
|
12
|
+
"@praxisui/core": "^10.0.0-rc.60",
|
|
13
|
+
"@praxisui/dynamic-fields": "^10.0.0-rc.60",
|
|
14
|
+
"@praxisui/settings-panel": "^10.0.0-rc.60",
|
|
15
15
|
"rxjs": "~7.8.0"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
@@ -22,6 +22,11 @@ interface EditorProperty {
|
|
|
22
22
|
value: any;
|
|
23
23
|
text: string;
|
|
24
24
|
textKey?: string;
|
|
25
|
+
icon?: string;
|
|
26
|
+
code?: string | null;
|
|
27
|
+
badge?: string | null;
|
|
28
|
+
description?: string | null;
|
|
29
|
+
searchTerms?: string[];
|
|
25
30
|
}> | {
|
|
26
31
|
type: 'static' | 'http' | 'fn';
|
|
27
32
|
config?: any;
|
|
@@ -154,7 +159,11 @@ declare class FieldMetadataEditorComponent implements OnInit {
|
|
|
154
159
|
normalizedProps: any[];
|
|
155
160
|
renderedProps: any[];
|
|
156
161
|
private initialSnapshot;
|
|
162
|
+
private initialControlType?;
|
|
163
|
+
private initialSeed?;
|
|
157
164
|
private baselineReady;
|
|
165
|
+
private readonly formRebuild$;
|
|
166
|
+
private readonly hostApplyPatch?;
|
|
158
167
|
typeOptions: Array<{
|
|
159
168
|
value: FieldControlType;
|
|
160
169
|
label: string;
|
|
@@ -163,9 +172,20 @@ declare class FieldMetadataEditorComponent implements OnInit {
|
|
|
163
172
|
isValid$: BehaviorSubject<boolean>;
|
|
164
173
|
isBusy$: BehaviorSubject<boolean>;
|
|
165
174
|
private readonly destroyRef;
|
|
175
|
+
private readonly resourceDiscovery;
|
|
176
|
+
private readonly i18n;
|
|
177
|
+
private discoveredResourceOptions;
|
|
166
178
|
private lastCurrencyPreset;
|
|
167
179
|
constructor(registry: ConfigRegistryService, normalizer: SchemaNormalizerService, factory: DynamicFormFactoryService, ctxValidators: ContextValidatorRegistryService);
|
|
180
|
+
private catalogLookupRequested;
|
|
181
|
+
private readonly resourceSchemaFieldsByPath;
|
|
182
|
+
private readonly resourceSchemaRequestIdByScope;
|
|
168
183
|
ngOnInit(): void;
|
|
184
|
+
private loadCatalogResourceOptionsIfNeeded;
|
|
185
|
+
private resolveDiscoveryEndpointKey;
|
|
186
|
+
private bindResourcePathSchemaSync;
|
|
187
|
+
private seedCatalogResponseFieldsCache;
|
|
188
|
+
private resolveAndApplyResourceSchemaFields;
|
|
169
189
|
private resolveCanonicalEditorProperties;
|
|
170
190
|
private rebuildEditorForType;
|
|
171
191
|
private setupGradientStopValidationSync;
|
|
@@ -189,6 +209,9 @@ declare class FieldMetadataEditorComponent implements OnInit {
|
|
|
189
209
|
private normalizeStringListProperty;
|
|
190
210
|
private normalizeJsonObjectProperty;
|
|
191
211
|
private normalizeJsonArrayProperty;
|
|
212
|
+
private normalizeStrictJsonArrayProperty;
|
|
213
|
+
private normalizeQuickPresetsProperty;
|
|
214
|
+
private normalizeJsonArrayOrObjectProperty;
|
|
192
215
|
private normalizeArrayPatchValues;
|
|
193
216
|
private normalizeArrayCountRuleValue;
|
|
194
217
|
private toEditorControlValue;
|
|
@@ -208,9 +231,22 @@ declare class FieldMetadataEditorComponent implements OnInit {
|
|
|
208
231
|
reset(): void;
|
|
209
232
|
onControlTypeChange(next: FieldControlType): void;
|
|
210
233
|
onControlTypeChangeEvent(event: Event): void;
|
|
234
|
+
tx(key: string, fallback: string): string;
|
|
235
|
+
private buildCurrentSemanticFieldSnapshot;
|
|
236
|
+
canCalibrateFromSemantics(): boolean;
|
|
237
|
+
calibrateFromSemantics(): void;
|
|
211
238
|
private withSharedFieldMetadataProperties;
|
|
212
239
|
get isArrayEditor(): boolean;
|
|
240
|
+
private static readonly ROOT_DEPENDENT_FIELD_KEY_PROPS;
|
|
241
|
+
private static readonly OPTION_SOURCE_DEPENDENT_FIELD_KEY_PROPS;
|
|
213
242
|
private buildRenderedProps;
|
|
243
|
+
private enrichResourcePathProperty;
|
|
244
|
+
private enrichDependentFieldKeyProperty;
|
|
245
|
+
private normalizeResourceCacheKey;
|
|
246
|
+
private getCachedFieldsForResource;
|
|
247
|
+
private setCachedFieldsForResource;
|
|
248
|
+
private applyAutoSuggestedDependentKeys;
|
|
249
|
+
private selectSuggestedFieldKeys;
|
|
214
250
|
private cloneSnapshot;
|
|
215
251
|
private cloneMetadataValue;
|
|
216
252
|
private canEmitSettingsValue;
|
|
@@ -265,13 +301,37 @@ interface CascadeRuleViewModel {
|
|
|
265
301
|
dependencyDebounceMs?: number | null;
|
|
266
302
|
dependencyLoadOnChange?: 'respectLoadOn' | 'immediate' | 'manual';
|
|
267
303
|
}
|
|
304
|
+
interface CascadeCycleDiagnostic {
|
|
305
|
+
/** Ordered field names in the cycle, starting and ending with the same field (e.g. ['cargoId', 'departamentoId', 'cargoId']). */
|
|
306
|
+
path: string[];
|
|
307
|
+
/** Human-readable path with labels and field names (e.g. "Cargo (cargoId) → Departamento (departamentoId) → Cargo (cargoId)"). */
|
|
308
|
+
formattedPath: string;
|
|
309
|
+
/** True when a field directly references itself in dependencyFields. */
|
|
310
|
+
isSelfReference: boolean;
|
|
311
|
+
/** Actionable remediation message in analyst language. */
|
|
312
|
+
message: string;
|
|
313
|
+
}
|
|
314
|
+
interface CascadeGraphValidationResult {
|
|
315
|
+
valid: boolean;
|
|
316
|
+
cycles: CascadeCycleDiagnostic[];
|
|
317
|
+
fieldsInCycles: Set<string>;
|
|
318
|
+
}
|
|
268
319
|
declare class CascadeRulesService {
|
|
269
320
|
getFieldLabelMap(fields: Array<FieldDefinition | FieldMetadata>): Map<string, string>;
|
|
270
321
|
hydrateRule(field: FieldDefinition | FieldMetadata): CascadeRuleViewModel | null;
|
|
271
322
|
dehydratePatch(rule: CascadeRuleViewModel): Partial<FieldDefinition>;
|
|
272
323
|
clearPatch(): Partial<FieldDefinition>;
|
|
273
|
-
/**
|
|
324
|
+
/** Fill missing mappings and value paths without replacing authored values. */
|
|
274
325
|
suggest(rule: CascadeRuleViewModel, inferredValueKey?: string): CascadeRuleViewModel;
|
|
326
|
+
/**
|
|
327
|
+
* Validates the cascade dependency graph directly from an array of FieldMetadata/FieldDefinition.
|
|
328
|
+
*/
|
|
329
|
+
validateFieldsCascadeGraph(fields: ReadonlyArray<FieldDefinition | FieldMetadata>): CascadeGraphValidationResult;
|
|
330
|
+
/**
|
|
331
|
+
* Detects self-references, direct cycles (A -> B -> A) and indirect cycles (A -> B -> C -> A),
|
|
332
|
+
* including graphs where fields have multiple parent dependencies.
|
|
333
|
+
*/
|
|
334
|
+
validateCascadeGraph(rules: ReadonlyMap<string, CascadeRuleViewModel> | Record<string, CascadeRuleViewModel>, fields?: ReadonlyArray<FieldDefinition | FieldMetadata>): CascadeGraphValidationResult;
|
|
275
335
|
private normalizeDependencyFields;
|
|
276
336
|
static ɵfac: i0.ɵɵFactoryDeclaration<CascadeRulesService, never>;
|
|
277
337
|
static ɵprov: i0.ɵɵInjectableDeclaration<CascadeRulesService>;
|
|
@@ -286,6 +346,7 @@ declare class CascadeManagerTabComponent implements OnChanges {
|
|
|
286
346
|
}>;
|
|
287
347
|
apply: EventEmitter<Record<string, Partial<FieldDefinition>>>;
|
|
288
348
|
cancel: EventEmitter<void>;
|
|
349
|
+
validChange: EventEmitter<boolean>;
|
|
289
350
|
searchTerm: string;
|
|
290
351
|
private searchTimer;
|
|
291
352
|
private searchValue;
|
|
@@ -299,20 +360,35 @@ declare class CascadeManagerTabComponent implements OnChanges {
|
|
|
299
360
|
editLoadOn: 'respectLoadOn' | 'immediate' | 'manual';
|
|
300
361
|
editDebounce: number | null;
|
|
301
362
|
editValuePath: string;
|
|
302
|
-
editFilterMapJson: string;
|
|
303
363
|
importMode: boolean;
|
|
304
364
|
importJson: string;
|
|
365
|
+
feedbackMessage: string;
|
|
366
|
+
feedbackTone: 'info' | 'error';
|
|
305
367
|
editMapRows: Array<{
|
|
306
368
|
dep: string;
|
|
307
369
|
key: string;
|
|
308
370
|
valuePath?: string;
|
|
309
371
|
}>;
|
|
372
|
+
private editInitialFilterMap;
|
|
373
|
+
private editInitialValuePath;
|
|
374
|
+
private lastEmittedValid;
|
|
375
|
+
private setFeedback;
|
|
310
376
|
constructor(svc: CascadeRulesService);
|
|
311
377
|
ngOnInit(): void;
|
|
312
378
|
ngOnChanges(changes: SimpleChanges): void;
|
|
313
|
-
private _logCount;
|
|
314
379
|
filteredFields(): Array<FieldDefinition | FieldMetadata>;
|
|
315
380
|
labelFor(name: string): string;
|
|
381
|
+
/**
|
|
382
|
+
* Disambiguates fields that share the same display label (e.g. "Cargo" for both `cargoId` and `cargoNome`).
|
|
383
|
+
*/
|
|
384
|
+
disambiguatedLabelFor(name: string): string;
|
|
385
|
+
hasRemoteOptionSource(name: string): boolean;
|
|
386
|
+
fieldRoleBadge(name: string): string;
|
|
387
|
+
fieldRoleSummary(name: string): string;
|
|
388
|
+
formatParentList(deps: string[]): string;
|
|
389
|
+
formatRelationshipSummary(targetField: string, deps: string[]): string;
|
|
390
|
+
formatLoadOnLabel(policy?: 'respectLoadOn' | 'immediate' | 'manual' | null): string;
|
|
391
|
+
formatMergeStrategyLabel(strategy?: 'merge' | 'replace' | null): string;
|
|
316
392
|
selectedField(): string | null;
|
|
317
393
|
selectField(name: string): void;
|
|
318
394
|
hasRule(name: string): boolean;
|
|
@@ -320,10 +396,23 @@ declare class CascadeManagerTabComponent implements OnChanges {
|
|
|
320
396
|
isCascadeEnabled(name: string): boolean;
|
|
321
397
|
loadOnChange(name: string): 'respectLoadOn' | 'immediate' | 'manual';
|
|
322
398
|
hasConflict(name: string): boolean;
|
|
399
|
+
/**
|
|
400
|
+
* Computes graph validation combining saved rules with any active draft in the inline editor.
|
|
401
|
+
*/
|
|
402
|
+
validateCurrentGraph(includeDraft?: boolean): CascadeGraphValidationResult;
|
|
403
|
+
activeCycleDiagnostics(): CascadeCycleDiagnostic[];
|
|
404
|
+
isFieldInCycle(name: string): boolean;
|
|
405
|
+
hasBlockingErrors(): boolean;
|
|
406
|
+
private syncValidityState;
|
|
407
|
+
onDraftControlChange(): void;
|
|
323
408
|
startEdit(name: string): void;
|
|
324
409
|
edit(name: string): void;
|
|
325
410
|
cancelEdit(): void;
|
|
326
411
|
saveEdit(name: string): void;
|
|
412
|
+
/**
|
|
413
|
+
* Removes cyclic dependencies from the given field's draft (and saved rule if present).
|
|
414
|
+
*/
|
|
415
|
+
breakCycleForField(name: string): void;
|
|
327
416
|
remove(name: string): void;
|
|
328
417
|
quickSet(name: string, action: 'disable' | 'manual'): void;
|
|
329
418
|
private emitPatch;
|
|
@@ -335,6 +424,7 @@ declare class CascadeManagerTabComponent implements OnChanges {
|
|
|
335
424
|
applyImport(): void;
|
|
336
425
|
startTemplate(name: string, tpl: 'rota-destino' | 'rota-destino-propriedade'): void;
|
|
337
426
|
buildMapRowsFromDeps(): void;
|
|
427
|
+
private initialRowValuePath;
|
|
338
428
|
buildValuePathOverrides(deps: string[]): string | Record<string, string>;
|
|
339
429
|
buildPreview(): string;
|
|
340
430
|
copyPreview(): void;
|
|
@@ -343,7 +433,7 @@ declare class CascadeManagerTabComponent implements OnChanges {
|
|
|
343
433
|
getKeySuggestions(dep: string): string[];
|
|
344
434
|
getValuePathSuggestions(dep: string): string[];
|
|
345
435
|
static ɵfac: i0.ɵɵFactoryDeclaration<CascadeManagerTabComponent, never>;
|
|
346
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<CascadeManagerTabComponent, "praxis-cascade-manager-tab", never, { "fields": { "alias": "fields"; "required": false; }; "connections": { "alias": "connections"; "required": false; }; }, { "apply": "apply"; "cancel": "cancel"; }, never, never, true, never>;
|
|
436
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<CascadeManagerTabComponent, "praxis-cascade-manager-tab", never, { "fields": { "alias": "fields"; "required": false; }; "connections": { "alias": "connections"; "required": false; }; }, { "apply": "apply"; "cancel": "cancel"; "validChange": "validChange"; }, never, never, true, never>;
|
|
347
437
|
}
|
|
348
438
|
|
|
349
439
|
/**
|
|
@@ -375,4 +465,4 @@ declare const PRAXIS_METADATA_EDITOR_COMPONENT_METADATA: ComponentDocMeta;
|
|
|
375
465
|
declare function providePraxisMetadataEditorMetadata(): Provider;
|
|
376
466
|
|
|
377
467
|
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, ReactiveDeterminationDiagnosticsComponent, SchemaNormalizerService, providePraxisMetadataEditorMetadata };
|
|
378
|
-
export type { CascadeRuleViewModel, ConfigMap, EditorProperty };
|
|
468
|
+
export type { CascadeCycleDiagnostic, CascadeGraphValidationResult, CascadeRuleViewModel, ConfigMap, EditorProperty };
|