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

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;
@@ -1091,6 +1121,35 @@ declare class PraxisDynamicForm implements OnInit, OnChanges, OnDestroy {
1091
1121
  * IMPORTANTE: Independe completamente do mode do formulário
1092
1122
  */
1093
1123
  toggleEditMode(): void;
1124
+ openAiAssistant(): void;
1125
+ openAiAssistantFromSession(session: PraxisAssistantSessionSnapshot): void;
1126
+ closeAiAssistant(): void;
1127
+ onAiAssistantPromptChange(prompt: string): void;
1128
+ onAiAssistantSubmit(prompt: string): void;
1129
+ onAiAssistantApply(): void;
1130
+ onAiAssistantRetry(): void;
1131
+ onAiAssistantCancel(): void;
1132
+ onAiAssistantQuickReply(reply: PraxisAssistantShellQuickReply): void;
1133
+ onAiAssistantEditMessage(message: PraxisAssistantShellMessage): void;
1134
+ onAiAssistantResendMessage(message: PraxisAssistantShellMessage): void;
1135
+ onAiAssistantLayoutChange(layout: PraxisAssistantShellLayout): void;
1136
+ aiAssistantTriggerTestId(position: string): string;
1137
+ private initializeAiAssistantController;
1138
+ private buildAiAssistantContextItems;
1139
+ private buildAiAssistantContextSnapshot;
1140
+ private syncAiAssistantSession;
1141
+ private hasAiAssistantSessionState;
1142
+ private resolveAiAssistantSessionId;
1143
+ private resolveAiAssistantOwnerId;
1144
+ private resolveAiAssistantRouteKey;
1145
+ private resolveAiAssistantSummary;
1146
+ private resolveAiAssistantBadge;
1147
+ private resolveAiAssistantIcon;
1148
+ private resolveAiAssistantSelectedTarget;
1149
+ private toAiAssistantTargetKind;
1150
+ private toAiAssistantTargetId;
1151
+ private toAiAssistantTargetLabel;
1152
+ private toAiAssistantPath;
1094
1153
  openConfigEditor(): Promise<void>;
1095
1154
  onElementMouseEnter(event: MouseEvent, type: CanvasElementType, data: any, element?: HTMLElement): void;
1096
1155
  onElementMouseLeave(event: MouseEvent): void;
@@ -1347,6 +1406,21 @@ interface FormRuleDiagnostics {
1347
1406
  runtimeOnlyReason?: string;
1348
1407
  }
1349
1408
 
1409
+ interface CommandRulePreviewModel {
1410
+ state: 'ready' | 'invalid';
1411
+ executionMode: 'preview-only';
1412
+ actionId: string;
1413
+ condition: JsonLogicExpression | null;
1414
+ payload?: unknown;
1415
+ payloadExpr?: string;
1416
+ policy: {
1417
+ trigger: 'on-condition-enter';
1418
+ distinct: boolean;
1419
+ distinctBy?: string;
1420
+ runOnInitialEvaluation?: boolean;
1421
+ };
1422
+ diagnostics: string[];
1423
+ }
1350
1424
  declare class PraxisDynamicFormConfigEditor implements SettingsValueProvider, OnInit, OnDestroy {
1351
1425
  private storage;
1352
1426
  private configService;
@@ -1357,6 +1431,17 @@ declare class PraxisDynamicFormConfigEditor implements SettingsValueProvider, On
1357
1431
  ruleBuilderConfig: RuleBuilderConfig;
1358
1432
  ruleBuilderState?: RuleBuilderState;
1359
1433
  currentRules: FormLayoutRule[];
1434
+ selectedCommandRuleId: string;
1435
+ commandRuleCondition: JsonLogicExpression | null;
1436
+ commandRuleConditionJson: string;
1437
+ commandRuleActionId: string;
1438
+ commandRulePayloadJson: string;
1439
+ private commandRulePayloadExpr;
1440
+ commandRuleDistinct: boolean;
1441
+ commandRuleDistinctBy: string;
1442
+ commandRuleRunOnInitialEvaluation: boolean;
1443
+ commandRuleAuthoringError: string | null;
1444
+ commandRulePayloadFieldErrors: Record<string, string>;
1360
1445
  ruleDiagnostics: FormRuleDiagnostics[];
1361
1446
  visualBlockNodeOptions: Record<string, VisualBlockRuleNodeOption[]>;
1362
1447
  ruleDiagnosticsSummary: {
@@ -1411,7 +1496,7 @@ declare class PraxisDynamicFormConfigEditor implements SettingsValueProvider, On
1411
1496
  private hasProcessedInitialRuleState;
1412
1497
  private jsonEditorIsValid;
1413
1498
  private globalActionValidationIssues;
1414
- private readonly globalActionCatalog;
1499
+ readonly globalActionCatalog: GlobalActionCatalogEntry[];
1415
1500
  isDirty$: BehaviorSubject<boolean>;
1416
1501
  isValid$: BehaviorSubject<boolean>;
1417
1502
  isBusy$: BehaviorSubject<boolean>;
@@ -1435,6 +1520,35 @@ declare class PraxisDynamicFormConfigEditor implements SettingsValueProvider, On
1435
1520
  private buildGlobalActionCatalog;
1436
1521
  onRulesChanged(state: RuleBuilderState): void;
1437
1522
  onRulePropertiesChanged(rules: FormLayoutRule[]): void;
1523
+ get commandRules(): PraxisRuntimeConditionalEffectRule<PraxisRuntimeGlobalActionEffect>[];
1524
+ get selectedCommandRule(): PraxisRuntimeConditionalEffectRule<PraxisRuntimeGlobalActionEffect> | undefined;
1525
+ onCommandRuleSelectionChange(): void;
1526
+ onCommandActionChange(): void;
1527
+ onCommandConditionChanged(condition: JsonLogicExpression | null): void;
1528
+ addCommandRule(): void;
1529
+ applyCommandRule(): void;
1530
+ deleteCommandRule(): void;
1531
+ get commandRuleActionSchema(): _praxisui_core.GlobalActionUiSchema | undefined;
1532
+ shouldShowCommandActionField(field: GlobalActionField): boolean;
1533
+ isCommandActionFieldRequired(field: GlobalActionField): boolean;
1534
+ isCommandActionFieldMissing(field: GlobalActionField): boolean;
1535
+ hasCommandActionFieldError(key: string): boolean;
1536
+ getCommandActionFieldError(key: string): string;
1537
+ get commandRulePreview(): CommandRulePreviewModel;
1538
+ getCommandActionFieldValue(field: GlobalActionField): any;
1539
+ onCommandActionFieldChange(field: GlobalActionField, value: any): void;
1540
+ private initializeCommandRuleEditor;
1541
+ private loadCommandRuleEditor;
1542
+ private updateCommandRules;
1543
+ private parseCommandRuleCondition;
1544
+ private parseOptionalJson;
1545
+ private parseCommandPayloadObject;
1546
+ private collectCommandActionFieldValues;
1547
+ private setCommandActionFieldError;
1548
+ private clearCommandActionFieldError;
1549
+ private nextCommandRuleId;
1550
+ private getDefaultCommandActionId;
1551
+ private formatGlobalActionIssue;
1438
1552
  private computeRuleDiagnosticsSummary;
1439
1553
  getRuleStatusLabel(diagnostic: FormRuleDiagnostics): string;
1440
1554
  getRuleStatusTone(diagnostic: FormRuleDiagnostics): 'ok' | 'warn' | 'error';
@@ -1537,6 +1651,37 @@ declare const PRAXIS_FILTER_FORM_COMPONENT_METADATA: ComponentDocMeta;
1537
1651
  /** Provider to register PraxisFilterForm metadata. */
1538
1652
  declare function providePraxisFilterFormMetadata(): Provider;
1539
1653
 
1654
+ interface PraxisFilterFormWidgetEditorInputs {
1655
+ config?: FormConfig | null;
1656
+ formId?: string;
1657
+ resourcePath?: string;
1658
+ mode?: DynamicFormMode | string;
1659
+ [key: string]: unknown;
1660
+ }
1661
+ interface PraxisFilterFormWidgetEditorValue {
1662
+ inputs: PraxisFilterFormWidgetEditorInputs;
1663
+ }
1664
+ declare class PraxisFilterFormWidgetConfigEditor implements SettingsValueProvider, AfterViewInit, OnDestroy {
1665
+ inputs: PraxisFilterFormWidgetEditorInputs | null;
1666
+ widgetKey?: string;
1667
+ formEditor?: PraxisDynamicFormConfigEditor;
1668
+ readonly isDirty$: BehaviorSubject<boolean>;
1669
+ readonly isValid$: BehaviorSubject<boolean>;
1670
+ readonly isBusy$: BehaviorSubject<boolean>;
1671
+ private readonly subscription;
1672
+ ngAfterViewInit(): void;
1673
+ ngOnDestroy(): void;
1674
+ getSettingsValue(): PraxisFilterFormWidgetEditorValue;
1675
+ onSave(): PraxisFilterFormWidgetEditorValue;
1676
+ reset(): void;
1677
+ private initializeChildEditor;
1678
+ private buildValue;
1679
+ private createDocumentFromInputs;
1680
+ private normalizeMode;
1681
+ static ɵfac: i0.ɵɵFactoryDeclaration<PraxisFilterFormWidgetConfigEditor, never>;
1682
+ 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>;
1683
+ }
1684
+
1540
1685
  /** Tokens for theme colors used across the layout editor. */
1541
1686
  declare enum LayoutColorToken {
1542
1687
  Surface = "--md-sys-color-surface",
@@ -1854,6 +1999,40 @@ declare class FieldConfiguratorComponent {
1854
1999
  static ɵcmp: i0.ɵɵComponentDeclaration<FieldConfiguratorComponent, "praxis-field-configurator", never, { "field": { "alias": "field"; "required": false; }; }, {}, never, never, true, never>;
1855
2000
  }
1856
2001
 
2002
+ interface PraxisDynamicFormWidgetEditorInputs {
2003
+ config?: FormConfig | null;
2004
+ mode?: DynamicFormMode;
2005
+ formId?: string;
2006
+ componentInstanceId?: string;
2007
+ backConfig?: BackConfig;
2008
+ notifyIfOutdated?: 'inline' | 'snackbar' | 'both' | 'none';
2009
+ snoozeMs?: number;
2010
+ autoOpenSettingsOnOutdated?: boolean;
2011
+ [key: string]: unknown;
2012
+ }
2013
+ interface PraxisDynamicFormWidgetEditorValue {
2014
+ inputs: PraxisDynamicFormWidgetEditorInputs;
2015
+ }
2016
+ declare class PraxisDynamicFormWidgetConfigEditor implements SettingsValueProvider, AfterViewInit, OnDestroy {
2017
+ inputs: PraxisDynamicFormWidgetEditorInputs | null;
2018
+ widgetKey?: string;
2019
+ formEditor?: PraxisDynamicFormConfigEditor;
2020
+ readonly isDirty$: BehaviorSubject<boolean>;
2021
+ readonly isValid$: BehaviorSubject<boolean>;
2022
+ readonly isBusy$: BehaviorSubject<boolean>;
2023
+ private readonly subscription;
2024
+ ngAfterViewInit(): void;
2025
+ ngOnDestroy(): void;
2026
+ getSettingsValue(): PraxisDynamicFormWidgetEditorValue;
2027
+ onSave(): PraxisDynamicFormWidgetEditorValue;
2028
+ reset(): void;
2029
+ private initializeChildEditor;
2030
+ private buildValue;
2031
+ private createDocumentFromInputs;
2032
+ static ɵfac: i0.ɵɵFactoryDeclaration<PraxisDynamicFormWidgetConfigEditor, never>;
2033
+ 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>;
2034
+ }
2035
+
1857
2036
  /** Metadata for PraxisDynamicForm component */
1858
2037
  declare const PRAXIS_DYNAMIC_FORM_COMPONENT_METADATA: ComponentDocMeta;
1859
2038
  /** Provider para auto-registrar metadados do componente Dynamic Form. */
@@ -2412,5 +2591,5 @@ declare function buildDynamicFormRuleAuthoringContext(config: Pick<FormConfig, '
2412
2591
  */
2413
2592
  declare const PRAXIS_DYNAMIC_FORM_AUTHORING_MANIFEST: ComponentAuthoringManifest;
2414
2593
 
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 };
2594
+ 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 };
2595
+ 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.21",
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.21",
13
+ "@praxisui/dynamic-fields": "^8.0.0-beta.21",
14
+ "@praxisui/metadata-editor": "^8.0.0-beta.21",
15
+ "@praxisui/rich-content": "^8.0.0-beta.21",
16
+ "@praxisui/settings-panel": "^8.0.0-beta.21",
17
+ "@praxisui/visual-builder": "^8.0.0-beta.21",
18
+ "@praxisui/core": "^8.0.0-beta.21",
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.