@praxisui/dynamic-form 8.0.0-beta.17 → 8.0.0-beta.19

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
@@ -7,12 +7,12 @@ import { MatDialog } from '@angular/material/dialog';
7
7
  import { MatSnackBar } from '@angular/material/snack-bar';
8
8
  import { CdkDragStart, CdkDragMove, CdkDragEnd, CdkDragDrop } from '@angular/cdk/drag-drop';
9
9
  import * as _praxisui_core from '@praxisui/core';
10
- import { AsyncConfigStorage, FormLayout, FieldMetadata, FormLayoutRule, FormRuleTargetType as FormRuleTargetType$1, PraxisJsonLogicService, FormSection, FormRow, FormColumn, FormConfig, FormLayoutItem, FormActionButton, AiCapability, BackConfig, ApiEndpoint, ApiUrlEntry, FormHooksLayout, EndpointConfig, FormSubmitEvent, FormReadyEvent, FormValueChangeEvent, SyncResult, FormInitializationError, LoadingState, FormCustomActionEvent, FormActionConfirmationEvent, RichContentDocument, JsonLogicRecord, GenericCrudService, ConnectionStorage, DynamicFormService, ErrorMessageService, SchemaNormalizerService, ComponentMetadataRegistry, GlobalConfigService, ComponentKeyService, LoadingOrchestrator, ApiUrlConfig, PraxisLoadingRenderer, FormHooksRegistry, FormHookPreset, LoggerService, FormSectionHeaderAction, FormSectionHeaderConfig, FormConfigState, GlobalActionCatalogEntry, FieldDefinition, ComponentDocMeta, Breakpoint, IconPickerService, GlobalActionRef, SurfaceOpenPayload, AiCapabilityCategory, AiValueKind, AiCapabilityCatalog, ComponentAuthoringManifest } from '@praxisui/core';
10
+ import { AsyncConfigStorage, FormLayout, FieldMetadata, FormLayoutRule, FormRuleTargetType as FormRuleTargetType$1, PraxisJsonLogicService, FormSection, FormRow, FormColumn, FormConfig, FormLayoutItem, FormActionButton, AiCapability, BackConfig, ApiEndpoint, ApiUrlEntry, FormHooksLayout, EndpointConfig, FormSubmitEvent, FormReadyEvent, FormValueChangeEvent, SyncResult, FormInitializationError, LoadingState, FormCustomActionEvent, FormActionConfirmationEvent, RichContentDocument, JsonLogicRecord, GenericCrudService, ConnectionStorage, DynamicFormService, ErrorMessageService, SchemaNormalizerService, ComponentMetadataRegistry, GlobalConfigService, ComponentKeyService, LoadingOrchestrator, ApiUrlConfig, PraxisLoadingRenderer, FormHooksRegistry, FormHookPreset, LoggerService, FormSectionHeaderAction, FormSectionHeaderConfig, FormConfigState, GlobalActionCatalogEntry, FieldDefinition, ComponentDocMeta, Breakpoint, DomainRuleRequestOptions, DomainRuleService, DomainRuleMaterialization, IconPickerService, GlobalActionRef, SurfaceOpenPayload, AiCapabilityCategory, AiValueKind, AiCapabilityCatalog, ComponentAuthoringManifest } from '@praxisui/core';
11
11
  import * as rxjs from 'rxjs';
12
12
  import { Observable, BehaviorSubject } from 'rxjs';
13
13
  import { SettingsPanelService, SettingsValueProvider } from '@praxisui/settings-panel';
14
14
  import { KeyboardShortcutService } from '@praxisui/dynamic-fields';
15
- import { BaseAiAdapter, PatchResult } from '@praxisui/ai';
15
+ import { BaseAiAdapter, AiResponseCompileResult, PatchResult } from '@praxisui/ai';
16
16
  import { RuleBuilderConfig, RuleBuilderState } from '@praxisui/visual-builder';
17
17
 
