@praxisui/dynamic-form 9.0.0-beta.1 → 9.0.0-beta.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@praxisui/dynamic-form",
3
- "version": "9.0.0-beta.1",
3
+ "version": "9.0.0-beta.11",
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": "^21.0.0",
@@ -9,13 +9,13 @@
9
9
  "@angular/forms": "^21.0.0",
10
10
  "@angular/material": "^21.0.0",
11
11
  "@angular/router": "^21.0.0",
12
- "@praxisui/ai": "^9.0.0-beta.1",
13
- "@praxisui/dynamic-fields": "^9.0.0-beta.1",
14
- "@praxisui/metadata-editor": "^9.0.0-beta.1",
15
- "@praxisui/rich-content": "^9.0.0-beta.1",
16
- "@praxisui/settings-panel": "^9.0.0-beta.1",
17
- "@praxisui/visual-builder": "^9.0.0-beta.1",
18
- "@praxisui/core": "^9.0.0-beta.1",
12
+ "@praxisui/ai": "^9.0.0-beta.11",
13
+ "@praxisui/dynamic-fields": "^9.0.0-beta.11",
14
+ "@praxisui/metadata-editor": "^9.0.0-beta.11",
15
+ "@praxisui/rich-content": "^9.0.0-beta.11",
16
+ "@praxisui/settings-panel": "^9.0.0-beta.11",
17
+ "@praxisui/visual-builder": "^9.0.0-beta.11",
18
+ "@praxisui/core": "^9.0.0-beta.11",
19
19
  "rxjs": "^7.8.0"
20
20
  },
