@praxisui/metadata-editor 10.0.0-rc.4 → 10.0.0-rc.40

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@praxisui/metadata-editor",
3
- "version": "10.0.0-rc.4",
3
+ "version": "10.0.0-rc.40",
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.4",
12
- "@praxisui/core": "^10.0.0-rc.4",
13
- "@praxisui/dynamic-fields": "^10.0.0-rc.4",
14
- "@praxisui/settings-panel": "^10.0.0-rc.4",
11
+ "@praxisui/ai": "^10.0.0-rc.40",
12
+ "@praxisui/core": "^10.0.0-rc.40",
13
+ "@praxisui/dynamic-fields": "^10.0.0-rc.40",
14
+ "@praxisui/settings-panel": "^10.0.0-rc.40",
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;
@@ -208,9 +228,22 @@ declare class FieldMetadataEditorComponent implements OnInit {
208
228
  reset(): void;
209
229
  onControlTypeChange(next: FieldControlType): void;
210
230
  onControlTypeChangeEvent(event: Event): void;
231
+ tx(key: string, fallback: string): string;
232
+ private buildCurrentSemanticFieldSnapshot;
233
+ canCalibrateFromSemantics(): boolean;
234
+ calibrateFromSemantics(): void;
211
235
  private withSharedFieldMetadataProperties;
212
236
  get isArrayEditor(): boolean;
237
+ private static readonly ROOT_DEPENDENT_FIELD_KEY_PROPS;
238
+ private static readonly OPTION_SOURCE_DEPENDENT_FIELD_KEY_PROPS;
213
239
  private buildRenderedProps;
240
+ private enrichResourcePathProperty;
241
+ private enrichDependentFieldKeyProperty;
242
+ private normalizeResourceCacheKey;
243
+ private getCachedFieldsForResource;
244
+ private setCachedFieldsForResource;
245
+ private applyAutoSuggestedDependentKeys;
246
+ private selectSuggestedFieldKeys;
214
247
  private cloneSnapshot;
215
248
  private cloneMetadataValue;
216
249
  private canEmitSettingsValue;
@@ -265,13 +298,37 @@ interface CascadeRuleViewModel {
265
298
  dependencyDebounceMs?: number | null;
266
299
  dependencyLoadOnChange?: 'respectLoadOn' | 'immediate' | 'manual';
267
300
  }
301
+ interface CascadeCycleDiagnostic {
302
+ /** Ordered field names in the cycle, starting and ending with the same field (e.g. ['cargoId', 'departamentoId', 'cargoId']). */
303
+ path: string[];
304
+ /** Human-readable path with labels and field names (e.g. "Cargo (cargoId) → Departamento (departamentoId) → Cargo (cargoId)"). */
305
+ formattedPath: string;
306
+ /** True when a field directly references itself in dependencyFields. */
307
+ isSelfReference: boolean;
308
+ /** Actionable remediation message in analyst language. */
309
+ message: string;
310
+ }
311
+ interface CascadeGraphValidationResult {
312
+ valid: boolean;
313
+ cycles: CascadeCycleDiagnostic[];
314
+ fieldsInCycles: Set<string>;
315
+ }
268
316
  declare class CascadeRulesService {
269
317
  getFieldLabelMap(fields: Array<FieldDefinition | FieldMetadata>): Map<string, string>;
270
318
  hydrateRule(field: FieldDefinition | FieldMetadata): CascadeRuleViewModel | null;
271
319
  dehydratePatch(rule: CascadeRuleViewModel): Partial<FieldDefinition>;
272
320
  clearPatch(): Partial<FieldDefinition>;
273
- /** Suggest a basic mapping dep->dep and a default valuePath */
321
+ /** Fill missing mappings and value paths without replacing authored values. */
274
322
  suggest(rule: CascadeRuleViewModel, inferredValueKey?: string): CascadeRuleViewModel;
323
+ /**
324
+ * Validates the cascade dependency graph directly from an array of FieldMetadata/FieldDefinition.
325
+ */
326
+ validateFieldsCascadeGraph(fields: ReadonlyArray<FieldDefinition | FieldMetadata>): CascadeGraphValidationResult;
327
+ /**
328
+ * Detects self-references, direct cycles (A -> B -> A) and indirect cycles (A -> B -> C -> A),
329
+ * including graphs where fields have multiple parent dependencies.
330
+ */
331
+ validateCascadeGraph(rules: ReadonlyMap<string, CascadeRuleViewModel> | Record<string, CascadeRuleViewModel>, fields?: ReadonlyArray<FieldDefinition | FieldMetadata>): CascadeGraphValidationResult;
275
332
  private normalizeDependencyFields;
276
333
  static ɵfac: i0.ɵɵFactoryDeclaration<CascadeRulesService, never>;
277
334
  static ɵprov: i0.ɵɵInjectableDeclaration<CascadeRulesService>;
@@ -286,6 +343,7 @@ declare class CascadeManagerTabComponent implements OnChanges {
286
343
  }>;
287
344
  apply: EventEmitter<Record<string, Partial<FieldDefinition>>>;
288
345
  cancel: EventEmitter<void>;
346
+ validChange: EventEmitter<boolean>;
289
347
  searchTerm: string;
290
348
  private searchTimer;
291
349
  private searchValue;
@@ -299,20 +357,35 @@ declare class CascadeManagerTabComponent implements OnChanges {
299
357
  editLoadOn: 'respectLoadOn' | 'immediate' | 'manual';
300
358
  editDebounce: number | null;
301
359
  editValuePath: string;
302
- editFilterMapJson: string;
303
360
  importMode: boolean;
304
361
  importJson: string;
362
+ feedbackMessage: string;
363
+ feedbackTone: 'info' | 'error';
305
364
  editMapRows: Array<{
306
365
  dep: string;
307
366
  key: string;
308
367
  valuePath?: string;
309
368
  }>;
369
+ private editInitialFilterMap;
370
+ private editInitialValuePath;
371
+ private lastEmittedValid;
372
+ private setFeedback;
310
373
  constructor(svc: CascadeRulesService);
311
374
  ngOnInit(): void;
312
375
  ngOnChanges(changes: SimpleChanges): void;
313
- private _logCount;
314
376
  filteredFields(): Array<FieldDefinition | FieldMetadata>;
315
377
  labelFor(name: string): string;
378
+ /**
379
+ * Disambiguates fields that share the same display label (e.g. "Cargo" for both `cargoId` and `cargoNome`).
380
+ */
381
+ disambiguatedLabelFor(name: string): string;
382
+ hasRemoteOptionSource(name: string): boolean;
383
+ fieldRoleBadge(name: string): string;
384
+ fieldRoleSummary(name: string): string;
385
+ formatParentList(deps: string[]): string;
386
+ formatRelationshipSummary(targetField: string, deps: string[]): string;
387
+ formatLoadOnLabel(policy?: 'respectLoadOn' | 'immediate' | 'manual' | null): string;
388
+ formatMergeStrategyLabel(strategy?: 'merge' | 'replace' | null): string;
316
389
  selectedField(): string | null;
317
390
  selectField(name: string): void;
318
391
  hasRule(name: string): boolean;
@@ -320,10 +393,23 @@ declare class CascadeManagerTabComponent implements OnChanges {
320
393
  isCascadeEnabled(name: string): boolean;
321
394
  loadOnChange(name: string): 'respectLoadOn' | 'immediate' | 'manual';
322
395
  hasConflict(name: string): boolean;
396
+ /**
397
+ * Computes graph validation combining saved rules with any active draft in the inline editor.
398
+ */
399
+ validateCurrentGraph(includeDraft?: boolean): CascadeGraphValidationResult;
400
+ activeCycleDiagnostics(): CascadeCycleDiagnostic[];
401
+ isFieldInCycle(name: string): boolean;
402
+ hasBlockingErrors(): boolean;
403
+ private syncValidityState;
404
+ onDraftControlChange(): void;
323
405
  startEdit(name: string): void;
324
406
  edit(name: string): void;
325
407
  cancelEdit(): void;
326
408
  saveEdit(name: string): void;
409
+ /**
410
+ * Removes cyclic dependencies from the given field's draft (and saved rule if present).
411
+ */
412
+ breakCycleForField(name: string): void;
327
413
  remove(name: string): void;
328
414
  quickSet(name: string, action: 'disable' | 'manual'): void;
329
415
  private emitPatch;
@@ -335,6 +421,7 @@ declare class CascadeManagerTabComponent implements OnChanges {
335
421
  applyImport(): void;
336
422
  startTemplate(name: string, tpl: 'rota-destino' | 'rota-destino-propriedade'): void;
337
423
  buildMapRowsFromDeps(): void;
424
+ private initialRowValuePath;
338
425
  buildValuePathOverrides(deps: string[]): string | Record<string, string>;
339
426
  buildPreview(): string;
340
427
  copyPreview(): void;
@@ -343,7 +430,7 @@ declare class CascadeManagerTabComponent implements OnChanges {
343
430
  getKeySuggestions(dep: string): string[];
344
431
  getValuePathSuggestions(dep: string): string[];
345
432
  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>;
433
+ 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
434
  }
348
435
 
349
436
  /**
@@ -375,4 +462,4 @@ declare const PRAXIS_METADATA_EDITOR_COMPONENT_METADATA: ComponentDocMeta;
375
462
  declare function providePraxisMetadataEditorMetadata(): Provider;
376
463
 
377
464
  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 };
465
+ export type { CascadeCycleDiagnostic, CascadeGraphValidationResult, CascadeRuleViewModel, ConfigMap, EditorProperty };