18
18
  declare class FormLayoutService {
@@ -44,6 +44,15 @@ declare class FormContextService {
44
44
  static ɵprov: i0.ɵɵInjectableDeclaration<FormContextService>;
45
45
  }
46
46
 
47
+ type RuleApplicationDiagnosticCode = 'missing-targets' | 'missing-effect' | 'unsupported-target-type' | 'field-target-not-found' | 'target-not-found' | 'invalid-condition' | 'unsupported-property' | 'rule-evaluation-error';
48
+ interface RuleApplicationDiagnostic {
49
+ ruleId?: string;
50
+ ruleName?: string;
51
+ code: RuleApplicationDiagnosticCode;
52
+ targetType?: FormLayoutRule['targetType'];
53
+ targetId?: string;
54
+ details?: string[];
55
+ }
47
56
  /**
48
57
  * Structured properties resulting from rule evaluation.
49
58
  */
@@ -54,6 +63,12 @@ interface RuleApplicationResult {
54
63
  rowProps: Record<string, Record<string, any>>;
55
64
  columnProps: Record<string, Record<string, any>>;
56
65
  visualBlockProps: Record<string, Record<string, any>>;
66
+ diagnostics: RuleApplicationDiagnostic[];
67
+ }
68
+ type RuleApplicationTargetType = NonNullable<FormLayoutRule['targetType']>;
69
+ type RuleApplicationTargetIndex = Partial<Record<RuleApplicationTargetType, ReadonlySet<string>>>;
70
+ interface RuleApplicationContext {
71
+ targetIndex?: RuleApplicationTargetIndex;
57
72
  }
58
73
  declare class FormRulesService {
59
74
  private readonly jsonLogic;
@@ -65,8 +80,11 @@ declare class FormRulesService {
65
80
  * @param formRules The array of rules to process.
66
81
  * @returns A RuleEvaluationResult object containing the visibility and required states for the fields.
67
82
  */
68
- applyRules(formGroup: FormGroup, formRules: FormLayoutRule[]): RuleApplicationResult;
83
+ applyRules(formGroup: FormGroup, formRules: FormLayoutRule[], context?: RuleApplicationContext): RuleApplicationResult;
84
+ private ruleTargetExists;
85
+ private normalizeRuleTargetId;
69
86
  private evaluateCondition;
87
+ private addUnsupportedPropertyDiagnostics;
70
88
  private setPath;
71
89
  private deletePath;
72
90
  static ɵfac: i0.ɵɵFactoryDeclaration<FormRulesService, never>;
@@ -159,6 +177,23 @@ interface ValidationReport {
159
177
  valid: boolean;
160
178
  errors: string[];
161
179
  }
180
+ type LocalFieldInsertionDiagnosticCode = 'missing-field-name' | 'missing-control-type' | 'field-name-already-exists' | 'schema-field-name-collision' | 'invalid-local-field-source';
181
+ interface LocalFieldInsertionDiagnostic {
182
+ code: LocalFieldInsertionDiagnosticCode;
183
+ severity: 'error' | 'warning';
184
+ message: string;
185
+ fieldName?: string;
186
+ }
187
+ interface InsertLocalFieldOptions {
188
+ atIndex?: number;
189
+ schemaFieldNames?: Iterable<string>;
190
+ correlationId?: string;
191
+ origin?: string;
192
+ }
193
+ interface InsertLocalFieldResult extends LayoutResult {
194
+ applied: boolean;
195
+ diagnostics: LocalFieldInsertionDiagnostic[];
196
+ }
162
197
  declare class DynamicFormLayoutService {
163
198
  private readonly changesSubject;
164
199
  readonly changes$: rxjs.Observable<LayoutChange>;
@@ -246,11 +281,18 @@ declare class DynamicFormLayoutService {
246
281
  rowId: string;
247
282
  columnId: string;
248
283
  }, field: any, atIndex?: number): LayoutResult;
284
+ insertLocalFieldById(config: FormConfig, target: {
285
+ sectionId: string;
286
+ rowId: string;
287
+ columnId: string;
288
+ }, field: FieldMetadata, options?: InsertLocalFieldOptions): InsertLocalFieldResult;
249
289
  insertLayoutItemById(config: FormConfig, target: {
250
290
  sectionId: string;
251
291
  rowId: string;
252
292
  columnId: string;
253
293
  }, item: FormLayoutItem, atIndex?: number): LayoutResult;
294
+ private prepareLocalFieldMetadata;
295
+ private validateLocalFieldInsertion;
254
296
  moveLayoutItemById(config: FormConfig, from: {
255
297
  sectionId: string;
256
298
  rowId: string;
@@ -417,13 +459,25 @@ declare class FormAiAdapter extends BaseAiAdapter<FormConfig> {
417
459
  getCapabilities(): AiCapability[];
418
460
  getTaskPresets(): Record<string, string[]>;
419
461
  getRuntimeState(): Record<string, any>;
462
+ getAuthoringContext(): Record<string, any>;
463
+ compileAiResponse(response: Record<string, unknown>): AiResponseCompileResult | null;
420
464
  createSnapshot(): FormConfig;
421
465
  restoreSnapshot(snapshot: FormConfig): Promise<void>;
422
466
  applyPatch(patch: Partial<FormConfig>, intent?: string): Promise<PatchResult>;
423
467
  getContextDescription(): string;
424
468
  private applyConfig;
425
469
  private smartMergeFormConfig;
470
+ private extractIncomingRules;
471
+ private extractVisualBlockGuidanceOperationRule;
472
+ private coerceSingleOperationResponse;
473
+ private operationInputRecord;
474
+ private normalizeVisualBlockGuidanceOperationInput;
475
+ private visualBlockGuidanceParamsToRule;
476
+ private normalizeLlmRule;
477
+ private mergeRulesById;
426
478
  private cloneConfig;
479
+ private asRecord;
480
+ private toNonEmptyString;
427
481
  private isFilled;
428
482
  }
429
483
 
@@ -524,6 +578,13 @@ interface DynamicFormApplyPlan {
524
578
  diagnostics: EditorDiagnostic[];
525
579
  }
526
580
 
581
+ interface PraxisDynamicFormDomainRulesOptions {
582
+ enabled?: boolean;
583
+ targetArtifactKey?: string | null;
584
+ targetLayer?: string | null;
585
+ targetArtifactType?: string | null;
586
+ status?: string | null;
587
+ }
527
588
  interface DynamicFieldRenderErrorEvent {
528
589
  phase: 'executeRendering' | 'detectChanges';
529
590
  fieldName: string;
@@ -595,6 +656,7 @@ declare class PraxisDynamicForm implements OnInit, OnChanges, OnDestroy {
595
656
  private hookPresets?;
596
657
  private logger?;
597
658
  private readonly i18n;
659
+ private readonly injector;
598
660
  private readonly DEBUG;
599
661
  private effectiveActionsCache?;
600
662
  private effectiveActionsCacheBase?;
@@ -675,6 +737,8 @@ declare class PraxisDynamicForm implements OnInit, OnChanges, OnDestroy {
675
737
  disabledModeGlobal: boolean | null;
676
738
  presentationModeGlobal: boolean | null;
677
739
  visibleGlobal: boolean | null;
740
+ /** Opt-in loader for shared domain rule materializations persisted outside FormConfig. */
741
+ domainRules: PraxisDynamicFormDomainRulesOptions | boolean | null;
678
742
  get effectivePresentation(): boolean;
679
743
  get effectiveReadonly(): boolean;
680
744
  get effectiveDisabledMode(): boolean | null;
@@ -707,6 +771,8 @@ declare class PraxisDynamicForm implements OnInit, OnChanges, OnDestroy {
707
771
  }>;
708
772
  /** Forwarded from DynamicFieldLoader to allow host-side observability. */
709
773
  fieldRenderError: EventEmitter<DynamicFieldRenderErrorEvent>;
774
+ /** Emits runtime rule diagnostics so hosts can surface or log invalid rules. */
775
+ ruleDiagnosticsChange: EventEmitter<RuleApplicationDiagnostic[]>;
710
776
  isLoading: boolean;
711
777
  submitting: boolean;
712
778
  submitError: string | null;
@@ -726,6 +792,10 @@ declare class PraxisDynamicForm implements OnInit, OnChanges, OnDestroy {
726
792
  private rowRuleProps;
727
793
  private columnRuleProps;
728
794
  private visualBlockRuleProps;
795
+ private materializedFormRules;
796
+ private materializedFormRulesLoadSignature;
797
+ ruleApplicationDiagnostics: RuleApplicationDiagnostic[];
798
+ private ruleApplicationDiagnosticsSignature;
729
799
  private pendingEntityId;
730
800
  private loadedEntityId;
731
801
  private hydratedEntityId;
@@ -888,7 +958,12 @@ declare class PraxisDynamicForm implements OnInit, OnChanges, OnDestroy {
888
958
  private saveConnection;
889
959
  disconnect(): void;
890
960
  onToolbarRequestClose(): void;
961
+ private getActiveFormRules;
962
+ private refreshMaterializedFormRules;
963
+ private resolveDomainRulesOptions;
891
964
  private evaluateAndApplyRules;
965
+ private buildRuleApplicationTargetIndex;
966
+ private setRuleApplicationDiagnostics;
892
967
  isSectionCollapsed(section?: FormSection): boolean;
893
968
  isSectionCollapsible(section?: FormSection): boolean;
894
969
  private getSectionRuleProps;
@@ -1139,7 +1214,7 @@ declare class PraxisDynamicForm implements OnInit, OnChanges, OnDestroy {
1139
1214
  private applyPresentationVars;
1140
1215
  private applyPresentationConfig;
1141
1216
  static ɵfac: i0.ɵɵFactoryDeclaration<PraxisDynamicForm, [null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, { optional: true; }, { optional: true; }, { optional: true; }, { optional: true; }, { optional: true; }, { optional: true; }]>;
1142
- static ɵcmp: i0.ɵɵComponentDeclaration<PraxisDynamicForm, "praxis-dynamic-form", never, { "resourcePath": { "alias": "resourcePath"; "required": false; }; "resourceId": { "alias": "resourceId"; "required": false; }; "initialValue": { "alias": "initialValue"; "required": false; }; "editorialContext": { "alias": "editorialContext"; "required": false; }; "mode": { "alias": "mode"; "required": false; }; "config": { "alias": "config"; "required": false; }; "actions": { "alias": "actions"; "required": false; }; "schemaSource": { "alias": "schemaSource"; "required": false; }; "schemaUrl": { "alias": "schemaUrl"; "required": false; }; "submitUrl": { "alias": "submitUrl"; "required": false; }; "submitMethod": { "alias": "submitMethod"; "required": false; }; "responseSchemaUrl": { "alias": "responseSchemaUrl"; "required": false; }; "apiEndpointKey": { "alias": "apiEndpointKey"; "required": false; }; "apiUrlEntry": { "alias": "apiUrlEntry"; "required": false; }; "enableCustomization": { "alias": "enableCustomization"; "required": false; }; "formId": { "alias": "formId"; "required": false; }; "componentInstanceId": { "alias": "componentInstanceId"; "required": false; }; "layout": { "alias": "layout"; "required": false; }; "backConfig": { "alias": "backConfig"; "required": false; }; "hooks": { "alias": "hooks"; "required": false; }; "removeEmptyContainersOnSave": { "alias": "removeEmptyContainersOnSave"; "required": false; }; "reactiveValidation": { "alias": "reactiveValidation"; "required": false; }; "reactiveValidationDebounceMs": { "alias": "reactiveValidationDebounceMs"; "required": false; }; "notifyIfOutdated": { "alias": "notifyIfOutdated"; "required": false; }; "snoozeMs": { "alias": "snoozeMs"; "required": false; }; "autoOpenSettingsOnOutdated": { "alias": "autoOpenSettingsOnOutdated"; "required": false; }; "readonlyModeGlobal": { "alias": "readonlyModeGlobal"; "required": false; }; "disabledModeGlobal": { "alias": "disabledModeGlobal"; "required": false; }; "presentationModeGlobal": { "alias": "presentationModeGlobal"; "required": false; }; "visibleGlobal": { "alias": "visibleGlobal"; "required": false; }; "customEndpoints": { "alias": "customEndpoints"; "required": false; }; }, { "formSubmit": "formSubmit"; "formCancel": "formCancel"; "formReset": "formReset"; "configChange": "configChange"; "formReady": "formReady"; "valueChange": "valueChange"; "syncCompleted": "syncCompleted"; "initializationError": "initializationError"; "loadingStateChange": "loadingStateChange"; "enableCustomizationChange": "enableCustomizationChange"; "customAction": "customAction"; "actionConfirmation": "actionConfirmation"; "schemaStatusChange": "schemaStatusChange"; "fieldRenderError": "fieldRenderError"; }, never, never, true, never>;
1217
+ static ɵcmp: i0.ɵɵComponentDeclaration<PraxisDynamicForm, "praxis-dynamic-form", never, { "resourcePath": { "alias": "resourcePath"; "required": false; }; "resourceId": { "alias": "resourceId"; "required": false; }; "initialValue": { "alias": "initialValue"; "required": false; }; "editorialContext": { "alias": "editorialContext"; "required": false; }; "mode": { "alias": "mode"; "required": false; }; "config": { "alias": "config"; "required": false; }; "actions": { "alias": "actions"; "required": false; }; "schemaSource": { "alias": "schemaSource"; "required": false; }; "schemaUrl": { "alias": "schemaUrl"; "required": false; }; "submitUrl": { "alias": "submitUrl"; "required": false; }; "submitMethod": { "alias": "submitMethod"; "required": false; }; "responseSchemaUrl": { "alias": "responseSchemaUrl"; "required": false; }; "apiEndpointKey": { "alias": "apiEndpointKey"; "required": false; }; "apiUrlEntry": { "alias": "apiUrlEntry"; "required": false; }; "enableCustomization": { "alias": "enableCustomization"; "required": false; }; "formId": { "alias": "formId"; "required": false; }; "componentInstanceId": { "alias": "componentInstanceId"; "required": false; }; "layout": { "alias": "layout"; "required": false; }; "backConfig": { "alias": "backConfig"; "required": false; }; "hooks": { "alias": "hooks"; "required": false; }; "removeEmptyContainersOnSave": { "alias": "removeEmptyContainersOnSave"; "required": false; }; "reactiveValidation": { "alias": "reactiveValidation"; "required": false; }; "reactiveValidationDebounceMs": { "alias": "reactiveValidationDebounceMs"; "required": false; }; "notifyIfOutdated": { "alias": "notifyIfOutdated"; "required": false; }; "snoozeMs": { "alias": "snoozeMs"; "required": false; }; "autoOpenSettingsOnOutdated": { "alias": "autoOpenSettingsOnOutdated"; "required": false; }; "readonlyModeGlobal": { "alias": "readonlyModeGlobal"; "required": false; }; "disabledModeGlobal": { "alias": "disabledModeGlobal"; "required": false; }; "presentationModeGlobal": { "alias": "presentationModeGlobal"; "required": false; }; "visibleGlobal": { "alias": "visibleGlobal"; "required": false; }; "domainRules": { "alias": "domainRules"; "required": false; }; "customEndpoints": { "alias": "customEndpoints"; "required": false; }; }, { "formSubmit": "formSubmit"; "formCancel": "formCancel"; "formReset": "formReset"; "configChange": "configChange"; "formReady": "formReady"; "valueChange": "valueChange"; "syncCompleted": "syncCompleted"; "initializationError": "initializationError"; "loadingStateChange": "loadingStateChange"; "enableCustomizationChange": "enableCustomizationChange"; "customAction": "customAction"; "actionConfirmation": "actionConfirmation"; "schemaStatusChange": "schemaStatusChange"; "fieldRenderError": "fieldRenderError"; "ruleDiagnosticsChange": "ruleDiagnosticsChange"; }, never, never, true, never>;
1143
1218
  }
1144
1219
 
1145
1220
  declare class FormConfigService {
@@ -1217,6 +1292,38 @@ declare class JsonConfigEditorComponent implements OnInit, OnDestroy {
1217
1292
  static ɵcmp: i0.ɵɵComponentDeclaration<JsonConfigEditorComponent, "form-json-config-editor", never, { "config": { "alias": "config"; "required": false; }; "document": { "alias": "document"; "required": false; }; }, { "configChange": "configChange"; "documentChange": "documentChange"; "validationChange": "validationChange"; "editorEvent": "editorEvent"; }, never, never, true, never>;
1218
1293
  }
1219
1294
 
1295
+ interface VisualBlockRuleNodeOption {
1296
+ id: string;
1297
+ label: string;
1298
+ kind: string;
1299
+ roles: Array<'text' | 'title' | 'message'>;
1300
+ }
1301
+
1302
+ type RuleAuthoringStatus = 'valid' | 'invalid-target' | 'invalid-condition' | 'unsupported-property' | 'sanitized-property' | 'runtime-only' | 'visual-builder-compatible' | 'llm-generated-pending-review';
1303
+ interface FormRulePropertyIssue {
1304
+ property: string;
1305
+ reason: 'unsupported-property' | 'invalid-value' | 'sanitized-value';
1306
+ }
1307
+ interface FormRuleTargetDiagnostic {
1308
+ type: NonNullable<FormLayoutRule['targetType']>;
1309
+ id: string;
1310
+ exists: boolean;
1311
+ }
1312
+ interface FormRuleDiagnostics {
1313
+ ruleId: string;
1314
+ ruleName?: string;
1315
+ status: RuleAuthoringStatus[];
1316
+ targetRefs: FormRuleTargetDiagnostic[];
1317
+ conditionRefs: string[];
1318
+ acceptedProperties: string[];
1319
+ rejectedProperties: string[];
1320
+ acceptedPropertiesWhenFalse: string[];
1321
+ rejectedPropertiesWhenFalse: string[];
1322
+ propertyIssues?: FormRulePropertyIssue[];
1323
+ propertyIssuesWhenFalse?: FormRulePropertyIssue[];
1324
+ runtimeOnlyReason?: string;
1325
+ }
1326
+
1220
1327
  declare class PraxisDynamicFormConfigEditor implements SettingsValueProvider, OnInit, OnDestroy {
1221
1328
  private storage;
1222
1329
  private configService;
@@ -1227,6 +1334,15 @@ declare class PraxisDynamicFormConfigEditor implements SettingsValueProvider, On
1227
1334
  ruleBuilderConfig: RuleBuilderConfig;
1228
1335
  ruleBuilderState?: RuleBuilderState;
1229
1336
  currentRules: FormLayoutRule[];
1337
+ ruleDiagnostics: FormRuleDiagnostics[];
1338
+ visualBlockNodeOptions: Record<string, VisualBlockRuleNodeOption[]>;
1339
+ ruleDiagnosticsSummary: {
1340
+ total: number;
1341
+ invalid: number;
1342
+ runtimeOnly: number;
1343
+ unsupported: number;
1344
+ pendingReview: number;
1345
+ };
1230
1346
  private initialConfig;
1231
1347
  private initialDocument;
1232
1348
  private readonly openedWithCanonicalDocument;
@@ -1295,6 +1411,18 @@ declare class PraxisDynamicFormConfigEditor implements SettingsValueProvider, On
1295
1411
  private findGlobalActionCatalogEntry;
1296
1412
  private buildGlobalActionCatalog;
1297
1413
  onRulesChanged(state: RuleBuilderState): void;
1414
+ onRulePropertiesChanged(rules: FormLayoutRule[]): void;
1415
+ private computeRuleDiagnosticsSummary;
1416
+ getRuleStatusLabel(diagnostic: FormRuleDiagnostics): string;
1417
+ getRuleStatusTone(diagnostic: FormRuleDiagnostics): 'ok' | 'warn' | 'error';
1418
+ canAcceptPendingLlmRule(diagnostic: FormRuleDiagnostics): boolean;
1419
+ canApplyRulePropertyFix(diagnostic: FormRuleDiagnostics): boolean;
1420
+ applyRulePropertyFix(ruleId: string): void;
1421
+ acceptPendingLlmRule(ruleId: string): void;
1422
+ getRuleDiagnosticDetails(diagnostic: FormRuleDiagnostics): string[];
1423
+ private getRulePropertyIssueNames;
1424
+ private markLlmRuleAccepted;
1425
+ private refreshRuleDiagnostics;
1298
1426
  get jsonDocument(): DynamicFormAuthoringDocument;
1299
1427
  onBackConfigChange(): void;
1300
1428
  isBindingsBlockPersisted(): boolean;
@@ -1307,8 +1435,14 @@ declare class PraxisDynamicFormConfigEditor implements SettingsValueProvider, On
1307
1435
  onPresentationPrefsChange(reason: string): void;
1308
1436
  onSchemaPrefsChange(reason: string): void;
1309
1437
  private createRuleBuilderConfig;
1438
+ private getVisualBuilderRulePropertySchema;
1310
1439
  private mapMetadataToSchema;
1311
1440
  private getVisualBlockTargetLabel;
1441
+ private getRuleFieldLabel;
1442
+ private getRuleFieldDescription;
1443
+ private refreshVisualBlockNodeOptions;
1444
+ private collectVisualBlockNodeOptions;
1445
+ private getVisualBlockNodeRoles;
1312
1446
  private findRichContentNodeText;
1313
1447
  private mapDataTypeToFieldType;
1314
1448
  ngOnDestroy(): void;
@@ -1433,6 +1567,17 @@ interface AddApiFieldEvent {
1433
1567
  columnIndex: number;
1434
1568
  fieldName: string;
1435
1569
  }
1570
+ interface AddLocalFieldEvent {
1571
+ sectionIndex: number;
1572
+ rowIndex: number;
1573
+ columnIndex: number;
1574
+ }
1575
+ interface EditFieldEvent {
1576
+ sectionIndex: number;
1577
+ rowIndex: number;
1578
+ columnIndex: number;
1579
+ fieldName: string;
1580
+ }
1436
1581
  interface MoveVisualBlockEvent extends VisualBlockEvent {
1437
1582
  direction: -1 | 1;
1438
1583
  }
@@ -1452,6 +1597,7 @@ declare class LayoutEditorComponent implements OnInit {
1452
1597
  private readonly settingsPanel;
1453
1598
  private readonly i18n;
1454
1599
  private visualBlockIdSequence;
1600
+ private localFieldSequence;
1455
1601
  protected readonly colorTokens: typeof LayoutColorToken;
1456
1602
  selected: {
1457
1603
  type: 'section' | 'row' | 'column' | 'field' | 'visualBlock';
@@ -1505,6 +1651,11 @@ declare class LayoutEditorComponent implements OnInit {
1505
1651
  addVisualBlockToColumn(event: AddVisualBlockEvent): void;
1506
1652
  private createVisualBlockItemId;
1507
1653
  addApiFieldToColumn(event: AddApiFieldEvent): void;
1654
+ addLocalFieldToColumn(event: AddLocalFieldEvent): void;
1655
+ openFieldMetadataEditor(event: EditFieldEvent): void;
1656
+ private openFieldMetadataEditorInternal;
1657
+ private applyFieldMetadataPatch;
1658
+ private createLocalFieldName;
1508
1659
  openVisualBlockEditor(event: {
1509
1660
  sectionIndex: number;
1510
1661
  rowIndex: number;
@@ -1556,6 +1707,15 @@ declare class RowConfiguratorComponent implements OnChanges {
1556
1707
  columnIndex: number;
1557
1708
  fieldName: string;
1558
1709
  }>;
1710
+ addLocalField: EventEmitter<{
1711
+ rowIndex: number;
1712
+ columnIndex: number;
1713
+ }>;
1714
+ editField: EventEmitter<{
1715
+ rowIndex: number;
1716
+ columnIndex: number;
1717
+ fieldName: string;
1718
+ }>;
1559
1719
  editVisualBlock: EventEmitter<{
1560
1720
  rowIndex: number;
1561
1721
  columnIndex: number;
@@ -1612,7 +1772,8 @@ declare class RowConfiguratorComponent implements OnChanges {
1612
1772
  selectRow(): void;
1613
1773
  openColumnConfig(index: number): void;
1614
1774
  selectColumn(index: number, event: MouseEvent): void;
1615
- selectField(fieldName: string, event: MouseEvent): void;
1775
+ selectField(fieldName: string, columnIndex: number, event: MouseEvent): void;
1776
+ openFieldEditor(fieldName: string, columnIndex: number, event: Event): void;
1616
1777
  openRowMenu(): void;
1617
1778
  onMenuClosed(): void;
1618
1779
  onDropEnter(index: number): void;
@@ -1628,6 +1789,7 @@ declare class RowConfiguratorComponent implements OnChanges {
1628
1789
  clearColumn(index: number): void;
1629
1790
  addVisualBlockToColumn(index: number, presetId: VisualBlockPresetId): void;
1630
1791
  addApiFieldToColumn(index: number, fieldName: string): void;
1792
+ addLocalFieldToColumn(index: number): void;
1631
1793
  addFieldToColumn(index: number): void;
1632
1794
  getColumnId(index: number): string;
1633
1795
  private generateId;
@@ -1651,7 +1813,7 @@ declare class RowConfiguratorComponent implements OnChanges {
1651
1813
  adjustOffset(columnIndex: number, delta: number): void;
1652
1814
  getSuggestedSpan(columnIndex: number): number | null;
1653
1815
  static ɵfac: i0.ɵɵFactoryDeclaration<RowConfiguratorComponent, never>;
1654
- static ɵcmp: i0.ɵɵComponentDeclaration<RowConfiguratorComponent, "praxis-row-configurator", never, { "row": { "alias": "row"; "required": false; }; "fieldMetadata": { "alias": "fieldMetadata"; "required": false; }; "availableFields": { "alias": "availableFields"; "required": false; }; "sectionIndex": { "alias": "sectionIndex"; "required": false; }; "rowIndex": { "alias": "rowIndex"; "required": false; }; "isLastRow": { "alias": "isLastRow"; "required": false; }; "selected": { "alias": "selected"; "required": false; }; "availableFieldsListId": { "alias": "availableFieldsListId"; "required": false; }; "connectedDropListIds": { "alias": "connectedDropListIds"; "required": false; }; "gapGlobal": { "alias": "gapGlobal"; "required": false; }; }, { "rowChange": "rowChange"; "remove": "remove"; "applyRowGapAll": "applyRowGapAll"; "fieldDrop": "fieldDrop"; "addVisualBlock": "addVisualBlock"; "addApiField": "addApiField"; "editVisualBlock": "editVisualBlock"; "moveVisualBlock": "moveVisualBlock"; "moveVisualBlockToColumn": "moveVisualBlockToColumn"; "removeVisualBlock": "removeVisualBlock"; "select": "select"; }, never, never, true, never>;
1816
+ static ɵcmp: i0.ɵɵComponentDeclaration<RowConfiguratorComponent, "praxis-row-configurator", never, { "row": { "alias": "row"; "required": false; }; "fieldMetadata": { "alias": "fieldMetadata"; "required": false; }; "availableFields": { "alias": "availableFields"; "required": false; }; "sectionIndex": { "alias": "sectionIndex"; "required": false; }; "rowIndex": { "alias": "rowIndex"; "required": false; }; "isLastRow": { "alias": "isLastRow"; "required": false; }; "selected": { "alias": "selected"; "required": false; }; "availableFieldsListId": { "alias": "availableFieldsListId"; "required": false; }; "connectedDropListIds": { "alias": "connectedDropListIds"; "required": false; }; "gapGlobal": { "alias": "gapGlobal"; "required": false; }; }, { "rowChange": "rowChange"; "remove": "remove"; "applyRowGapAll": "applyRowGapAll"; "fieldDrop": "fieldDrop"; "addVisualBlock": "addVisualBlock"; "addApiField": "addApiField"; "addLocalField": "addLocalField"; "editField": "editField"; "editVisualBlock": "editVisualBlock"; "moveVisualBlock": "moveVisualBlock"; "moveVisualBlockToColumn": "moveVisualBlockToColumn"; "removeVisualBlock": "removeVisualBlock"; "select": "select"; }, never, never, true, never>;
1655
1817
  }
1656
1818
 
1657
1819
  declare class FieldConfiguratorComponent {
@@ -1674,6 +1836,30 @@ declare const PRAXIS_DYNAMIC_FORM_COMPONENT_METADATA: ComponentDocMeta;
1674
1836
  /** Provider para auto-registrar metadados do componente Dynamic Form. */
1675
1837
  declare function providePraxisDynamicFormMetadata(): Provider;
1676
1838
 
1839
+ interface DomainRuleFormRulesRequestOptions extends DomainRuleRequestOptions {
1840
+ targetLayer?: string;
1841
+ targetArtifactType?: string;
1842
+ status?: string;
1843
+ }
1844
+ type DomainRuleMaterializedFormLayoutRule = FormLayoutRule & {
1845
+ metadata?: Record<string, unknown>;
1846
+ };
1847
+ declare class DomainRuleFormRulesService {
1848
+ private readonly domainRules;
1849
+ constructor(domainRules: DomainRuleService);
1850
+ listRulesForForm(targetArtifactKey: string, options?: DomainRuleFormRulesRequestOptions): Observable<DomainRuleMaterializedFormLayoutRule[]>;
1851
+ materializationsToFormRules(materializations: DomainRuleMaterialization[] | null | undefined): DomainRuleMaterializedFormLayoutRule[];
1852
+ materializationToFormRule(materialization: DomainRuleMaterialization): DomainRuleMaterializedFormLayoutRule | null;
1853
+ private asDirectFormRule;
1854
+ private visualBlockGuidanceToRule;
1855
+ private withDomainMetadata;
1856
+ private asRecord;
1857
+ private asStringArray;
1858
+ private resolveString;
1859
+ static ɵfac: i0.ɵɵFactoryDeclaration<DomainRuleFormRulesService, never>;
1860
+ static ɵprov: i0.ɵɵInjectableDeclaration<DomainRuleFormRulesService>;
1861
+ }
1862
+
1677
1863
  declare function isRuleSatisfied(rule: FormLayoutRule, data: unknown): boolean;
1678
1864
  /**
1679
1865
  * Applies all visibility rules to the provided data and
@@ -2159,6 +2345,41 @@ declare const FORM_COMPONENT_AI_CAPABILITIES: CapabilityCatalog;
2159
2345
  */
2160
2346
  declare function getFormAiCatalog(formConfig?: FormConfig): AiCapabilityCatalog;
2161
2347
 
2348
+ type DynamicFormRuleTargetType = NonNullable<FormLayoutRule['targetType']>;
2349
+ interface DynamicFormRuleAuthoringField {
2350
+ name: string;
2351
+ label?: string;
2352
+ type?: string;
2353
+ source?: string;
2354
+ submitPolicy?: string;
2355
+ }
2356
+ interface DynamicFormRuleAuthoringTarget {
2357
+ id: string;
2358
+ label?: string;
2359
+ }
2360
+ interface DynamicFormRuleAuthoringVisualBlockNode {
2361
+ id: string;
2362
+ label: string;
2363
+ kind: string;
2364
+ roles: Array<'text' | 'title' | 'message'>;
2365
+ }
2366
+ type DynamicFormRuleAuthoringTargets = Record<DynamicFormRuleTargetType, string[]>;
2367
+ type DynamicFormRuleAuthoringTargetDetails = Record<DynamicFormRuleTargetType, DynamicFormRuleAuthoringTarget[]>;
2368
+ type DynamicFormAllowedRuleProperties = Record<DynamicFormRuleTargetType, string[]>;
2369
+ interface DynamicFormRuleAuthoringContext {
2370
+ component: 'praxis-dynamic-form';
2371
+ capabilityCatalogVersion: string;
2372
+ fields: DynamicFormRuleAuthoringField[];
2373
+ targets: DynamicFormRuleAuthoringTargets;
2374
+ targetDetails: DynamicFormRuleAuthoringTargetDetails;
2375
+ allowedRuleProperties: DynamicFormAllowedRuleProperties;
2376
+ visualBlockNodes: Record<string, DynamicFormRuleAuthoringVisualBlockNode[]>;
2377
+ existingRules: FormLayoutRule[];
2378
+ diagnostics: FormRuleDiagnostics[];
2379
+ guardrails: string[];
2380
+ }
2381
+ declare function buildDynamicFormRuleAuthoringContext(config: Pick<FormConfig, 'fieldMetadata' | 'sections' | 'actions' | 'formRules'>): DynamicFormRuleAuthoringContext;
2382
+
2162
2383
  /**
2163
2384
  * Manifesto de authoring canônico para o componente praxis-dynamic-form.
2164
2385
  * Este arquivo define as operações permitidas pela IA para editar formulários.
@@ -2168,5 +2389,5 @@ declare function getFormAiCatalog(formConfig?: FormConfig): AiCapabilityCatalog;
2168
2389
  */
2169
2390
  declare const PRAXIS_DYNAMIC_FORM_AUTHORING_MANIFEST: ComponentAuthoringManifest;
2170
2391
 
2171
- export { ActionsEditorComponent, CanvasStateService, CanvasToolbarComponent, ColumnEditorComponent, DynamicFormLayoutService, FORM_AI_CAPABILITIES, FORM_COMPONENT_AI_CAPABILITIES, FieldConfiguratorComponent, FieldEditorComponent, FormConfigService, FormContextService, FormLayoutService, JsonConfigEditorComponent, LayoutColorToken, LayoutEditorComponent, LayoutPrefsService, PRAXIS_DYNAMIC_FORM_AUTHORING_MANIFEST, PRAXIS_DYNAMIC_FORM_COMPONENT_METADATA, PRAXIS_FILTER_FORM_COMPONENT_METADATA, PraxisDynamicForm, PraxisDynamicFormConfigEditor, PraxisFilterForm, PraxisFormActionsComponent, RowConfiguratorComponent, RowEditorComponent, SETTINGS_PANEL_DYNAMIC_FORM_PROVIDER, SectionEditorComponent, TASK_PRESETS, applyVisibilityRules, buildDynamicFormApplyPlan, createDynamicFormAuthoringDocument, formLayoutRulesToBuilderState, getFormAiCatalog, getFormCapabilities, getFormEnum, isRuleSatisfied, normalizeDateArrays, normalizeDynamicFormAuthoringDocument, parseLegacyOrDynamicFormDocument, providePraxisDynamicFormMetadata, providePraxisFilterFormMetadata, provideSettingsPanelDynamicForm, ruleBuilderStateToFormLayoutRules, serializeDynamicFormAuthoringDocument, stripLegacyFieldMetadata, toCanonicalDynamicFormConfig, validateDynamicFormAuthoringDocument, validateDynamicFormAuthoringInput };
2172
- export type { CanvasElement, CanvasElementType, CanvasPathPart, Capability$1 as Capability, CapabilityCatalog$1 as CapabilityCatalog, CapabilityCategory$1 as CapabilityCategory, DynamicFieldRenderErrorEvent, DynamicFormApplyPlan, DynamicFormAuthoringDocument, DynamicFormBindings, DynamicFormContextSnapshot, DynamicFormMode, DynamicFormPresentationSnapshot, DynamicFormProjectionContext, DynamicFormResolvedRuntimeContract, DynamicFormRuntimeContext, DynamicFormRuntimeValueSource, DynamicFormSchemaPrefsSnapshot, DynamicFormValidationContext, EditorDiagnostic, EditorDocument, FieldPath, FieldPathContainer, FieldPathWithIndex, Capability as FormComponentCapability, CapabilityCatalog as FormComponentCapabilityCatalog, CapabilityCategory as FormComponentCapabilityCategory, ValueKind as FormComponentValueKind, FormConfigLike, IdPath, JsonEditorEvent, JsonValidationResult, LayoutChange, LayoutResult, Operation, Path, PathWithIndex, PraxisFormActionEvent, RemovePolicy, ValidationReport, ValueKind$1 as ValueKind };
2392
+ export { ActionsEditorComponent, CanvasStateService, CanvasToolbarComponent, ColumnEditorComponent, DomainRuleFormRulesService, DynamicFormLayoutService, FORM_AI_CAPABILITIES, FORM_COMPONENT_AI_CAPABILITIES, FieldConfiguratorComponent, FieldEditorComponent, FormConfigService, FormContextService, FormLayoutService, FormRulesService, JsonConfigEditorComponent, LayoutColorToken, LayoutEditorComponent, LayoutPrefsService, PRAXIS_DYNAMIC_FORM_AUTHORING_MANIFEST, PRAXIS_DYNAMIC_FORM_COMPONENT_METADATA, PRAXIS_FILTER_FORM_COMPONENT_METADATA, PraxisDynamicForm, PraxisDynamicFormConfigEditor, PraxisFilterForm, PraxisFormActionsComponent, RowConfiguratorComponent, RowEditorComponent, SETTINGS_PANEL_DYNAMIC_FORM_PROVIDER, SectionEditorComponent, TASK_PRESETS, applyVisibilityRules, buildDynamicFormApplyPlan, buildDynamicFormRuleAuthoringContext, createDynamicFormAuthoringDocument, formLayoutRulesToBuilderState, getFormAiCatalog, getFormCapabilities, getFormEnum, isRuleSatisfied, normalizeDateArrays, normalizeDynamicFormAuthoringDocument, parseLegacyOrDynamicFormDocument, providePraxisDynamicFormMetadata, providePraxisFilterFormMetadata, provideSettingsPanelDynamicForm, ruleBuilderStateToFormLayoutRules, serializeDynamicFormAuthoringDocument, stripLegacyFieldMetadata, toCanonicalDynamicFormConfig, validateDynamicFormAuthoringDocument, validateDynamicFormAuthoringInput };
2393
+ export type { CanvasElement, CanvasElementType, CanvasPathPart, Capability$1 as Capability, CapabilityCatalog$1 as CapabilityCatalog, CapabilityCategory$1 as CapabilityCategory, DomainRuleFormRulesRequestOptions, DomainRuleMaterializedFormLayoutRule, DynamicFieldRenderErrorEvent, DynamicFormAllowedRuleProperties, DynamicFormApplyPlan, DynamicFormAuthoringDocument, DynamicFormBindings, DynamicFormContextSnapshot, DynamicFormMode, DynamicFormPresentationSnapshot, DynamicFormProjectionContext, DynamicFormResolvedRuntimeContract, DynamicFormRuleAuthoringContext, DynamicFormRuleAuthoringField, DynamicFormRuleAuthoringTarget, DynamicFormRuleAuthoringTargetDetails, DynamicFormRuleAuthoringTargets, DynamicFormRuleAuthoringVisualBlockNode, DynamicFormRuleTargetType, DynamicFormRuntimeContext, DynamicFormRuntimeValueSource, DynamicFormSchemaPrefsSnapshot, DynamicFormValidationContext, EditorDiagnostic, EditorDocument, FieldPath, FieldPathContainer, FieldPathWithIndex, Capability as FormComponentCapability, CapabilityCatalog as FormComponentCapabilityCatalog, CapabilityCategory as FormComponentCapabilityCategory, ValueKind as FormComponentValueKind, FormConfigLike, IdPath, InsertLocalFieldOptions, InsertLocalFieldResult, JsonEditorEvent, JsonValidationResult, LayoutChange, LayoutResult, LocalFieldInsertionDiagnostic, LocalFieldInsertionDiagnosticCode, Operation, Path, PathWithIndex, PraxisDynamicFormDomainRulesOptions, PraxisFormActionEvent, RemovePolicy, RuleApplicationContext, RuleApplicationDiagnostic, RuleApplicationDiagnosticCode, RuleApplicationResult, RuleApplicationTargetIndex, RuleApplicationTargetType, ValidationReport, ValueKind$1 as ValueKind };
package/package.json CHANGED
@@ -1,16 +1,16 @@
1
1
  {
2
2
  "name": "@praxisui/dynamic-form",
3
- "version": "8.0.0-beta.17",
3
+ "version": "8.0.0-beta.19",
4
4
  "description": "Angular dynamic form engine for Praxis UI: metadata-driven forms, hooks, and services integrating @praxisui/* packages.",
5
5
  "peerDependencies": {
6
6
  "@angular/common": "^20.0.0",
7
7
  "@angular/core": "^20.0.0",
8
8
  "@angular/cdk": "^20.0.0",
9
- "@praxisui/rich-content": "^8.0.0-beta.17",
10
- "@praxisui/settings-panel": "^8.0.0-beta.17",
11
- "@praxisui/visual-builder": "^8.0.0-beta.17",
12
- "@praxisui/core": "^8.0.0-beta.17",
13
- "@praxisui/cron-builder": "^8.0.0-beta.17"
9
+ "@praxisui/rich-content": "^8.0.0-beta.19",
10
+ "@praxisui/settings-panel": "^8.0.0-beta.19",
11
+ "@praxisui/visual-builder": "^8.0.0-beta.19",
12
+ "@praxisui/core": "^8.0.0-beta.19",
13
+ "@praxisui/cron-builder": "^8.0.0-beta.19"
14
14
  },
15
15
  "dependencies": {
16
16
  "tslib": "^2.3.0",