@praxisui/metadata-editor 1.0.0-beta.30 → 1.0.0-beta.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/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { ValidatorFn, FormBuilder, FormGroup, AbstractControl } from '@angular/forms';
2
- import { FieldControlType, FieldDefinition, FieldMetadata, IconPickerService } from '@praxisui/core';
2
+ import { FieldControlType, FieldDefinition, FieldMetadata, IconPickerService, AiCapabilityCatalog } from '@praxisui/core';
3
3
  import * as i0 from '@angular/core';
4
4
  import { Type, OnChanges, SimpleChanges, OnInit, EventEmitter } from '@angular/core';
5
5
  import { MatDialog } from '@angular/material/dialog';
@@ -88,9 +88,6 @@ declare class EditorComponentRegistryService {
88
88
  declare class DynamicEditorRendererComponent implements OnChanges {
89
89
  private dialog;
90
90
  private iconPicker;
91
- /** Força todos os campos a ocuparem 100% da largura do container. */
92
- fullWidth: boolean;
93
- get fullwidthClass(): boolean;
94
91
  properties: EditorProperty[];
95
92
  form: FormGroup;
96
93
  fields: FieldMetadata[];
@@ -107,10 +104,12 @@ declare class DynamicEditorRendererComponent implements OnChanges {
107
104
  groupIcon(group: string): string;
108
105
  constructor(dialog: MatDialog, iconPicker: IconPickerService);
109
106
  isIconField(path: string): boolean;
107
+ useHelpSuffix(field: FieldMetadata): boolean;
108
+ private isSuffixCapable;
110
109
  openRegexHelp(): void;
111
110
  openIconPicker(path: string): Promise<void>;
112
111
  static ɵfac: i0.ɵɵFactoryDeclaration<DynamicEditorRendererComponent, never>;
113
- static ɵcmp: i0.ɵɵComponentDeclaration<DynamicEditorRendererComponent, "praxis-dynamic-editor-renderer", never, { "fullWidth": { "alias": "fullWidth"; "required": false; }; "properties": { "alias": "properties"; "required": false; }; "form": { "alias": "form"; "required": false; }; }, {}, never, never, true, never>;
112
+ static ɵcmp: i0.ɵɵComponentDeclaration<DynamicEditorRendererComponent, "praxis-dynamic-editor-renderer", never, { "properties": { "alias": "properties"; "required": false; }; "form": { "alias": "form"; "required": false; }; }, {}, never, never, true, never>;
114
113
  }
115
114
 
116
115
  declare class FieldMetadataEditorComponent implements OnInit {
@@ -124,7 +123,6 @@ declare class FieldMetadataEditorComponent implements OnInit {
124
123
  cancel: EventEmitter<void>;
125
124
  form: FormGroup;
126
125
  normalizedProps: any[];
127
- fullWidth: boolean;
128
126
  private initialSnapshot;
129
127
  private baselineReady;
130
128
  typeOptions: Array<{
@@ -134,17 +132,39 @@ declare class FieldMetadataEditorComponent implements OnInit {
134
132
  isDirty$: BehaviorSubject<boolean>;
135
133
  isValid$: BehaviorSubject<boolean>;
136
134
  isBusy$: BehaviorSubject<boolean>;
135
+ private readonly destroyRef;
136
+ private lastCurrencyPreset;
137
137
  constructor(registry: ConfigRegistryService, normalizer: SchemaNormalizerService, factory: DynamicFormFactoryService, ctxValidators: ContextValidatorRegistryService);
138
138
  ngOnInit(): void;
139
139
  private rebuildEditorForType;
140
+ private setupCurrencyPresetSync;
140
141
  apply(): void;
141
142
  onSave(): Partial<FieldDefinition> | undefined;
142
143
  getSettingsValue(): Partial<FieldDefinition>;
143
144
  /**
144
145
  * Constrói um patch delta a partir do valor atual do form, removendo
145
- * chaves não alteradas e valores nulos/strings vazias (exceto boolean/zero).
146
+ * chaves não alteradas.
147
+ * Semântica de patch: `null` representa remoção da propriedade (JSON Merge Patch).
146
148
  */
147
149
  private buildDeltaPatch;
150
+ /**
151
+ * Converte campos de textarea conhecidos para o tipo esperado em runtime.
152
+ * Evita persistir strings cruas quando o componente espera arrays.
153
+ */
154
+ private normalizeKnownTextareaPatchValues;
155
+ /**
156
+ * Interpreta textarea como lista simples de strings:
157
+ * - JSON array de strings
158
+ * - fallback linha a linha (um valor por linha)
159
+ */
160
+ private parseStringListTextarea;
161
+ /**
162
+ * Interpreta textarea como array:
163
+ * - JSON array (preferencial)
164
+ * - fallback linha a linha para array de strings
165
+ */
166
+ private parseArrayTextarea;
167
+ private tryParseJson;
148
168
  reset(): void;
149
169
  onControlTypeChange(next: FieldControlType): void;
150
170
  onControlTypeChangeEvent(event: Event): void;
@@ -188,7 +208,7 @@ declare class CascadeManagerTabComponent implements OnChanges {
188
208
  private readonly rules;
189
209
  private readonly selectedFieldSig;
190
210
  readonly editing: i0.WritableSignal<boolean>;
191
- editDepCsv: string;
211
+ editDepList: string[];
192
212
  editEnable: boolean;
193
213
  editReset: boolean;
194
214
  editMerge: 'merge' | 'replace';
@@ -206,6 +226,7 @@ declare class CascadeManagerTabComponent implements OnChanges {
206
226
  constructor(svc: CascadeRulesService);
207
227
  ngOnInit(): void;
208
228
  ngOnChanges(changes: SimpleChanges): void;
229
+ private _logCount;
209
230
  filteredFields(): Array<FieldDefinition | FieldMetadata>;
210
231
  labelFor(name: string): string;
211
232
  selectedField(): string | null;
@@ -233,9 +254,34 @@ declare class CascadeManagerTabComponent implements OnChanges {
233
254
  buildValuePathOverrides(deps: string[]): string | Record<string, string>;
234
255
  buildPreview(): string;
235
256
  copyPreview(): void;
257
+ availableDependencyFields(): Array<FieldDefinition | FieldMetadata>;
258
+ onDepListChange(): void;
259
+ getKeySuggestions(dep: string): string[];
260
+ getValuePathSuggestions(dep: string): string[];
236
261
  static ɵfac: i0.ɵɵFactoryDeclaration<CascadeManagerTabComponent, never>;
237
262
  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>;
238
263
  }
239
264
 
240
- export { CascadeManagerTabComponent, CascadeRulesService, ConfigRegistryService, ContextValidatorRegistryService, DynamicEditorRendererComponent, DynamicFormFactoryService, EditorComponentRegistryService, FieldMetadataEditorComponent, SchemaNormalizerService };
265
+ /**
266
+ * Catálogo inicial de capacidades do editor de metadados (praxis-metadata-editor) para uso pela IA.
267
+ * Estrutura básica com Alvo e propriedades placeholder; expandir conforme implementação evoluir.
268
+ */
269
+
270
+ interface AiComponentProperty {
271
+ name: string;
272
+ type: string;
273
+ description: string;
274
+ intentExamples?: string[];
275
+ safetyNotes?: string;
276
+ }
277
+ interface AiComponentCapabilities {
278
+ componentId: string;
279
+ description: string;
280
+ targets: string[];
281
+ properties: AiComponentProperty[];
282
+ }
283
+ declare const METADATA_EDITOR_AI_CAPABILITIES: AiComponentCapabilities;
284
+ declare const METADATA_EDITOR_AI_CAPABILITY_CATALOG: AiCapabilityCatalog;
285
+
286
+ export { CascadeManagerTabComponent, CascadeRulesService, ConfigRegistryService, ContextValidatorRegistryService, DynamicEditorRendererComponent, DynamicFormFactoryService, EditorComponentRegistryService, FieldMetadataEditorComponent, METADATA_EDITOR_AI_CAPABILITIES, METADATA_EDITOR_AI_CAPABILITY_CATALOG, SchemaNormalizerService };
241
287
  export type { CascadeRuleViewModel, ConfigMap, EditorProperty };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@praxisui/metadata-editor",
3
- "version": "1.0.0-beta.30",
3
+ "version": "1.0.0-beta.40",
4
4
  "description": "Metadata editor for Praxis UI fields and components with runtime integration.",
5
5
  "peerDependencies": {
6
6
  "@angular/common": "^20.0.0",