@praxisui/metadata-editor 10.0.0-rc.7 → 10.0.0-rc.70

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