21
21
  "dependencies": {
@@ -26,14 +26,7 @@
26
26
  "publishConfig": {
27
27
  "access": "public"
28
28
  },
29
- "repository": {
30
- "type": "git",
31
- "url": "https://github.com/codexrodrigues/praxis-ui-angular"
32
- },
33
- "homepage": "https://praxisui.dev",
34
- "bugs": {
35
- "url": "https://github.com/codexrodrigues/praxis-ui-angular/issues"
36
- },
29
+ "homepage": "https://praxisui.dev/components/dynamic-form",
37
30
  "keywords": [
38
31
  "angular",
39
32
  "praxisui",
@@ -58,7 +58,9 @@ 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
+ - Em comandos condicionais, o editor visual autora o efeito primario `effects[0].globalAction.payload` estruturado; `globalAction.payloadExpr` fica reservado ao JSON avancado e e preservado no round-trip quando nenhum payload estruturado e definido.
62
+ - Regras com multiplos `effects` continuam JSON-avancadas para autoria completa; ao editar o efeito primario pela UI, efeitos secundarios existentes sao preservados para evitar perda silenciosa.
63
+ - Em `formCommandRules[].policy`, o editor visual autora os campos comuns `distinct`, `distinctBy` e `runOnInitialEvaluation`; campos avancados vindos do JSON, como `trigger`, `debounceMs`, `errorPolicy` e `missingValuePolicy`, sao preservados no preview/apply, mas nao sao expostos como controles visuais completos.
62
64
  - `config`, `bindings` e `contextSnapshot` substituem integralmente o estado autoral anterior.
63
65
  - Ausencia de `bindings.mode` limpa o binding persistido e restaura o modo default efetivo do host.
64
66
  - Ausencia de `contextSnapshot.backConfig`, `contextSnapshot.presentation` ou `contextSnapshot.schemaPrefs` significa remocao explicita do bloco ausente.
@@ -277,7 +277,7 @@ Extensoes de runtime no editor (fora do contrato canonico):
277
277
  - A ação "Campos da API" reinsere apenas campos já existentes em `fieldMetadata[]`; ela grava `kind: 'field'` em `items[]` e atualiza `fields[]` somente como projeção derivada.
278
278
  - Estado colapsado da palette é persistido em `LayoutPrefsService`.
279
279
  - Blocos visuais:
280
- - A ação "Adicionar bloco visual" oferece presets de authoring internos para texto, aviso, separador, card informativo, `callout`, `keyValueList`, `recordSummary`, `disclosure` e `emptyState`.
280
+ - A ação "Adicionar bloco visual" oferece presets de authoring internos para texto, aviso, separador, card informativo, `callout`, `keyValueList`, prova de contrato, `recordSummary`, `disclosure` e `emptyState`.
281
281
  - Cada preset gera `RichContentDocument` válido em item `kind: 'richContent'`; presets não criam novo `kind`, não escrevem em `fieldMetadata[]` e não entram no payload de submit.
282
282
  - Presets como `emptyState` já podem semear `actionButton`, e o runtime do formulário encaminha essas ações pela mesma trilha de `customAction/globalAction` usada pelos demais CTAs do componente.
283
283
  - O guia didático completo está em `projects/praxis-dynamic-form/docs/layout-items-visual-blocks.md`.
@@ -7,7 +7,7 @@ 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, JsonLogicExpression, GlobalActionCatalogEntry, PraxisRuntimeConditionalEffectRule, PraxisRuntimeGlobalActionEffect, GlobalActionField, FieldDefinition, ComponentDocMeta, Breakpoint, DomainRuleRequestOptions, DomainRuleService, DomainRuleMaterialization, IconPickerService, GlobalActionRef, SurfaceOpenPayload, AiCapabilityCategory, AiCapabilityCatalog, AiValueKind, 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, SurfaceOpenPayload, GlobalActionField, PraxisEffectPolicy, FieldDefinition, ComponentDocMeta, Breakpoint, DomainRuleRequestOptions, DomainRuleService, DomainRuleMaterialization, IconPickerService, GlobalActionRef, AiCapabilityCategory, AiCapabilityCatalog, AiValueKind, 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';
@@ -1393,6 +1393,7 @@ declare class JsonConfigEditorComponent implements OnInit, OnDestroy {
1393
1393
  diagnostics: EditorDiagnostic[];
1394
1394
  private destroy$;
1395
1395
  private jsonTextChanges$;
1396
+ private readonly i18n;
1396
1397
  constructor(cdr: ChangeDetectorRef, configService: FormConfigService);
1397
1398
  ngOnInit(): void;
1398
1399
  ngOnDestroy(): void;
@@ -1412,6 +1413,9 @@ declare class JsonConfigEditorComponent implements OnInit, OnDestroy {
1412
1413
  private updateValidationState;
1413
1414
  insertHooksTemplate(): void;
1414
1415
  enableReactiveValidation(): void;
1416
+ tx(key: string, fallback: string, params?: Record<string, string | number | boolean | null | undefined>): string;
1417
+ private resolveI18n;
1418
+ private interpolateFallback;
1415
1419
  static ɵfac: i0.ɵɵFactoryDeclaration<JsonConfigEditorComponent, never>;
1416
1420
  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>;
1417
1421
  }
@@ -1448,6 +1452,12 @@ interface FormRuleDiagnostics {
1448
1452
  runtimeOnlyReason?: string;
1449
1453
  }
1450
1454
 
1455
+ type ConfigEditorTabKey = 'general' | 'schema' | 'layout' | 'hooks' | 'presentation' | 'behavior' | 'hints' | 'actions' | 'rules' | 'cascades' | 'messages' | 'navigation' | 'json';
1456
+ interface ConfigEditorTabOption {
1457
+ key: ConfigEditorTabKey;
1458
+ index: number;
1459
+ label: string;
1460
+ }
1451
1461
  interface CommandRulePreviewModel {
1452
1462
  state: 'ready' | 'invalid';
1453
1463
  executionMode: 'preview-only';
@@ -1456,11 +1466,11 @@ interface CommandRulePreviewModel {
1456
1466
  payload?: unknown;
1457
1467
  payloadExpr?: string;
1458
1468
  policy: {
1459
- trigger: 'on-condition-enter';
1469
+ trigger: NonNullable<PraxisEffectPolicy['trigger']>;
1460
1470
  distinct: boolean;
1461
1471
  distinctBy?: string;
1462
1472
  runOnInitialEvaluation?: boolean;
1463
- };
1473
+ } & Omit<PraxisEffectPolicy, 'trigger' | 'distinct' | 'distinctBy' | 'runOnInitialEvaluation'>;
1464
1474
  diagnostics: string[];
1465
1475
  }
1466
1476
  declare class PraxisDynamicFormConfigEditor implements SettingsValueProvider, OnInit, OnDestroy {
@@ -1473,6 +1483,7 @@ declare class PraxisDynamicFormConfigEditor implements SettingsValueProvider, On
1473
1483
  ruleBuilderConfig: RuleBuilderConfig;
1474
1484
  ruleBuilderState?: RuleBuilderState;
1475
1485
  currentRules: FormLayoutRule[];
1486
+ selectedConfigTabIndex: number;
1476
1487
  selectedCommandRuleId: string;
1477
1488
  commandRuleCondition: JsonLogicExpression | null;
1478
1489
  commandRuleConditionJson: string;
@@ -1482,6 +1493,8 @@ declare class PraxisDynamicFormConfigEditor implements SettingsValueProvider, On
1482
1493
  commandRuleDistinct: boolean;
1483
1494
  commandRuleDistinctBy: string;
1484
1495
  commandRuleRunOnInitialEvaluation: boolean;
1496
+ private commandRulePolicyTrigger;
1497
+ private commandRuleAdvancedPolicy;
1485
1498
  commandRuleAuthoringError: string | null;
1486
1499
  commandRulePayloadFieldErrors: Record<string, string>;
1487
1500
  ruleDiagnostics: FormRuleDiagnostics[];
@@ -1507,10 +1520,10 @@ declare class PraxisDynamicFormConfigEditor implements SettingsValueProvider, On
1507
1520
  private readonly editorMode;
1508
1521
  isPresentationMode: boolean;
1509
1522
  truncatePreview: boolean;
1510
- previewItems: {
1523
+ previewItems: Array<{
1511
1524
  label: string;
1512
1525
  value: string;
1513
- }[];
1526
+ }>;
1514
1527
  presentationPrefs: {
1515
1528
  labelPosition: 'above' | 'left';
1516
1529
  labelFontSize?: number | null;
@@ -1538,13 +1551,19 @@ declare class PraxisDynamicFormConfigEditor implements SettingsValueProvider, On
1538
1551
  private hasProcessedInitialRuleState;
1539
1552
  private jsonEditorIsValid;
1540
1553
  private globalActionValidationIssues;
1554
+ private readonly i18n;
1541
1555
  readonly globalActionCatalog: GlobalActionCatalogEntry[];
1542
1556
  isDirty$: BehaviorSubject<boolean>;
1543
1557
  isValid$: BehaviorSubject<boolean>;
1544
1558
  isBusy$: BehaviorSubject<boolean>;
1545
1559
  private lastRulesSignature;
1560
+ private pendingRulePropertiesStateSignature;
1546
1561
  private readonly DEBUG;
1547
1562
  private debugLog;
1563
+ get configTabOptions(): ConfigEditorTabOption[];
1564
+ configTabLabel(key: ConfigEditorTabKey): string;
1565
+ private buildPresentationPreviewItems;
1566
+ getConfigTabIndex(key: ConfigEditorTabKey): number;
1548
1567
  constructor(storage: AsyncConfigStorage, configService: FormConfigService, settingsPanel: SettingsPanelService, cdr: ChangeDetectorRef, globalActionCatalogSource?: ReadonlyArray<GlobalActionCatalogEntry[]>, injectedData?: any);
1549
1568
  ngOnInit(): void;
1550
1569
  reset(): void;
@@ -1571,6 +1590,7 @@ declare class PraxisDynamicFormConfigEditor implements SettingsValueProvider, On
1571
1590
  applyCommandRule(): void;
1572
1591
  deleteCommandRule(): void;
1573
1592
  get commandRuleActionSchema(): _praxisui_core.GlobalActionUiSchema | undefined;
1593
+ get commandRuleSurfaceOpenPayload(): SurfaceOpenPayload;
1574
1594
  shouldShowCommandActionField(field: GlobalActionField): boolean;
1575
1595
  isCommandActionFieldRequired(field: GlobalActionField): boolean;
1576
1596
  isCommandActionFieldMissing(field: GlobalActionField): boolean;
@@ -1579,12 +1599,15 @@ declare class PraxisDynamicFormConfigEditor implements SettingsValueProvider, On
1579
1599
  get commandRulePreview(): CommandRulePreviewModel;
1580
1600
  getCommandActionFieldValue(field: GlobalActionField): any;
1581
1601
  onCommandActionFieldChange(field: GlobalActionField, value: any): void;
1602
+ onCommandSurfaceOpenPayloadChange(payload: SurfaceOpenPayload): void;
1582
1603
  private initializeCommandRuleEditor;
1583
1604
  private loadCommandRuleEditor;
1605
+ private buildCommandRulePolicy;
1584
1606
  private updateCommandRules;
1585
1607
  private parseCommandRuleCondition;
1586
1608
  private parseOptionalJson;
1587
1609
  private parseCommandPayloadObject;
1610
+ private getCommandRuleErrorMessage;
1588
1611
  private collectCommandActionFieldValues;
1589
1612
  private setCommandActionFieldError;
1590
1613
  private clearCommandActionFieldError;
@@ -1596,6 +1619,8 @@ declare class PraxisDynamicFormConfigEditor implements SettingsValueProvider, On
1596
1619
  getRuleStatusTone(diagnostic: FormRuleDiagnostics): 'ok' | 'warn' | 'error';
1597
1620
  canAcceptPendingLlmRule(diagnostic: FormRuleDiagnostics): boolean;
1598
1621
  canApplyRulePropertyFix(diagnostic: FormRuleDiagnostics): boolean;
1622
+ canOpenRuleJsonReview(diagnostic: FormRuleDiagnostics): boolean;
1623
+ openRuleJsonReview(ruleId: string): void;
1599
1624
  applyRulePropertyFix(ruleId: string): void;
1600
1625
  acceptPendingLlmRule(ruleId: string): void;
1601
1626
  getRuleDiagnosticDetails(diagnostic: FormRuleDiagnostics): string[];
@@ -1641,6 +1666,9 @@ declare class PraxisDynamicFormConfigEditor implements SettingsValueProvider, On
1641
1666
  private toPresentationSnapshot;
1642
1667
  private toSchemaPrefsSnapshot;
1643
1668
  private toBackConfigSnapshot;
1669
+ tx(key: string, fallback: string, params?: Record<string, string | number | boolean | null | undefined>): string;
1670
+ private resolveI18n;
1671
+ private interpolateFallback;
1644
1672
  static ɵfac: i0.ɵɵFactoryDeclaration<PraxisDynamicFormConfigEditor, [null, null, null, null, { optional: true; }, { optional: true; }]>;
1645
1673
  static ɵcmp: i0.ɵɵComponentDeclaration<PraxisDynamicFormConfigEditor, "praxis-dynamic-form-config-editor", never, {}, {}, never, never, true, never>;
1646
1674
  }
@@ -1748,7 +1776,7 @@ declare class LayoutPrefsService {
1748
1776
  static ɵprov: i0.ɵɵInjectableDeclaration<LayoutPrefsService>;
1749
1777
  }
1750
1778
 
1751
- type VisualBlockPresetId = 'text' | 'notice' | 'divider' | 'infoCard' | 'callout' | 'keyValueList' | 'recordSummary' | 'lookupCard' | 'disclosure' | 'emptyState';
1779
+ type VisualBlockPresetId = 'text' | 'notice' | 'divider' | 'infoCard' | 'callout' | 'keyValueList' | 'contractProof' | 'recordSummary' | 'lookupCard' | 'disclosure' | 'emptyState';
1752
1780
  interface VisualBlockPreset {
1753
1781
  id: VisualBlockPresetId;
1754
1782
  labelKey: string;
@@ -1953,6 +1981,7 @@ declare class RowConfiguratorComponent implements OnChanges {
1953
1981
  activeDropIndex: number | null;
1954
1982
  protected readonly visualBlockPresets: readonly VisualBlockPreset[];
1955
1983
  private readonly i18n;
1984
+ private readonly dialog;
1956
1985
  private hoverTimer;
1957
1986
  protected readonly breakpoints: Breakpoint[];
1958
1987
  previewBreakpoint: Breakpoint;
@@ -2171,6 +2200,7 @@ declare class CanvasToolbarComponent {
2171
2200
  /** Estado interno para animar o fechamento. */
2172
2201
  closing: boolean;
2173
2202
  private readonly closeAnimMs;
2203
+ private readonly i18n;
2174
2204
  toggleReadonly: EventEmitter<void>;
2175
2205
  toggleRequired: EventEmitter<void>;
2176
2206
  toggleHidden: EventEmitter<void>;
@@ -2188,6 +2218,7 @@ declare class CanvasToolbarComponent {
2188
2218
  onGlobalKeydown(ev: KeyboardEvent): void;
2189
2219
  /** Inicia animação de saída e emite o evento ao final. */
2190
2220
  triggerClose(): void;
2221
+ tx(key: string, fallback: string, params?: Record<string, string | number>): string;
2191
2222
  static ɵfac: i0.ɵɵFactoryDeclaration<CanvasToolbarComponent, never>;
2192
2223
  static ɵcmp: i0.ɵɵComponentDeclaration<CanvasToolbarComponent, "praxis-canvas-toolbar", never, { "selectedElement": { "alias": "selectedElement"; "required": false; }; }, { "editMetadata": "editMetadata"; "delete": "delete"; "moveUp": "moveUp"; "moveDown": "moveDown"; "selectPath": "selectPath"; "requestClose": "requestClose"; "toggleReadonly": "toggleReadonly"; "toggleRequired": "toggleRequired"; "toggleHidden": "toggleHidden"; "toggleDisabled": "toggleDisabled"; }, never, never, true, never>;
2193
2224
  }
@@ -2345,6 +2376,7 @@ declare class RowEditorComponent implements OnInit, OnDestroy, SettingsValueProv
2345
2376
  isBusy$: BehaviorSubject<boolean>;
2346
2377
  private destroy$;
2347
2378
  private initialValueSig;
2379
+ private readonly i18n;
2348
2380
  constructor(fb: FormBuilder, data: {
2349
2381
  row: EditableFormRow;
2350
2382
  });
@@ -2353,10 +2385,12 @@ declare class RowEditorComponent implements OnInit, OnDestroy, SettingsValueProv
2353
2385
  getSettingsValue(): any;
2354
2386
  displayValue(value: number | null | undefined, fallback: string): string | number;
2355
2387
  displayPxValue(value: number | null | undefined): string;
2388
+ visibilityStateLabel(bp: Breakpoint): string;
2356
2389
  private setColumns;
2357
2390
  applyPreset(preset: 'full' | 'half' | 'thirds' | 'thirdTwoThird' | 'twoThirdThird' | 'autoBalance'): void;
2358
2391
  private resolveHiddenMode;
2359
2392
  setHiddenMode(mode: 'none' | 'mobile' | 'desktop'): void;
2393
+ tx(key: string, fallback: string, params?: Record<string, string | number>): string;
2360
2394
  static ɵfac: i0.ɵɵFactoryDeclaration<RowEditorComponent, never>;
2361
2395
  static ɵcmp: i0.ɵɵComponentDeclaration<RowEditorComponent, "praxis-row-editor", never, {}, {}, never, never, true, never>;
2362
2396
  }
@@ -2373,6 +2407,7 @@ declare class ColumnEditorComponent implements OnInit, OnDestroy, SettingsValueP
2373
2407
  isBusy$: BehaviorSubject<boolean>;
2374
2408
  private destroy$;
2375
2409
  private _previewTimer;
2410
+ private readonly i18n;
2376
2411
  constructor(fb: FormBuilder, data: {
2377
2412
  column: FormColumn;
2378
2413
  });
@@ -2396,6 +2431,7 @@ declare class ColumnEditorComponent implements OnInit, OnDestroy, SettingsValueP
2396
2431
  resetResponsive(): void;
2397
2432
  applyPreset(key: 'full' | 'half' | 'third' | 'twoThird' | 'centered' | 'narrowSidebar' | 'wideContent' | 'stackMobile' | 'hideMobile' | 'desktopOnly'): void;
2398
2433
  toggleHiddenBp(bp: Breakpoint): void;
2434
+ tx(key: string, fallback: string, params?: Record<string, string | number>): string;
2399
2435
  static ɵfac: i0.ɵɵFactoryDeclaration<ColumnEditorComponent, never>;
2400
2436
  static ɵcmp: i0.ɵɵComponentDeclaration<ColumnEditorComponent, "praxis-column-editor", never, {}, {}, never, never, true, never>;
2401
2437
  }