@praxisui/dynamic-form 8.0.0-beta.20 → 8.0.0-beta.22

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, RichBlockHostCapabilities, 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';
10
+ import { AsyncConfigStorage, FormLayout, FieldMetadata, FormLayoutRule, FormRuleTargetType as FormRuleTargetType$1, PraxisJsonLogicService, FormSection, FormRow, FormColumn, FormConfig, FormLayoutItem, FormActionButton, AiCapability, BackConfig, RichBlockHostCapabilities, 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, JsonLogicExpression, GlobalActionCatalogEntry, PraxisRuntimeConditionalEffectRule, PraxisRuntimeGlobalActionEffect, GlobalActionField, 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
+ import { BaseAiAdapter, AiResponseCompileResult, PatchResult, PraxisAssistantShellLayout, PraxisAssistantTurnViewState, PraxisAssistantShellLabels, PraxisAssistantSessionSnapshot, PraxisAssistantShellQuickReply, PraxisAssistantShellMessage } from '@praxisui/ai';
14
15
  import { KeyboardShortcutService } from '@praxisui/dynamic-fields';
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,7 +44,7 @@ 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';
47
+ type RuleApplicationDiagnosticCode = 'missing-targets' | 'missing-effect' | 'unsupported-target-type' | 'field-target-not-found' | 'target-not-found' | 'invalid-condition' | 'invalid-value-expression' | 'computed-value-iteration-limit' | 'unsupported-property' | 'rule-evaluation-error';
48
48
  interface RuleApplicationDiagnostic {
49
49
  ruleId?: string;
50
50
  ruleName?: string;
@@ -63,6 +63,8 @@ interface RuleApplicationResult {
63
63
  rowProps: Record<string, Record<string, any>>;
64
64
  columnProps: Record<string, Record<string, any>>;
65
65
  visualBlockProps: Record<string, Record<string, any>>;
66
+ fieldValues: Record<string, any>;
67
+ formData: Record<string, any>;
66
68
  diagnostics: RuleApplicationDiagnostic[];
67
69
  }
68
70
  type RuleApplicationTargetType = NonNullable<FormLayoutRule['targetType']>;
@@ -84,6 +86,10 @@ declare class FormRulesService {
84
86
  private ruleTargetExists;
85
87
  private normalizeRuleTargetId;
86
88
  private evaluateCondition;
89
+ private evaluateRuleValue;
90
+ private evaluateJsonLogicValue;
91
+ private resolveComputedRuleFormData;
92
+ private areRuleValuesEqual;
87
93
  private addUnsupportedPropertyDiagnostics;
88
94
  private setPath;
89
95
  private deletePath;
@@ -446,6 +452,10 @@ declare class PraxisFormActionsComponent implements OnChanges, OnDestroy {
446
452
  interface FormAiHost {
447
453
  config: FormConfig;
448
454
  form: FormGroup;
455
+ mode?: 'create' | 'edit' | 'view';
456
+ enableCustomization?: boolean;
457
+ readonlyModeGlobal?: boolean | null;
458
+ effectiveReadonly?: boolean;
449
459
  applyConfigFromAdapter(config: FormConfig): void;
450
460
  }
451
461
 
@@ -657,6 +667,11 @@ declare class PraxisDynamicForm implements OnInit, OnChanges, OnDestroy {
657
667
  private logger?;
658
668
  private readonly i18n;
659
669
  private readonly injector;
670
+ private readonly aiApi;
671
+ private readonly assistantSessions;
672
+ private readonly aiTurnOrchestrator;
673
+ private readonly jsonLogic;
674
+ private readonly aiAssistantSessionEffect;
660
675
  private readonly globalActions;
661
676
  private readonly DEBUG;
662
677
  private effectiveActionsCache?;
@@ -785,6 +800,13 @@ declare class PraxisDynamicForm implements OnInit, OnChanges, OnDestroy {
785
800
  private isInitialized;
786
801
  form: FormGroup;
787
802
  aiAdapter: FormAiAdapter;
803
+ aiAssistantOpen: boolean;
804
+ aiAssistantPrompt: string;
805
+ aiAssistantLayout: PraxisAssistantShellLayout;
806
+ aiAssistantViewState: PraxisAssistantTurnViewState;
807
+ readonly aiAssistantLabels: Partial<PraxisAssistantShellLabels>;
808
+ private aiAssistantController;
809
+ private aiAssistantStateSubscription;
788
810
  fieldVisibility: {
789
811
  [fieldName: string]: boolean;
790
812
  };
@@ -796,6 +818,7 @@ declare class PraxisDynamicForm implements OnInit, OnChanges, OnDestroy {
796
818
  private visualBlockRuleProps;
797
819
  private materializedFormRules;
798
820
  private materializedFormRulesLoadSignature;
821
+ private readonly formCommandRuleStates;
799
822
  ruleApplicationDiagnostics: RuleApplicationDiagnostic[];
800
823
  private ruleApplicationDiagnosticsSignature;
801
824
  private pendingEntityId;
@@ -981,6 +1004,13 @@ declare class PraxisDynamicForm implements OnInit, OnChanges, OnDestroy {
981
1004
  private refreshMaterializedFormRules;
982
1005
  private resolveDomainRulesOptions;
983
1006
  private evaluateAndApplyRules;
1007
+ private applyRuleComputedFieldValues;
1008
+ private evaluateAndDispatchFormCommandRules;
1009
+ private evaluateFormCommandCondition;
1010
+ private executeFormCommandGlobalAction;
1011
+ private isPotentiallyDestructiveFormCommandAction;
1012
+ private resolveFormCommandPath;
1013
+ private areRuleValuesEqual;
984
1014
  private buildRuleApplicationTargetIndex;
985
1015
  private setRuleApplicationDiagnostics;
986
1016
  isSectionCollapsed(section?: FormSection): boolean;
@@ -1000,6 +1030,8 @@ declare class PraxisDynamicForm implements OnInit, OnChanges, OnDestroy {
1000
1030
  getSectionHeaderAlign(section: FormSection): 'start' | 'center' | undefined;
1001
1031
  getSectionGapBottom(section: FormSection): number | null;
1002
1032
  getSectionTitleGapBottom(section: FormSection): number | null;
1033
+ getEffectiveSectionTitleGapBottom(section: FormSection): number;
1034
+ isSectionHeaderTitleOnly(section: FormSection): boolean;
1003
1035
  getSectionDescriptionGapBottom(section: FormSection): number | null;
1004
1036
  getSectionHeaderActionColor(action: FormSectionHeaderAction): 'primary' | 'accent' | 'warn' | undefined;
1005
1037
  getSectionHeaderActionTooltip(action: FormSectionHeaderAction): string;
@@ -1091,6 +1123,35 @@ declare class PraxisDynamicForm implements OnInit, OnChanges, OnDestroy {
1091
1123
  * IMPORTANTE: Independe completamente do mode do formulário
1092
1124
  */
1093
1125
  toggleEditMode(): void;
1126
+ openAiAssistant(): void;
1127
+ openAiAssistantFromSession(session: PraxisAssistantSessionSnapshot): void;
1128
+ closeAiAssistant(): void;
1129
+ onAiAssistantPromptChange(prompt: string): void;
1130
+ onAiAssistantSubmit(prompt: string): void;
1131
+ onAiAssistantApply(): void;
1132
+ onAiAssistantRetry(): void;
1133
+ onAiAssistantCancel(): void;
1134
+ onAiAssistantQuickReply(reply: PraxisAssistantShellQuickReply): void;
1135
+ onAiAssistantEditMessage(message: PraxisAssistantShellMessage): void;
1136
+ onAiAssistantResendMessage(message: PraxisAssistantShellMessage): void;
1137
+ onAiAssistantLayoutChange(layout: PraxisAssistantShellLayout): void;
1138
+ aiAssistantTriggerTestId(position: string): string;
1139
+ private initializeAiAssistantController;
1140
+ private buildAiAssistantContextItems;
1141
+ private buildAiAssistantContextSnapshot;
1142
+ private syncAiAssistantSession;
1143
+ private hasAiAssistantSessionState;
1144
+ private resolveAiAssistantSessionId;
1145
+ private resolveAiAssistantOwnerId;
1146
+ private resolveAiAssistantRouteKey;
1147
+ private resolveAiAssistantSummary;
1148
+ private resolveAiAssistantBadge;
1149
+ private resolveAiAssistantIcon;
1150
+ private resolveAiAssistantSelectedTarget;
1151
+ private toAiAssistantTargetKind;
1152
+ private toAiAssistantTargetId;
1153
+ private toAiAssistantTargetLabel;
1154
+ private toAiAssistantPath;
1094
1155
  openConfigEditor(): Promise<void>;
1095
1156
  onElementMouseEnter(event: MouseEvent, type: CanvasElementType, data: any, element?: HTMLElement): void;
1096
1157
  onElementMouseLeave(event: MouseEvent): void;
@@ -1347,6 +1408,21 @@ interface FormRuleDiagnostics {
1347
1408
  runtimeOnlyReason?: string;
1348
1409
  }
1349
1410
 
1411
+ interface CommandRulePreviewModel {
1412
+ state: 'ready' | 'invalid';
1413
+ executionMode: 'preview-only';
1414
+ actionId: string;
1415
+ condition: JsonLogicExpression | null;
1416
+ payload?: unknown;
1417
+ payloadExpr?: string;
1418
+ policy: {
1419
+ trigger: 'on-condition-enter';
1420
+ distinct: boolean;
1421
+ distinctBy?: string;
1422
+ runOnInitialEvaluation?: boolean;
1423
+ };
1424
+ diagnostics: string[];
1425
+ }
1350
1426
  declare class PraxisDynamicFormConfigEditor implements SettingsValueProvider, OnInit, OnDestroy {
1351
1427
  private storage;
1352
1428
  private configService;
@@ -1357,6 +1433,17 @@ declare class PraxisDynamicFormConfigEditor implements SettingsValueProvider, On
1357
1433
  ruleBuilderConfig: RuleBuilderConfig;
1358
1434
  ruleBuilderState?: RuleBuilderState;
1359
1435
  currentRules: FormLayoutRule[];
1436
+ selectedCommandRuleId: string;
1437
+ commandRuleCondition: JsonLogicExpression | null;
1438
+ commandRuleConditionJson: string;
1439
+ commandRuleActionId: string;
1440
+ commandRulePayloadJson: string;
1441
+ private commandRulePayloadExpr;
1442
+ commandRuleDistinct: boolean;
1443
+ commandRuleDistinctBy: string;
1444
+ commandRuleRunOnInitialEvaluation: boolean;
1445
+ commandRuleAuthoringError: string | null;
1446
+ commandRulePayloadFieldErrors: Record<string, string>;
1360
1447
  ruleDiagnostics: FormRuleDiagnostics[];
1361
1448
  visualBlockNodeOptions: Record<string, VisualBlockRuleNodeOption[]>;
1362
1449
  ruleDiagnosticsSummary: {
@@ -1411,7 +1498,7 @@ declare class PraxisDynamicFormConfigEditor implements SettingsValueProvider, On
1411
1498
  private hasProcessedInitialRuleState;
1412
1499
  private jsonEditorIsValid;
1413
1500
  private globalActionValidationIssues;
1414
- private readonly globalActionCatalog;
1501
+ readonly globalActionCatalog: GlobalActionCatalogEntry[];
1415
1502
  isDirty$: BehaviorSubject<boolean>;
1416
1503
  isValid$: BehaviorSubject<boolean>;
1417
1504
  isBusy$: BehaviorSubject<boolean>;
@@ -1435,6 +1522,35 @@ declare class PraxisDynamicFormConfigEditor implements SettingsValueProvider, On
1435
1522
  private buildGlobalActionCatalog;
1436
1523
  onRulesChanged(state: RuleBuilderState): void;
1437
1524
  onRulePropertiesChanged(rules: FormLayoutRule[]): void;
1525
+ get commandRules(): PraxisRuntimeConditionalEffectRule<PraxisRuntimeGlobalActionEffect>[];
1526
+ get selectedCommandRule(): PraxisRuntimeConditionalEffectRule<PraxisRuntimeGlobalActionEffect> | undefined;
1527
+ onCommandRuleSelectionChange(): void;
1528
+ onCommandActionChange(): void;
1529
+ onCommandConditionChanged(condition: JsonLogicExpression | null): void;
1530
+ addCommandRule(): void;
1531
+ applyCommandRule(): void;
1532
+ deleteCommandRule(): void;
1533
+ get commandRuleActionSchema(): _praxisui_core.GlobalActionUiSchema | undefined;
1534
+ shouldShowCommandActionField(field: GlobalActionField): boolean;
1535
+ isCommandActionFieldRequired(field: GlobalActionField): boolean;
1536
+ isCommandActionFieldMissing(field: GlobalActionField): boolean;
1537
+ hasCommandActionFieldError(key: string): boolean;
1538
+ getCommandActionFieldError(key: string): string;
1539
+ get commandRulePreview(): CommandRulePreviewModel;
1540
+ getCommandActionFieldValue(field: GlobalActionField): any;
1541
+ onCommandActionFieldChange(field: GlobalActionField, value: any): void;
1542
+ private initializeCommandRuleEditor;
1543
+ private loadCommandRuleEditor;
1544
+ private updateCommandRules;
1545
+ private parseCommandRuleCondition;
1546
+ private parseOptionalJson;
1547
+ private parseCommandPayloadObject;
1548
+ private collectCommandActionFieldValues;
1549
+ private setCommandActionFieldError;
1550
+ private clearCommandActionFieldError;
1551
+ private nextCommandRuleId;
1552
+ private getDefaultCommandActionId;
1553
+ private formatGlobalActionIssue;
1438
1554
  private computeRuleDiagnosticsSummary;
1439
1555
  getRuleStatusLabel(diagnostic: FormRuleDiagnostics): string;
1440
1556
  getRuleStatusTone(diagnostic: FormRuleDiagnostics): 'ok' | 'warn' | 'error';
@@ -1523,6 +1639,7 @@ declare class PraxisFilterForm implements OnChanges, OnDestroy {
1523
1639
  private hasExplicitDefaultValue;
1524
1640
  onFormSubmit(): void;
1525
1641
  getColumnFields(column: FormColumn): FieldMetadata[];
1642
+ getColumnClasses(column: FormColumn): string | null;
1526
1643
  get fieldMetadata(): FieldMetadata[];
1527
1644
  get hasLayout(): boolean;
1528
1645
  trackBySection(i: number, section: FormSection): string;
@@ -1537,6 +1654,37 @@ declare const PRAXIS_FILTER_FORM_COMPONENT_METADATA: ComponentDocMeta;
1537
1654
  /** Provider to register PraxisFilterForm metadata. */
1538
1655
  declare function providePraxisFilterFormMetadata(): Provider;
1539
1656
 
1657
+ interface PraxisFilterFormWidgetEditorInputs {
1658
+ config?: FormConfig | null;
1659
+ formId?: string;
1660
+ resourcePath?: string;
1661
+ mode?: DynamicFormMode | string;
1662
+ [key: string]: unknown;
1663
+ }
1664
+ interface PraxisFilterFormWidgetEditorValue {
1665
+ inputs: PraxisFilterFormWidgetEditorInputs;
1666
+ }
1667
+ declare class PraxisFilterFormWidgetConfigEditor implements SettingsValueProvider, AfterViewInit, OnDestroy {
1668
+ inputs: PraxisFilterFormWidgetEditorInputs | null;
1669
+ widgetKey?: string;
1670
+ formEditor?: PraxisDynamicFormConfigEditor;
1671
+ readonly isDirty$: BehaviorSubject<boolean>;
1672
+ readonly isValid$: BehaviorSubject<boolean>;
1673
+ readonly isBusy$: BehaviorSubject<boolean>;
1674
+ private readonly subscription;
1675
+ ngAfterViewInit(): void;
1676
+ ngOnDestroy(): void;
1677
+ getSettingsValue(): PraxisFilterFormWidgetEditorValue;
1678
+ onSave(): PraxisFilterFormWidgetEditorValue;
1679
+ reset(): void;
1680
+ private initializeChildEditor;
1681
+ private buildValue;
1682
+ private createDocumentFromInputs;
1683
+ private normalizeMode;
1684
+ static ɵfac: i0.ɵɵFactoryDeclaration<PraxisFilterFormWidgetConfigEditor, never>;
1685
+ static ɵcmp: i0.ɵɵComponentDeclaration<PraxisFilterFormWidgetConfigEditor, "praxis-filter-form-widget-config-editor", never, { "inputs": { "alias": "inputs"; "required": false; }; "widgetKey": { "alias": "widgetKey"; "required": false; }; }, {}, never, never, true, never>;
1686
+ }
1687
+
1540
1688
  /** Tokens for theme colors used across the layout editor. */
1541
1689
  declare enum LayoutColorToken {
1542
1690
  Surface = "--md-sys-color-surface",
@@ -1854,6 +2002,40 @@ declare class FieldConfiguratorComponent {
1854
2002
  static ɵcmp: i0.ɵɵComponentDeclaration<FieldConfiguratorComponent, "praxis-field-configurator", never, { "field": { "alias": "field"; "required": false; }; }, {}, never, never, true, never>;
1855
2003
  }
1856
2004
 
2005
+ interface PraxisDynamicFormWidgetEditorInputs {
2006
+ config?: FormConfig | null;
2007
+ mode?: DynamicFormMode;
2008
+ formId?: string;
2009
+ componentInstanceId?: string;
2010
+ backConfig?: BackConfig;
2011
+ notifyIfOutdated?: 'inline' | 'snackbar' | 'both' | 'none';
2012
+ snoozeMs?: number;
2013
+ autoOpenSettingsOnOutdated?: boolean;
2014
+ [key: string]: unknown;
2015
+ }
2016
+ interface PraxisDynamicFormWidgetEditorValue {
2017
+ inputs: PraxisDynamicFormWidgetEditorInputs;
2018
+ }
2019
+ declare class PraxisDynamicFormWidgetConfigEditor implements SettingsValueProvider, AfterViewInit, OnDestroy {
2020
+ inputs: PraxisDynamicFormWidgetEditorInputs | null;
2021
+ widgetKey?: string;
2022
+ formEditor?: PraxisDynamicFormConfigEditor;
2023
+ readonly isDirty$: BehaviorSubject<boolean>;
2024
+ readonly isValid$: BehaviorSubject<boolean>;
2025
+ readonly isBusy$: BehaviorSubject<boolean>;
2026
+ private readonly subscription;
2027
+ ngAfterViewInit(): void;
2028
+ ngOnDestroy(): void;
2029
+ getSettingsValue(): PraxisDynamicFormWidgetEditorValue;
2030
+ onSave(): PraxisDynamicFormWidgetEditorValue;
2031
+ reset(): void;
2032
+ private initializeChildEditor;
2033
+ private buildValue;
2034
+ private createDocumentFromInputs;
2035
+ static ɵfac: i0.ɵɵFactoryDeclaration<PraxisDynamicFormWidgetConfigEditor, never>;
2036
+ static ɵcmp: i0.ɵɵComponentDeclaration<PraxisDynamicFormWidgetConfigEditor, "praxis-dynamic-form-widget-config-editor", never, { "inputs": { "alias": "inputs"; "required": false; }; "widgetKey": { "alias": "widgetKey"; "required": false; }; }, {}, never, never, true, never>;
2037
+ }
2038
+
1857
2039
  /** Metadata for PraxisDynamicForm component */
1858
2040
  declare const PRAXIS_DYNAMIC_FORM_COMPONENT_METADATA: ComponentDocMeta;
1859
2041
  /** Provider para auto-registrar metadados do componente Dynamic Form. */
@@ -2412,5 +2594,5 @@ declare function buildDynamicFormRuleAuthoringContext(config: Pick<FormConfig, '
2412
2594
  */
2413
2595
  declare const PRAXIS_DYNAMIC_FORM_AUTHORING_MANIFEST: ComponentAuthoringManifest;
2414
2596
 
2415
- 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 };
2416
- 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 };
2597
+ 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, PraxisDynamicFormWidgetConfigEditor, PraxisFilterForm, PraxisFilterFormWidgetConfigEditor, 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 };
2598
+ 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, PraxisDynamicFormWidgetEditorInputs, PraxisDynamicFormWidgetEditorValue, PraxisFilterFormWidgetEditorInputs, PraxisFilterFormWidgetEditorValue, PraxisFormActionEvent, RemovePolicy, RuleApplicationContext, RuleApplicationDiagnostic, RuleApplicationDiagnosticCode, RuleApplicationResult, RuleApplicationTargetIndex, RuleApplicationTargetType, ValidationReport, ValueKind$1 as ValueKind };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@praxisui/dynamic-form",
3
- "version": "8.0.0-beta.20",
3
+ "version": "8.0.0-beta.22",
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",
@@ -9,13 +9,13 @@
9
9
  "@angular/forms": "^20.0.0",
10
10
  "@angular/material": "^20.0.0",
11
11
  "@angular/router": "^20.0.0",
12
- "@praxisui/ai": "^8.0.0-beta.20",
13
- "@praxisui/dynamic-fields": "^8.0.0-beta.20",
14
- "@praxisui/metadata-editor": "^8.0.0-beta.20",
15
- "@praxisui/rich-content": "^8.0.0-beta.20",
16
- "@praxisui/settings-panel": "^8.0.0-beta.20",
17
- "@praxisui/visual-builder": "^8.0.0-beta.20",
18
- "@praxisui/core": "^8.0.0-beta.20",
12
+ "@praxisui/ai": "^8.0.0-beta.22",
13
+ "@praxisui/dynamic-fields": "^8.0.0-beta.22",
14
+ "@praxisui/metadata-editor": "^8.0.0-beta.22",
15
+ "@praxisui/rich-content": "^8.0.0-beta.22",
16
+ "@praxisui/settings-panel": "^8.0.0-beta.22",
17
+ "@praxisui/visual-builder": "^8.0.0-beta.22",
18
+ "@praxisui/core": "^8.0.0-beta.22",
19
19
  "rxjs": "^7.8.0"
20
20
  },
21
21
  "dependencies": {
@@ -58,6 +58,7 @@ Este documento e a referencia canonica da API JSON de praxis-dynamic-form-config
58
58
  - O editor visual e o editor JSON operam sobre `DynamicFormAuthoringDocument`.
59
59
  - O editor JSON aceita apenas o envelope canônico; payloads legados pertencem aos caminhos de compatibilidade do runtime.
60
60
  - `Apply` e `Save` emitem um snapshot canonico completo com semantica `replace-all`.
61
+ - Em comandos condicionais, o editor visual autora `globalAction.payload` estruturado; `globalAction.payloadExpr` fica reservado ao JSON avancado e e preservado no round-trip quando nenhum payload estruturado e definido.
61
62
  - `config`, `bindings` e `contextSnapshot` substituem integralmente o estado autoral anterior.
62
63
  - Ausencia de `bindings.mode` limpa o binding persistido e restaura o modo default efetivo do host.
63
64
  - Ausencia de `contextSnapshot.backConfig`, `contextSnapshot.presentation` ou `contextSnapshot.schemaPrefs` significa remocao explicita do bloco ausente.
@@ -20,6 +20,10 @@ owner: "praxis-ui"
20
20
  source_of_truth:
21
21
  - "projects/praxis-dynamic-form/src/lib/praxis-dynamic-form.ts"
22
22
  - "projects/praxis-dynamic-form/src/lib/praxis-dynamic-form.html"
23
+ - "projects/praxis-dynamic-form/src/lib/ai/dynamic-form-agentic-authoring-turn-flow.ts"
24
+ - "projects/praxis-dynamic-form/src/lib/ai/form-ai.adapter.ts"
25
+ - "projects/praxis-ai/src/lib/core/models/assistant-context.models.ts"
26
+ - "projects/praxis-ai/src/lib/core/services/assistant-session-registry.service.ts"
23
27
  - "projects/praxis-dynamic-form/src/lib/config-editor/praxis-dynamic-form-config-editor.ts"
24
28
  - "projects/praxis-dynamic-form/src/lib/utils/prepare-submit-payload.ts"
25
29
  - "projects/praxis-dynamic-fields/src/lib/directives/dynamic-field-loader.directive.ts"
@@ -30,8 +34,8 @@ source_of_truth:
30
34
  - "projects/praxis-core/src/lib/services/dynamic-form.service.ts"
31
35
  - "projects/praxis-core/src/lib/models/form/rule-property.schema.ts"
32
36
  - "projects/praxis-dynamic-form/docs/layout-items-visual-blocks.md"
33
- source_of_truth_last_verified: "2026-04-18"
34
- last_updated: "2026-04-22"
37
+ source_of_truth_last_verified: "2026-05-02"
38
+ last_updated: "2026-05-02"
35
39
  toc: true
36
40
  sidebar: true
37
41
  tags:
@@ -68,6 +72,23 @@ Este documento e a referencia canonica da API JSON de praxis-dynamic-form.
68
72
  - `backConfig`, `presentation` e `schemaPrefs` permanecem fora de `FormConfig`, mas fazem parte oficialmente do documento autoral persistivel em `contextSnapshot`.
69
73
  - APIs de compatibilidade como `applyConfigFromAdapter(...)` continuam aceitando payloads legados/parciais com semantica `merge-compat`, preservando campos nao informados.
70
74
 
75
+ ## AI assistant and semantic authoring boundary
76
+
77
+ `praxis-dynamic-form` usa o copiloto semantico Praxis como superficie assistiva contextual, nao como fonte primaria de regra de negocio. O componente pode abrir o assistente a partir de controles de configuracao, floating help ou selecao do canvas, mas a presenca global, minimizacao e retomada da sessao pertencem ao `PraxisAssistantSessionRegistryService`.
78
+
79
+ Contrato operacional:
80
+
81
+ - a integracao nova deve abrir `PraxisAiAssistantShellComponent`; `PraxisAiAssistantComponent` permanece legado para novos fluxos inteligentes;
82
+ - a identidade canonica da sessao segue `form:{routeKey}:{componentInstanceId || formId || 'form'}`;
83
+ - o contexto assistivel publico e `PraxisAssistantContextSnapshot`, com `identity`, `target`, `contextItems`, `authoringManifestRef`, `resourcePath`, `schemaFields`, digests seguros e hints de governanca;
84
+ - o snapshot pode apontar para `field`, `schemaBackedField`, `localField`, `section`, `row`, `column`, `visualBlock`, `formAction`, `message` ou `rule`, mas nao deve transportar `form.value`, `rawFormData`, config completa, notas privadas, estado runtime bruto, diagnostics arbitrarios, `pendingPatch`, `File`, `Blob`, bytes, base64 ou `previewUrl`;
85
+ - edicao local so pode ser aplicada quando a resposta for compilada para `componentEditPlan` validado pelo manifesto autoral do componente;
86
+ - patches livres retornados por backend/LLM sem plano compilado sao rejeitados pelo turn flow;
87
+ - pedidos sobre regra de negocio compartilhada, elegibilidade, compliance, LGPD, politica, acesso, aprovacao, publicacao, materializacao ou enforcement devem virar handoff governado para `domain-rules`, nao patch local de formulario;
88
+ - em `mode="view"` sem customizacao, ou quando o host estiver readonly, o assistente opera apenas em `inline-help`, `explain` e `diagnose`; `local-apply` e `manifest-compile` ficam bloqueados.
89
+
90
+ Essa fronteira preserva a premissa de plataforma: o formulario materializa e explica decisoes governadas, mas nao redefine sozinho a semantica canonica da decisao.
91
+
71
92
  ## Scope and positioning
72
93
 
73
94
  - Escopo: contrato JSON publico e limites de comportamento observavel.
@@ -107,6 +128,7 @@ Este documento e a referencia canonica da API JSON de praxis-dynamic-form.
107
128
  | `api` | not-specified | not-specified | n/a | Declared-only | Declarado no modelo; sem binding operacional direto no runtime atual. |
108
129
  | `messages` | not-specified | not-specified | n/a | Partial | Chaves principais de submit/confirmacao usadas; contrato e mais amplo. |
109
130
  | `formRules` | not-specified | not-specified | n/a | Active | Aplicadas no pipeline de regras do runtime. |
131
+ | `formCommandRules` | not-specified | not-specified | n/a | Active | Regras condicionais de comando avaliadas sobre `formData` estabilizado depois de `formRules`; primeiro corte suporta `global-action`. |
110
132
  | `formRulesState` | not-specified | not-specified | n/a | Active | Persistido para round-trip do builder visual. |
111
133
  | `hooks` | not-specified | not-specified | n/a | Active | Integracao de ciclo (before/after) via runtime de hooks. |
112
134
  | `hints` | not-specified | not-specified | n/a | Declared-only | Mantido no contrato/editor; sem render dedicado no template principal. |
@@ -155,6 +177,7 @@ Este arquivo foi adaptado para o padrao canonico atual sem remover conteudo tecn
155
177
  | `behavior` | Regras de UX/validação/edição | No | deep-merge | Inclui confirmação em dirty, validação reativa e overlays. |
156
178
  | `messages` | Mensagens de UX e feedback | No | deep-merge | Fallback para mensagens default quando ausente. |
157
179
  | `formRules` | Regras declarativas de runtime | No | replace-array | Aplicadas no pipeline de `rulesService`. |
180
+ | `formCommandRules` | Comandos condicionais governados | No | replace-array | Executa `GlobalActionRef` estruturado depois que valores calculados de `formRules` estabilizam. |
158
181
  | `hooks` | Hooks before/after por estágio | No | replace-array per stage | `@Input() hooks` pode sobrescrever `config.hooks`. |
159
182
 
160
183
  ### Nested configuration blocks
@@ -261,6 +284,39 @@ the canonical remote entity loaded through `resourcePath` and `resourceId`.
261
284
  - Em `formRules`, `targets` usam IDs canônicos do alvo. Para ações globais de formulário isso continua sendo o ID lógico da action; para ações de header de seção, o ID canônico é `section:<sectionId>:header-action:<actionLogicalId>`, evitando colisão com actions globais do form e entre seções.
262
285
  - Se a seção ainda não tiver `id`, o runtime aceita o fallback `header-action:<actionLogicalId>` por compatibilidade; para contratos persistidos, prefira sempre materializar `section.id`.
263
286
 
287
+ ### Field rule computed value contract
288
+
289
+ Regras com `targetType: "field"` podem usar `effect.properties.value` e `effect.propertiesWhenFalse.value` para escrever declarativamente o valor do `FormControl` alvo. O envelope canônico é fechado e exclusivo: exatamente `{ "expression": <JsonLogic> }` para valores calculados ou exatamente `{ "literal": <valor> }` para valores literais estruturados. Primitivos, `null` e arrays continuam aceitos como literais; objetos JSON Logic legados de operador único continuam aceitos para compatibilidade no runtime. O authoring visual e o editor JSON rejeitam objetos literais ambíguos sem envelope, como `{ "startDate": "...", "endDate": "..." }`, e envelopes com chaves extras, como `{ "literal": 1, "expression": { "var": "age" } }`. Valores calculados são resolvidos em uma fase anterior à aplicação das demais propriedades, com iteração limitada até estabilização, para que regras dependentes não fiquem acopladas à ordem do array.
290
+
291
+ ### Conditional command rule contract
292
+
293
+ Politica de erro do runtime: falhas de `GlobalActionService.executeRef(...)` em comandos condicionais sao fail-closed. Resultado `success: false` ou excecao assincrona gera diagnostico e nao reexecuta em loop enquanto a condicao continuar verdadeira. Quando `GlobalActionService` nao esta disponivel, acoes mutaveis (`api.post`, `api.put`, `api.patch`, `api.delete`) nao caem para `customAction`.
294
+
295
+ `formCommandRules` separa comandos com side effect das regras de propriedade. A regra é avaliada depois de `formRules` estabilizar `fieldValues`, então casos como `birthDate -> age -> dialog.alert` não dependem da ordem do array. O primeiro corte suporta apenas `effects[].kind: "global-action"` e executa `globalAction` via `GlobalActionService.executeRef(...)`. Por padrão, comandos usam `trigger: "on-condition-enter"` e `runOnInitialEvaluation: false`; `trigger: "while-true"` não executa `global-action` nesta versão. `distinct` usa chave composta por componente, regra, efeito, action, contexto e valor de `distinctBy`, e a memória é limpa quando a condição volta a falso. No editor visual, `payloadExpr` permanece escape hatch de JSON avancado: o editor preserva `payloadExpr` existente quando nenhum payload estruturado e definido, mas campos estruturados authoram `payload` literal.
296
+
297
+ Exemplo:
298
+
299
+ ```json
300
+ {
301
+ "formRules": [
302
+ {
303
+ "id": "birth-date-computes-age",
304
+ "targetType": "field",
305
+ "targets": ["age"],
306
+ "effect": {
307
+ "condition": { "!": [{ "isBlank": [{ "var": "birthDate" }] }] },
308
+ "properties": {
309
+ "value": { "expression": { "yearsSince": [{ "var": "birthDate" }] } }
310
+ },
311
+ "propertiesWhenFalse": {
312
+ "value": { "literal": null }
313
+ }
314
+ }
315
+ }
316
+ ]
317
+ }
318
+ ```
319
+
264
320
  ### Visual block rule contract
265
321
 
266
322
  Itens de layout `kind: "richContent"` podem ser alvo de `formRules` com `targetType: "visualBlock"`. O `target` é sempre o `id` do item em `sections[].rows[].columns[].items[]`; o bloco visual não recebe entrada em `fieldMetadata[]`, não cria `FormControl` e não entra em `formSubmit.formData` nem no payload HTTP.