@praxisui/visual-builder 3.0.0-beta.9 → 5.0.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.d.ts CHANGED
@@ -1,30 +1,49 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { EventEmitter, OnInit, OnDestroy, OnChanges, AfterViewInit, ElementRef, ChangeDetectorRef, SimpleChanges } from '@angular/core';
3
- import { ContextProvider, FunctionRegistry, ExportOptions as ExportOptions$1, ContextualSpecification, ValidationIssue as ValidationIssue$1 } from '@praxisui/specification';
4
- import { SpecificationMetadata, Specification } from '@praxisui/specification-core';
5
- export { SpecificationMetadata } from '@praxisui/specification-core';
3
+ import { JsonLogicExpression, FormLayoutRule, RulePropertySchema, PraxisI18nService } from '@praxisui/core';
6
4
  import { Observable } from 'rxjs';
7
- import { FormLayoutRule, RulePropertySchema, PraxisI18nService } from '@praxisui/core';
8
- import { DslParsingConfig, DslParsingResult, DslParsingService, AiResponseValidatorService, AiRuleResponse } from '@praxisui/ai';
9
5
  import { MatDialog, MatDialogRef } from '@angular/material/dialog';
10
6
  import { MatSnackBar } from '@angular/material/snack-bar';
7
+ import { AiResponseValidatorService, AiRuleResponse } from '@praxisui/ai';
11
8
  import { FormBuilder, FormGroup, FormControl, FormArray } from '@angular/forms';
12
9
  import { MatSelectChange } from '@angular/material/select';
13
10
  import { CdkDragDrop } from '@angular/cdk/drag-drop';
14
11
  import { MatButtonToggleChange } from '@angular/material/button-toggle';
15
- import { MatSlideToggleChange } from '@angular/material/slide-toggle';
16
12
  import { MatChipInputEvent } from '@angular/material/chips';
17
13
 
18
14
  /**
19
15
  * Models for the Visual Rule Builder
20
16
  */
21
17
 
18
+ interface RuleContextProvider {
19
+ hasValue(path: string): boolean;
20
+ getValue<T = unknown>(path: string): T | undefined;
21
+ }
22
+ type RuleFunctionRegistry<T = unknown> = Record<string, T>;
23
+ interface DocumentationLink {
24
+ title?: string;
25
+ url?: string;
26
+ }
27
+ interface SpecificationMetadata {
28
+ code?: string;
29
+ message?: string;
30
+ tag?: string;
31
+ description?: string;
32
+ priority?: string;
33
+ uiConfig?: Record<string, unknown>;
34
+ customProperties?: Record<string, unknown>;
35
+ conditionExpression?: JsonLogicExpression | null;
36
+ fallbackMetadata?: SpecificationMetadata;
37
+ internalNotes?: string;
38
+ documentationLinks?: DocumentationLink[];
39
+ [key: string]: unknown;
40
+ }
22
41
  /**
23
42
  * Value types for rule configuration
24
43
  */
25
44
  type ValueType = 'literal' | 'field' | 'context' | 'function';
26
45
  /**
27
- * Valid comparison operators (aligned with @praxisui/specification)
46
+ * Valid comparison operators supported by the visual builder
28
47
  */
29
48
  type ValidComparisonOperator = 'eq' | 'neq' | 'lt' | 'lte' | 'gt' | 'gte' | 'contains' | 'startsWith' | 'endsWith' | 'in' | 'notIn' | 'matches' | 'notMatches' | 'isNull' | 'isNotNull' | 'isEmpty' | 'isNotEmpty';
30
49
  interface RuleNode {
@@ -80,12 +99,12 @@ declare enum RuleNodeType {
80
99
  * String literal type for rule node types (for flexibility)
81
100
  */
82
101
  type RuleNodeTypeString = 'fieldCondition' | 'propertyRule' | 'andGroup' | 'orGroup' | 'notGroup' | 'xorGroup' | 'impliesGroup' | 'requiredIf' | 'visibleIf' | 'disabledIf' | 'readonlyIf' | 'forEach' | 'uniqueBy' | 'minLength' | 'maxLength' | 'ifDefined' | 'ifNotNull' | 'ifExists' | 'withDefault' | 'functionCall' | 'fieldToField' | 'contextual' | 'atLeast' | 'exactly' | 'expression' | 'contextualTemplate' | 'custom';
83
- type RuleNodeConfig = FieldConditionConfig | PropertyRuleConfig | BooleanGroupConfig | ConditionalValidatorConfig | CollectionValidationConfig | CollectionValidatorConfig | OptionalFieldConfig | FunctionCallConfig | FieldToFieldConfig | ContextualConfig$1 | CardinalityConfig | ExpressionConfig | ContextualTemplateConfig | CustomConfig;
102
+ type RuleNodeConfig = FieldConditionConfig | PropertyRuleConfig | BooleanGroupConfig | ConditionalValidatorConfig | CollectionValidationConfig | CollectionValidatorConfig | OptionalFieldConfig | FunctionCallConfig | FieldToFieldConfig | ContextualConfig | CardinalityConfig | ExpressionConfig | ContextualTemplateConfig | CustomConfig;
84
103
  interface FieldConditionConfig {
85
104
  type: 'fieldCondition';
86
105
  /** Primary field name */
87
106
  fieldName: string;
88
- /** Comparison operator aligned with @praxisui/specification */
107
+ /** Comparison operator supported by the visual builder */
89
108
  operator: ValidComparisonOperator | string;
90
109
  /** Comparison value */
91
110
  value?: unknown;
@@ -109,8 +128,8 @@ interface PropertyRuleConfig {
109
128
  properties?: Record<string, any>;
110
129
  /** Properties applied when condition is false */
111
130
  propertiesWhenFalse?: Record<string, any>;
112
- /** Optional condition node or inline DSL string */
113
- condition?: RuleNode | string;
131
+ /** Optional condition node or inline condition expression */
132
+ condition?: RuleNode | JsonLogicExpression | null;
114
133
  /** Optional reference to a condition node inside the graph */
115
134
  conditionNodeId?: string;
116
135
  /** Metadata for UI/description */
@@ -169,7 +188,7 @@ interface ConditionalValidatorConfig {
169
188
  readonlyStyle?: string;
170
189
  /** Show readonly indicator */
171
190
  showReadonlyIndicator?: boolean;
172
- /** Metadata aligned with @praxisui/specification */
191
+ /** Optional metadata for validation messages and UI hints */
173
192
  metadata?: SpecificationMetadata;
174
193
  }
175
194
  interface CollectionValidationConfig {
@@ -189,7 +208,6 @@ interface CollectionValidationConfig {
189
208
  }
190
209
  /**
191
210
  * Enhanced collection validator configuration (Phase 2 Implementation)
192
- * Aligned with @praxisui/specification collection validation patterns
193
211
  */
194
212
  interface CollectionValidatorConfig {
195
213
  type: 'forEach' | 'uniqueBy' | 'minLength' | 'maxLength';
@@ -282,14 +300,14 @@ interface FieldToFieldConfig {
282
300
  /** Optional metadata for validation */
283
301
  metadata?: SpecificationMetadata;
284
302
  }
285
- interface ContextualConfig$1 {
303
+ interface ContextualConfig {
286
304
  type: 'contextual';
287
305
  /** Template string with context placeholders */
288
306
  template: string;
289
307
  /** Available context variables */
290
308
  contextVariables: Record<string, unknown>;
291
309
  /** Optional context provider for dynamic values */
292
- contextProvider?: ContextProvider;
310
+ contextProvider?: RuleContextProvider;
293
311
  /** Strict validation of context tokens */
294
312
  strictContextValidation?: boolean;
295
313
  /** Optional metadata */
@@ -350,14 +368,12 @@ interface RuleBuilderState {
350
368
  rootNodes: string[];
351
369
  /** Currently selected node ID */
352
370
  selectedNodeId?: string;
353
- /** Current DSL representation */
354
- currentDSL?: string;
355
371
  /** Current JSON representation */
356
372
  currentJSON?: unknown;
357
373
  /** Validation errors */
358
374
  validationErrors: ValidationError$1[];
359
375
  /** Build mode */
360
- mode: 'visual' | 'dsl' | 'json';
376
+ mode: 'visual' | 'json';
361
377
  /** Whether the rule is dirty (has unsaved changes) */
362
378
  isDirty: boolean;
363
379
  /** Undo/redo history */
@@ -389,10 +405,9 @@ interface RuleBuilderSnapshot {
389
405
  nodes: Record<string, RuleNode>;
390
406
  rootNodes: string[];
391
407
  selectedNodeId?: string;
392
- currentDSL?: string;
393
408
  currentJSON?: any;
394
409
  validationErrors?: ValidationError$1[];
395
- mode?: 'visual' | 'dsl' | 'json';
410
+ mode?: 'visual' | 'json';
396
411
  isDirty?: boolean;
397
412
  };
398
413
  }
@@ -461,15 +476,11 @@ interface TemplateMetadata {
461
476
  */
462
477
  interface ExportOptions {
463
478
  /** Export format */
464
- format: 'json' | 'dsl' | 'typescript' | 'form-config';
479
+ format: 'json' | 'typescript' | 'form-config';
465
480
  /** Include metadata in export */
466
481
  includeMetadata?: boolean;
467
- /** Pretty print JSON/DSL */
482
+ /** Pretty print JSON */
468
483
  prettyPrint?: boolean;
469
- /** Include comments in DSL */
470
- includeComments?: boolean;
471
- /** Metadata position in DSL */
472
- metadataPosition?: 'before' | 'after' | 'inline';
473
484
  /** TypeScript interface name (for TS export) */
474
485
  interfaceName?: string;
475
486
  /** Additional export configuration */
@@ -480,7 +491,7 @@ interface ExportOptions {
480
491
  */
481
492
  interface ImportOptions {
482
493
  /** Source format */
483
- format: 'json' | 'dsl' | 'form-config';
494
+ format: 'json' | 'form-config';
484
495
  /** Whether to merge with existing rules */
485
496
  merge?: boolean;
486
497
  /** Whether to preserve existing metadata */
@@ -529,8 +540,6 @@ interface RuleBuilderConfig {
529
540
  showAdvanced?: boolean;
530
541
  /** Enable drag and drop */
531
542
  enableDragDrop?: boolean;
532
- /** Show DSL preview */
533
- showDSLPreview?: boolean;
534
543
  /** Show validation errors inline */
535
544
  showInlineErrors?: boolean;
536
545
  /** Auto-save interval (ms) */
@@ -548,7 +557,7 @@ interface RuleBuilderConfig {
548
557
  /** Export/import configuration */
549
558
  exportImport?: {
550
559
  /** Default export format */
551
- defaultExportFormat?: 'json' | 'dsl' | 'typescript';
560
+ defaultExportFormat?: 'json' | 'typescript';
552
561
  /** Supported formats */
553
562
  supportedFormats?: string[];
554
563
  /** Include metadata by default */
@@ -572,27 +581,27 @@ interface OptionalFieldConfig {
572
581
  metadata?: SpecificationMetadata;
573
582
  }
574
583
  /**
575
- * Configuration for expression specifications (aligned with @praxisui/specification)
584
+ * Configuration for legacy expression authoring support
576
585
  */
577
586
  interface ExpressionConfig {
578
587
  type: 'expression';
579
- /** DSL expression string */
588
+ /** Legacy textual expression string */
580
589
  expression: string;
581
590
  /** Function registry for validation */
582
- functionRegistry?: FunctionRegistry<unknown>;
591
+ functionRegistry?: RuleFunctionRegistry<unknown>;
583
592
  /** Context provider for variable resolution */
584
- contextProvider?: ContextProvider;
593
+ contextProvider?: RuleContextProvider;
585
594
  /** Known field names for validation */
586
595
  knownFields?: string[];
587
596
  /** Enable performance warnings */
588
597
  enablePerformanceWarnings?: boolean;
589
598
  /** Maximum expression complexity */
590
599
  maxComplexity?: number;
591
- /** Metadata aligned with @praxisui/specification */
600
+ /** Optional metadata for UI/description */
592
601
  metadata?: SpecificationMetadata;
593
602
  }
594
603
  /**
595
- * Configuration for contextual template specifications (aligned with @praxisui/specification)
604
+ * Configuration for contextual template authoring
596
605
  */
597
606
  interface ContextualTemplateConfig {
598
607
  type: 'contextualTemplate';
@@ -601,10 +610,10 @@ interface ContextualTemplateConfig {
601
610
  /** Available context variables */
602
611
  contextVariables?: Record<string, unknown>;
603
612
  /** Context provider instance */
604
- contextProvider?: ContextProvider;
613
+ contextProvider?: RuleContextProvider;
605
614
  /** Enable strict validation of context tokens */
606
615
  strictContextValidation?: boolean;
607
- /** Metadata aligned with @praxisui/specification */
616
+ /** Optional metadata for UI/description */
608
617
  metadata?: SpecificationMetadata;
609
618
  }
610
619
 
@@ -984,20 +993,6 @@ interface ValidationResult {
984
993
  errors: string[];
985
994
  }
986
995
 
987
- type DslContextScope = 'user' | 'session' | 'env' | 'global' | string;
988
- interface DslContextVariable {
989
- /** Variable name */
990
- name: string;
991
- /** Variable type */
992
- type: 'string' | 'number' | 'boolean' | 'date' | 'object' | 'array';
993
- /** Variable scope */
994
- scope: DslContextScope;
995
- /** Description */
996
- description?: string;
997
- /** Example value */
998
- example?: string;
999
- }
1000
-
1001
996
  /**
1002
997
  * Registry service for managing RuleNode instances and their relationships.
1003
998
  * Solves the core problem of resolving string IDs to actual RuleNode objects.
@@ -1187,479 +1182,18 @@ interface CleanupResult {
1187
1182
  memoryFreed: number;
1188
1183
  }
1189
1184
 
1190
- /**
1191
- * Context interface for rule conversion operations
1192
- * Eliminates circular dependencies between converters and factory
1193
- */
1194
- interface ConversionContext {
1195
- /**
1196
- * Convert a child node to a specification
1197
- * This method is provided by the factory to avoid circular dependencies
1198
- */
1199
- convertChild<T extends object = any>(node: RuleNode): Specification<T>;
1200
- /**
1201
- * Convert multiple child nodes to specifications
1202
- */
1203
- convertChildren<T extends object = any>(nodes: RuleNode[]): Specification<T>[];
1204
- /**
1205
- * Check if a node type is supported
1206
- */
1207
- isSupported(nodeType: string): boolean;
1208
- /**
1209
- * Validate that a node can be converted
1210
- */
1211
- validateNode(node: RuleNode): {
1212
- isValid: boolean;
1213
- errors: string[];
1214
- };
1215
- }
1216
-
1217
- /**
1218
- * Interface for rule converters that transform RuleNodes to Specifications
1219
- */
1220
- interface RuleConverter {
1221
- /**
1222
- * Convert a RuleNode to a Specification
1223
- * @param node The node to convert
1224
- * @param context Context providing access to child conversion capabilities
1225
- */
1226
- convert<T extends object = any>(node: RuleNode, context?: ConversionContext): Specification<T>;
1227
- /**
1228
- * Check if this converter can handle the given node type
1229
- */
1230
- canConvert(nodeType: string): boolean;
1231
- /**
1232
- * Get the supported node types
1233
- */
1234
- getSupportedTypes(): string[];
1235
- /**
1236
- * Set the conversion context (called by factory during initialization)
1237
- */
1238
- setContext?(context: ConversionContext): void;
1239
- }
1240
- /**
1241
- * Base abstract class for rule converters
1242
- */
1243
- declare abstract class BaseRuleConverter implements RuleConverter {
1244
- protected abstract supportedTypes: string[];
1245
- protected context?: ConversionContext;
1246
- abstract convert<T extends object = any>(node: RuleNode, context?: ConversionContext): Specification<T>;
1247
- /**
1248
- * Set the conversion context
1249
- */
1250
- setContext(context: ConversionContext): void;
1251
- canConvert(nodeType: string): boolean;
1252
- getSupportedTypes(): string[];
1253
- protected validateNode(node: RuleNode, expectedType?: string): void;
1254
- }
1255
-
1256
- /**
1257
- * Converter for field condition rules to field specifications
1258
- */
1259
- declare class FieldConditionConverter extends BaseRuleConverter {
1260
- protected supportedTypes: string[];
1261
- convert<T extends object>(node: RuleNode, context?: ConversionContext): Specification<T>;
1262
- private mapOperator;
1263
- private convertValue;
1264
- private inferAndConvertValue;
1265
- private operatorRequiresValue;
1266
- private defaultValueForOperator;
1267
- private getImpliedValue;
1268
- static ɵfac: i0.ɵɵFactoryDeclaration<FieldConditionConverter, never>;
1269
- static ɵprov: i0.ɵɵInjectableDeclaration<FieldConditionConverter>;
1270
- }
1271
-
1272
- /**
1273
- * Converter for boolean group rules (AND, OR, NOT, XOR, IMPLIES)
1274
- */
1275
- declare class BooleanGroupConverter extends BaseRuleConverter {
1276
- private nodeRegistry;
1277
- protected supportedTypes: string[];
1278
- constructor(nodeRegistry: RuleNodeRegistryService);
1279
- convert<T extends object>(node: RuleNode, context?: ConversionContext): Specification<T>;
1280
- static ɵfac: i0.ɵɵFactoryDeclaration<BooleanGroupConverter, never>;
1281
- static ɵprov: i0.ɵɵInjectableDeclaration<BooleanGroupConverter>;
1282
- }
1283
-
1284
- /**
1285
- * Converter for cardinality rules (atLeast, exactly)
1286
- */
1287
- declare class CardinalityConverter extends BaseRuleConverter {
1288
- private nodeRegistry;
1289
- protected supportedTypes: string[];
1290
- constructor(nodeRegistry: RuleNodeRegistryService);
1291
- convert<T extends object>(node: RuleNode, context?: ConversionContext): Specification<T>;
1292
- static ɵfac: i0.ɵɵFactoryDeclaration<CardinalityConverter, never>;
1293
- static ɵprov: i0.ɵɵInjectableDeclaration<CardinalityConverter>;
1294
- }
1295
-
1296
- /**
1297
- * Factory service for converting RuleNodes to Specifications
1298
- * Uses Strategy pattern to delegate to appropriate converters
1299
- */
1300
- declare class ConverterFactoryService {
1301
- private fieldConditionConverter;
1302
- private booleanGroupConverter;
1303
- private cardinalityConverter;
1304
- private converters;
1305
- private context;
1306
- constructor(fieldConditionConverter: FieldConditionConverter, booleanGroupConverter: BooleanGroupConverter, cardinalityConverter: CardinalityConverter);
1307
- /**
1308
- * Convert a RuleNode to a Specification
1309
- */
1310
- convert<T extends object = any>(node: RuleNode): Specification<T>;
1311
- /**
1312
- * Get converter for a specific node type
1313
- */
1314
- getConverter(nodeType: string): RuleConverter | undefined;
1315
- /**
1316
- * Register a new converter
1317
- */
1318
- registerConverter(name: string, converter: RuleConverter): void;
1319
- /**
1320
- * Unregister a converter
1321
- */
1322
- unregisterConverter(name: string): boolean;
1323
- /**
1324
- * Get all supported node types
1325
- */
1326
- getSupportedTypes(): string[];
1327
- /**
1328
- * Check if a node type is supported
1329
- */
1330
- isSupported(nodeType: string): boolean;
1331
- private initializeContext;
1332
- /**
1333
- * Internal convert method that bypasses context to avoid recursion
1334
- */
1335
- private convertInternal;
1336
- private initializeConverters;
1337
- /**
1338
- * Convert multiple nodes to specifications
1339
- */
1340
- convertMultiple<T extends object = any>(nodes: RuleNode[]): Specification<T>[];
1341
- /**
1342
- * Validate that a node can be converted
1343
- */
1344
- validateNode(node: RuleNode): {
1345
- isValid: boolean;
1346
- errors: string[];
1347
- };
1348
- /**
1349
- * Get statistics about converter usage
1350
- */
1351
- getStatistics(): ConverterStatistics;
1352
- static ɵfac: i0.ɵɵFactoryDeclaration<ConverterFactoryService, never>;
1353
- static ɵprov: i0.ɵɵInjectableDeclaration<ConverterFactoryService>;
1354
- }
1355
- /**
1356
- * Statistics about the converter factory
1357
- */
1358
- interface ConverterStatistics {
1359
- converterCount: number;
1360
- supportedTypeCount: number;
1361
- supportedTypes: string[];
1362
- converterNames: string[];
1363
- }
1364
-
1365
- /**
1366
- * Configuration for contextual specification support
1367
- */
1368
- interface SpecificationContextualConfig {
1369
- /** Context variables available for token resolution */
1370
- contextVariables?: DslContextVariable[];
1371
- /** Context provider instance */
1372
- contextProvider?: ContextProvider;
1373
- /** Enable strict validation of context tokens */
1374
- strictContextValidation?: boolean;
1375
- }
1376
- declare class SpecificationBridgeService {
1377
- private nodeRegistry;
1378
- private converterFactory;
1379
- private dslExporter;
1380
- private dslParser;
1381
- private dslValidator;
1382
- private contextProvider?;
1383
- constructor(nodeRegistry: RuleNodeRegistryService, converterFactory: ConverterFactoryService);
1384
- /**
1385
- * Converts a RuleNode tree to a Specification instance
1386
- */
1387
- ruleNodeToSpecification<T extends object = any>(node: RuleNode): Specification<T>;
1388
- private registerSubtree;
1389
- /**
1390
- * Converts a Specification instance to a RuleNode tree
1391
- */
1392
- specificationToRuleNode<T extends object = any>(spec: Specification<T>): RuleNode;
1393
- /**
1394
- * Exports a RuleNode tree to DSL format
1395
- */
1396
- exportToDsl<T extends object = any>(node: RuleNode, options?: Partial<ExportOptions$1>): string;
1397
- /**
1398
- * Exports a RuleNode tree to DSL format with metadata
1399
- */
1400
- exportToDslWithMetadata<T extends object = any>(node: RuleNode): string;
1401
- /**
1402
- * Validates that a RuleNode can be successfully round-tripped
1403
- */
1404
- validateRoundTrip<T extends object = any>(node: RuleNode): {
1405
- success: boolean;
1406
- errors: string[];
1407
- warnings: string[];
1408
- };
1409
- /**
1410
- * Performs deep validation between original and reconstructed nodes
1411
- */
1412
- private deepValidateRoundTrip;
1413
- /**
1414
- * Compares two configuration objects
1415
- */
1416
- private compareConfigs;
1417
- /**
1418
- * Validates DSL round-trip conversion
1419
- */
1420
- private validateDslRoundTrip;
1421
- /**
1422
- * Parses a DSL expression string into a Specification
1423
- */
1424
- parseDslExpression<T extends object = any>(expression: string, config?: DslParsingConfig): DslParsingResult<T>;
1425
- /**
1426
- * Creates a ContextualSpecification with token resolution
1427
- */
1428
- createContextualSpecification<T extends object = any>(template: string, config?: SpecificationContextualConfig): ContextualSpecification<T>;
1429
- /**
1430
- * Resolves context tokens in a template using provided variables
1431
- */
1432
- resolveContextTokens(template: string, contextVariables: DslContextVariable[]): string;
1433
- /**
1434
- * Extracts all context tokens from a template
1435
- */
1436
- extractContextTokens(template: string): string[];
1437
- /**
1438
- * Validates that all context tokens in a template have corresponding variables
1439
- */
1440
- validateContextTokens(template: string, contextVariables: DslContextVariable[]): ValidationIssue$1[];
1441
- /**
1442
- * Converts a DSL expression to a ContextualSpecification
1443
- */
1444
- dslToContextualSpecification<T extends object = any>(dslExpression: string, config?: SpecificationContextualConfig): ContextualSpecification<T>;
1445
- /**
1446
- * Converts a ContextualSpecification back to DSL template
1447
- */
1448
- contextualSpecificationToDsl<T extends object = any>(spec: ContextualSpecification<T>): string;
1449
- /**
1450
- * Performs round-trip validation for expression specifications
1451
- */
1452
- validateExpressionRoundTrip<T extends object = any>(originalExpression: string, config?: DslParsingConfig): {
1453
- success: boolean;
1454
- errors: string[];
1455
- warnings: string[];
1456
- reconstructedExpression?: string;
1457
- };
1458
- /**
1459
- * Updates the context provider for contextual specifications
1460
- */
1461
- updateContextProvider(contextProvider: ContextProvider): void;
1462
- /**
1463
- * Gets the current context provider
1464
- */
1465
- getContextProvider(): ContextProvider | undefined;
1466
- /**
1467
- * Gets expected DSL keywords for a given node type
1468
- */
1469
- private getExpectedDslKeywords;
1470
- private createFieldSpecification;
1471
- private createBooleanGroupSpecification;
1472
- private createFunctionSpecification;
1473
- private createFieldToFieldSpecification;
1474
- private createCardinalitySpecification;
1475
- /**
1476
- * Creates conditional validator specifications (Phase 1 implementation)
1477
- */
1478
- private createConditionalValidatorSpecification;
1479
- /**
1480
- * Creates collection validator specifications (Phase 2 implementation)
1481
- */
1482
- private createCollectionValidatorSpecification;
1483
- /**
1484
- * Creates expression specification from DSL (Phase 4 implementation)
1485
- */
1486
- private createExpressionSpecification;
1487
- /**
1488
- * Creates contextual specification (Phase 4 implementation)
1489
- */
1490
- private createContextualSpecificationFromNode;
1491
- private convertToComparisonOperator;
1492
- private convertValue;
1493
- private comparisonExpectsValue;
1494
- private defaultValueForOperator;
1495
- private getImpliedValueForOperator;
1496
- private jsonToRuleNode;
1497
- private mapSpecificationTypeToNodeType;
1498
- private mapComparisonOperator;
1499
- private inferValueType;
1500
- private generateNodeId;
1501
- private generateNodeLabel;
1502
- /**
1503
- * Creates a context provider from context variables
1504
- */
1505
- private createContextProviderFromVariables;
1506
- /**
1507
- * Calculates complexity of a DSL expression
1508
- */
1509
- private calculateComplexity;
1510
- /**
1511
- * Finds the position of a token in a template
1512
- */
1513
- private findTokenPosition;
1514
- /**
1515
- * Suggests similar variable names using Levenshtein distance
1516
- */
1517
- private suggestSimilarVariable;
1518
- /**
1519
- * Calculates Levenshtein distance between two strings
1520
- */
1521
- private levenshteinDistance;
1522
- /**
1523
- * Parses a value expression. Phase 1 shim: accepts strings starting with '=' or { expr } objects.
1524
- * Returns success when the shape is acceptable; full DSL parsing will be integrated in Phase 2.
1525
- */
1526
- parseDslExpressionValue(expression: string | {
1527
- expr: string;
1528
- } | null | undefined, _config?: DslParsingConfig): {
1529
- success: boolean;
1530
- issues: string[];
1531
- };
1532
- /**
1533
- * Evaluates a value expression with a row context. Phase 1 shim: executes simple '=' expressions in a sandboxed Function.
1534
- * In Phase 2, this will use the real DSL evaluator from @praxisui/specification.
1535
- */
1536
- evaluateValue(expression: string | {
1537
- expr: string;
1538
- }, ctx: {
1539
- row: any;
1540
- }): any;
1541
- static ɵfac: i0.ɵɵFactoryDeclaration<SpecificationBridgeService, never>;
1542
- static ɵprov: i0.ɵɵInjectableDeclaration<SpecificationBridgeService>;
1543
- }
1544
-
1545
- interface RoundTripValidationResult {
1546
- success: boolean;
1547
- errors: ValidationError$1[];
1548
- warnings: ValidationError$1[];
1549
- stages: {
1550
- visualToSpecification: {
1551
- success: boolean;
1552
- error?: string;
1553
- };
1554
- specificationToDsl: {
1555
- success: boolean;
1556
- error?: string;
1557
- dsl?: string;
1558
- };
1559
- dslToSpecification: {
1560
- success: boolean;
1561
- error?: string;
1562
- };
1563
- specificationToVisual: {
1564
- success: boolean;
1565
- error?: string;
1566
- };
1567
- };
1568
- dataIntegrity: {
1569
- nodeCountMatch: boolean;
1570
- structureMatch: boolean;
1571
- metadataPreserved: boolean;
1572
- logicPreserved: boolean;
1573
- };
1574
- performance: {
1575
- totalTime: number;
1576
- stageTimings: Record<string, number>;
1577
- };
1578
- }
1579
- interface RoundTripTestCase {
1580
- id: string;
1581
- name: string;
1582
- description: string;
1583
- visualRule: RuleNode;
1584
- expectedDsl?: string;
1585
- expectedValidation?: {
1586
- shouldSucceed: boolean;
1587
- expectedErrors?: string[];
1588
- expectedWarnings?: string[];
1589
- };
1590
- relatedNodes?: RuleNode[];
1591
- }
1592
- declare class RoundTripValidatorService {
1593
- private specificationBridge;
1594
- private nodeRegistry;
1595
- private dslParser;
1596
- constructor(specificationBridge: SpecificationBridgeService, nodeRegistry: RuleNodeRegistryService);
1597
- /**
1598
- * Validates complete round-trip conversion: Visual → DSL → Visual
1599
- */
1600
- validateRoundTrip(visualRule: RuleNode, relatedNodes?: RuleNode[]): RoundTripValidationResult;
1601
- /**
1602
- * Validates data integrity between original and reconstructed visual rules
1603
- */
1604
- private validateDataIntegrity;
1605
- /**
1606
- * Validates that the logical structure is preserved
1607
- */
1608
- private validateStructureMatch;
1609
- /**
1610
- * Validates that metadata is preserved through the round-trip
1611
- */
1612
- private validateMetadataPreservation;
1613
- /**
1614
- * Validates that the logical meaning is preserved
1615
- */
1616
- private validateLogicPreservation;
1617
- /**
1618
- * Counts total number of nodes in a rule tree
1619
- */
1620
- private countNodes;
1621
- /**
1622
- * Runs a comprehensive test suite for round-trip validation
1623
- */
1624
- runTestSuite(testCases: RoundTripTestCase[]): {
1625
- totalTests: number;
1626
- passed: number;
1627
- failed: number;
1628
- results: Array<{
1629
- testCase: RoundTripTestCase;
1630
- result: RoundTripValidationResult;
1631
- }>;
1632
- };
1633
- /**
1634
- * Validates test expectations against results
1635
- */
1636
- private validateExpectations;
1637
- /**
1638
- * Creates default test cases for common rule patterns
1639
- */
1640
- createDefaultTestCases(): RoundTripTestCase[];
1641
- private generateErrorId;
1642
- static ɵfac: i0.ɵɵFactoryDeclaration<RoundTripValidatorService, never>;
1643
- static ɵprov: i0.ɵɵInjectableDeclaration<RoundTripValidatorService>;
1644
- }
1645
-
1646
1185
  declare class RuleBuilderService {
1647
- private specificationBridge;
1648
- private roundTripValidator;
1649
1186
  private nodeRegistry;
1650
1187
  private readonly _state;
1651
1188
  private readonly _validationErrors;
1652
1189
  private readonly _nodeSelected;
1653
1190
  private readonly _stateChanged;
1654
1191
  private config;
1655
- private dslExporter;
1656
- private dslValidator;
1657
- private dslParser;
1658
1192
  readonly state$: Observable<RuleBuilderState>;
1659
1193
  readonly validationErrors$: Observable<ValidationError$1[]>;
1660
1194
  readonly nodeSelected$: Observable<string>;
1661
1195
  readonly stateChanged$: Observable<void>;
1662
- constructor(specificationBridge: SpecificationBridgeService, roundTripValidator: RoundTripValidatorService, nodeRegistry: RuleNodeRegistryService);
1196
+ constructor(nodeRegistry: RuleNodeRegistryService);
1663
1197
  /**
1664
1198
  * Initialize the rule builder with configuration
1665
1199
  */
@@ -1716,37 +1250,28 @@ declare class RuleBuilderService {
1716
1250
  * Export rules to JSON payload
1717
1251
  */
1718
1252
  export(options: ExportOptions): string;
1719
- /**
1720
- * Convert current builder state to Specification (best-effort)
1721
- */
1722
- toSpecification(): Specification<any> | null;
1253
+ toSpecification(): null;
1723
1254
  private updateState;
1724
1255
  /**
1725
1256
  * Validate current rules (lightweight placeholder)
1726
1257
  */
1727
1258
  validateRules(): void;
1728
- /**
1729
- * Replace builder state with a parsed DSL graph without reinitializing the service.
1730
- */
1731
- loadFromParsedDsl(nodes: Record<string, RuleNode>, rootNodes: string[], description?: string): void;
1732
- /**
1733
- * Update builder state with a parsed DSL graph while preserving history.
1734
- */
1735
- updateFromParsedDsl(nodes: Record<string, RuleNode>, rootNodes: string[], description?: string): void;
1259
+ loadFromConditionExpression(condition: JsonLogicExpression, description?: string): void;
1260
+ buildConditionExpressionFromGraph(nodes: Record<string, RuleNode>, rootNodes: string[]): JsonLogicExpression | null;
1736
1261
  private saveSnapshot;
1737
1262
  private generateNodeLabel;
1738
1263
  private withRuleTimestamps;
1739
1264
  private isPropertyRuleNode;
1740
1265
  private containsPropertyRule;
1741
1266
  /**
1742
- * Constrói um array de FormLayoutRule a partir do estado atual do builder,
1743
- * focando em nós propertyRule ou nós com propriedades/targets definidos.
1267
+ * Constrói um array de FormLayoutRule a partir do estado atual do builder,
1268
+ * focando em nós propertyRule ou nós com propriedades/targets definidos.
1744
1269
  */
1745
1270
  private exportFormRulesFromState;
1746
1271
  private toFormLayoutRule;
1747
1272
  private normalizeTargets;
1748
- private buildDslFromCondition;
1749
- private buildDslFromState;
1273
+ private buildJsonLogicFromCondition;
1274
+ private buildJsonLogicFromState;
1750
1275
  private applyBuilderState;
1751
1276
  private extractFormRules;
1752
1277
  private isFormRuleCandidate;
@@ -1756,8 +1281,18 @@ declare class RuleBuilderService {
1756
1281
  private sanitizeStructuredValue;
1757
1282
  private formRulesToBuilderState;
1758
1283
  private inferRuleTypeFromFormRule;
1759
- private parseSimpleCondition;
1284
+ private parseConditionExpression;
1285
+ private normalizeJsonLogicCondition;
1286
+ private parseJsonLogicCondition;
1287
+ private parseJsonLogicChild;
1760
1288
  private normalizeOperator;
1289
+ private builderOperatorToJsonLogicOperator;
1290
+ private jsonLogicOperatorToBuilderOperator;
1291
+ private normalizeConditionValue;
1292
+ private isJsonLogicExpressionCandidate;
1293
+ private isVarExpression;
1294
+ private extractVarPath;
1295
+ private flattenConditionNodes;
1761
1296
  private prefixTarget;
1762
1297
  private buildRuleNodeTree;
1763
1298
  private flattenRuleNodeTree;
@@ -1827,10 +1362,9 @@ interface ExternalSystemConfig {
1827
1362
  }
1828
1363
  declare class ExportIntegrationService {
1829
1364
  private ruleBuilderService;
1830
- private specificationBridge;
1831
1365
  private readonly SUPPORTED_FORMATS;
1832
1366
  private externalSystems;
1833
- constructor(ruleBuilderService: RuleBuilderService, specificationBridge: SpecificationBridgeService);
1367
+ constructor(ruleBuilderService: RuleBuilderService);
1834
1368
  /**
1835
1369
  * Gets all supported export formats
1836
1370
  */
@@ -1906,7 +1440,6 @@ declare class ExportIntegrationService {
1906
1440
  private generateContent;
1907
1441
  private generateJson;
1908
1442
  private generateJsonSchema;
1909
- private generateDsl;
1910
1443
  private generateYaml;
1911
1444
  private generateXml;
1912
1445
  private generateTypeScript;
@@ -2131,7 +1664,6 @@ interface TemplateStats {
2131
1664
  popularTags: string[];
2132
1665
  }
2133
1666
  declare class RuleTemplateService {
2134
- private bridgeService;
2135
1667
  private readonly STORAGE_KEY;
2136
1668
  private readonly VERSION_KEY;
2137
1669
  private readonly CURRENT_VERSION;
@@ -2141,7 +1673,7 @@ declare class RuleTemplateService {
2141
1673
  templates$: Observable<RuleTemplate[]>;
2142
1674
  categories$: Observable<TemplateCategory[]>;
2143
1675
  recentlyUsed$: Observable<RuleTemplate[]>;
2144
- constructor(bridgeService: SpecificationBridgeService);
1676
+ constructor();
2145
1677
  /**
2146
1678
  * Get all templates
2147
1679
  */
@@ -2359,17 +1891,6 @@ interface ContextEntry {
2359
1891
  /** Optional type hint for validation */
2360
1892
  type?: string;
2361
1893
  }
2362
- /**
2363
- * Configuration for contextual specification support
2364
- */
2365
- interface ContextualConfig {
2366
- /** Context variables available for token resolution */
2367
- contextVariables?: ContextEntry[];
2368
- /** Context provider instance */
2369
- contextProvider?: ContextProvider;
2370
- /** Enable strict validation of context tokens */
2371
- strictContextValidation?: boolean;
2372
- }
2373
1894
  /**
2374
1895
  * Context variable value with metadata
2375
1896
  */
@@ -2398,7 +1919,7 @@ interface ContextScope {
2398
1919
  }
2399
1920
  /**
2400
1921
  * Dedicated service for context management and variable resolution
2401
- * Extracted from SpecificationBridgeService to follow SRP
1922
+ * Extracted from the old bridge-oriented implementation to follow SRP
2402
1923
  */
2403
1924
  declare class ContextManagementService {
2404
1925
  private scopes;
@@ -2407,7 +1928,7 @@ declare class ContextManagementService {
2407
1928
  /**
2408
1929
  * Create a context provider from context variables
2409
1930
  */
2410
- createContextProvider(contextVariables: ContextEntry[]): ContextProvider;
1931
+ createContextProvider(contextVariables: ContextEntry[]): RuleContextProvider;
2411
1932
  /**
2412
1933
  * Create a new context scope
2413
1934
  */
@@ -2434,11 +1955,11 @@ declare class ContextManagementService {
2434
1955
  /**
2435
1956
  * Create a scoped context provider
2436
1957
  */
2437
- createScopedProvider(scopeId: string): ContextProvider;
1958
+ createScopedProvider(scopeId: string): RuleContextProvider;
2438
1959
  /**
2439
1960
  * Merge multiple context providers
2440
1961
  */
2441
- mergeProviders(...providers: ContextProvider[]): ContextProvider;
1962
+ mergeProviders(...providers: RuleContextProvider[]): RuleContextProvider;
2442
1963
  /**
2443
1964
  * Get context statistics
2444
1965
  */
@@ -2462,69 +1983,6 @@ declare class ContextManagementService {
2462
1983
  static ɵprov: i0.ɵɵInjectableDeclaration<ContextManagementService>;
2463
1984
  }
2464
1985
 
2465
- /**
2466
- * Simplified service for core rule conversion operations
2467
- * Replaces the God Service anti-pattern from SpecificationBridgeService
2468
- * Focuses only on conversion between RuleNodes and Specifications
2469
- */
2470
- declare class RuleConversionService {
2471
- private converterFactory;
2472
- private dslParsingService;
2473
- private contextManagementService;
2474
- private dslExporter;
2475
- constructor(converterFactory: ConverterFactoryService, dslParsingService: DslParsingService, contextManagementService: ContextManagementService);
2476
- /**
2477
- * Convert a RuleNode tree to a Specification instance
2478
- * Core conversion functionality with clean error handling
2479
- */
2480
- convertRuleToSpecification<T extends object = any>(node: RuleNode): Specification<T>;
2481
- /**
2482
- * Convert a Specification back to a RuleNode tree
2483
- * Simplified reverse conversion
2484
- */
2485
- convertSpecificationToRule<T extends object = any>(spec: Specification<T>): RuleNode;
2486
- /**
2487
- * Export a RuleNode tree to DSL format
2488
- */
2489
- exportRuleToDsl<T extends object = any>(node: RuleNode, options?: Partial<ExportOptions$1>): string;
2490
- /**
2491
- * Import a RuleNode tree from DSL format
2492
- */
2493
- importRuleFromDsl<T extends object = any>(dslExpression: string, config?: DslParsingConfig): DslParsingResult<T>;
2494
- /**
2495
- * Create a contextual specification from a RuleNode
2496
- */
2497
- createContextualSpecification<T extends object = any>(node: RuleNode, contextConfig: ContextualConfig): Specification<T>;
2498
- /**
2499
- * Validate that a rule can be converted
2500
- */
2501
- validateConversion(node: RuleNode): ConversionValidationResult;
2502
- /**
2503
- * Get conversion statistics
2504
- */
2505
- getConversionStatistics(): ConversionStatistics;
2506
- private jsonToRuleNode;
2507
- static ɵfac: i0.ɵɵFactoryDeclaration<RuleConversionService, never>;
2508
- static ɵprov: i0.ɵɵInjectableDeclaration<RuleConversionService>;
2509
- }
2510
- /**
2511
- * Result of conversion validation
2512
- */
2513
- interface ConversionValidationResult {
2514
- isValid: boolean;
2515
- errors: string[];
2516
- warnings: string[];
2517
- }
2518
- /**
2519
- * Statistics about conversion capabilities
2520
- */
2521
- interface ConversionStatistics {
2522
- supportedNodeTypes: number;
2523
- registeredConverters: number;
2524
- availableNodeTypes: string[];
2525
- converterNames: string[];
2526
- }
2527
-
2528
1986
  /**
2529
1987
  * Typed error system for Visual Builder operations
2530
1988
  * Provides structured error handling with codes, categories, and context
@@ -2536,7 +1994,7 @@ declare enum ErrorCategory {
2536
1994
  VALIDATION = "validation",
2537
1995
  CONVERSION = "conversion",
2538
1996
  REGISTRY = "registry",
2539
- DSL = "dsl",
1997
+ EXPRESSION = "expression",
2540
1998
  CONTEXT = "context",
2541
1999
  CONFIGURATION = "configuration",
2542
2000
  NETWORK = "network",
@@ -2599,16 +2057,16 @@ declare class RegistryError extends VisualBuilderError {
2599
2057
  constructor(operation: string, message: string, nodeId?: string | undefined, context?: Record<string, any>);
2600
2058
  }
2601
2059
  /**
2602
- * DSL parsing and processing errors
2060
+ * Expression parsing and processing errors
2603
2061
  */
2604
- declare class DslError extends VisualBuilderError {
2062
+ declare class ExpressionError extends VisualBuilderError {
2605
2063
  readonly expression?: string | undefined;
2606
2064
  readonly position?: {
2607
2065
  start: number;
2608
2066
  end: number;
2609
2067
  } | undefined;
2610
2068
  readonly code: string;
2611
- readonly category = ErrorCategory.DSL;
2069
+ readonly category = ErrorCategory.EXPRESSION;
2612
2070
  readonly severity = ErrorSeverity.HIGH;
2613
2071
  constructor(type: 'PARSING' | 'VALIDATION' | 'EXPORT' | 'IMPORT', message: string, expression?: string | undefined, position?: {
2614
2072
  start: number;
@@ -2715,7 +2173,7 @@ declare const createError: {
2715
2173
  validation: (message: string, nodeId?: string, rules?: string[]) => ValidationError;
2716
2174
  conversion: (code: string, message: string, nodeId?: string) => ConversionError;
2717
2175
  registry: (operation: string, message: string, nodeId?: string) => RegistryError;
2718
- dsl: (type: "PARSING" | "VALIDATION" | "EXPORT" | "IMPORT", message: string, expression?: string) => DslError;
2176
+ expression: (type: "PARSING" | "VALIDATION" | "EXPORT" | "IMPORT", message: string, expression?: string) => ExpressionError;
2719
2177
  context: (operation: string, message: string, scopeId?: string, variablePath?: string) => ContextError;
2720
2178
  configuration: (message: string, configPath?: string, expectedType?: string) => ConfigurationError;
2721
2179
  internal: (message: string, cause?: Error) => InternalError;
@@ -2727,7 +2185,7 @@ type RuleNodeConfigExtended = RuleNodeConfig & {
2727
2185
  properties?: Record<string, any>;
2728
2186
  propertiesWhenFalse?: Record<string, any>;
2729
2187
  targets?: string[];
2730
- condition?: RuleNode | string | null;
2188
+ condition?: RuleNode | JsonLogicExpression | null;
2731
2189
  };
2732
2190
  declare class RuleEditorComponent implements OnInit, OnDestroy, OnChanges, AfterViewInit {
2733
2191
  private readonly ruleBuilderService;
@@ -2978,8 +2436,9 @@ declare class FieldConditionEditorComponent implements OnInit, OnChanges {
2978
2436
  static ɵcmp: i0.ɵɵComponentDeclaration<FieldConditionEditorComponent, "praxis-field-condition-editor", never, { "config": { "alias": "config"; "required": false; }; "fieldSchemas": { "alias": "fieldSchemas"; "required": false; }; }, { "configChanged": "configChanged"; }, never, never, true, never>;
2979
2437
  }
2980
2438
 
2981
- declare class ConditionalValidatorEditorComponent implements OnInit, OnChanges {
2439
+ declare class ConditionalValidatorEditorComponent implements OnInit, OnChanges, OnDestroy {
2982
2440
  private fb;
2441
+ private readonly i18n?;
2983
2442
  config: ConditionalValidatorConfig | null;
2984
2443
  fieldSchemas: Record<string, FieldSchema>;
2985
2444
  configChanged: EventEmitter<ConditionalValidatorConfig>;
@@ -2998,7 +2457,7 @@ declare class ConditionalValidatorEditorComponent implements OnInit, OnChanges {
2998
2457
  icon: string;
2999
2458
  }>;
3000
2459
  get showDisabledMessage(): boolean;
3001
- constructor(fb: FormBuilder);
2460
+ constructor(fb: FormBuilder, i18n?: PraxisI18nService | undefined);
3002
2461
  ngOnInit(): void;
3003
2462
  ngOnChanges(changes: SimpleChanges): void;
3004
2463
  ngOnDestroy(): void;
@@ -3028,7 +2487,9 @@ declare class ConditionalValidatorEditorComponent implements OnInit, OnChanges {
3028
2487
  private isConditionIncomplete;
3029
2488
  private mapRuleTypeToValidatorType;
3030
2489
  private mapValidatorTypeToRuleType;
3031
- static ɵfac: i0.ɵɵFactoryDeclaration<ConditionalValidatorEditorComponent, never>;
2490
+ private refreshValidatorTypeLabels;
2491
+ t(key: string, fallback: string): string;
2492
+ static ɵfac: i0.ɵɵFactoryDeclaration<ConditionalValidatorEditorComponent, [null, { optional: true; }]>;
3032
2493
  static ɵcmp: i0.ɵɵComponentDeclaration<ConditionalValidatorEditorComponent, "praxis-conditional-validator-editor", never, { "config": { "alias": "config"; "required": false; }; "fieldSchemas": { "alias": "fieldSchemas"; "required": false; }; }, { "configChanged": "configChanged"; }, never, never, true, never>;
3033
2494
  }
3034
2495
 
@@ -3131,77 +2592,13 @@ declare class MetadataEditorComponent implements OnInit, OnChanges {
3131
2592
  removeCustomProperty(index: number): void;
3132
2593
  addDocumentationLink(): void;
3133
2594
  removeDocumentationLink(index: number): void;
2595
+ private stringifyJsonEditorValue;
2596
+ private parseJsonEditorObject;
2597
+ private static readonly invalidJsonEditorValue;
3134
2598
  static ɵfac: i0.ɵɵFactoryDeclaration<MetadataEditorComponent, never>;
3135
2599
  static ɵcmp: i0.ɵɵComponentDeclaration<MetadataEditorComponent, "praxis-metadata-editor", never, { "selectedNode": { "alias": "selectedNode"; "required": false; }; }, { "metadataUpdated": "metadataUpdated"; }, never, never, true, never>;
3136
2600
  }
3137
2601
 
3138
- declare class DslViewerComponent implements OnInit, OnChanges, AfterViewInit {
3139
- private snackBar;
3140
- dsl: string;
3141
- editable: boolean;
3142
- language: string;
3143
- theme: string;
3144
- dslChanged: EventEmitter<string>;
3145
- validationChanged: EventEmitter<{
3146
- valid: boolean;
3147
- errors: any[];
3148
- warnings: any[];
3149
- }>;
3150
- editorTextarea?: ElementRef<HTMLTextAreaElement>;
3151
- syntaxOverlay?: ElementRef<HTMLDivElement>;
3152
- private originalDsl;
3153
- private parser;
3154
- private validator;
3155
- hasChanges: boolean;
3156
- showErrors: boolean;
3157
- syntaxErrors: any[];
3158
- warnings: any[];
3159
- cursorPosition: {
3160
- line: number;
3161
- column: number;
3162
- } | null;
3163
- currentDsl: string;
3164
- showLineNumbers: boolean;
3165
- wordWrap: boolean;
3166
- showMinimap: boolean;
3167
- highlightedDsl: string;
3168
- constructor(snackBar: MatSnackBar);
3169
- ngOnInit(): void;
3170
- ngAfterViewInit(): void;
3171
- ngOnChanges(changes: SimpleChanges): void;
3172
- ngOnDestroy(): void;
3173
- get themeClass(): string;
3174
- private setEditorValue;
3175
- getEditorValue(): string;
3176
- onEditorInput(event: Event): void;
3177
- private updateEditorOptions;
3178
- syncScroll(): void;
3179
- updateCursorPosition(): void;
3180
- private validateSyntaxDebounced;
3181
- private debounce;
3182
- getValidationStatusClass(): string;
3183
- getValidationIcon(): string;
3184
- getValidationText(): string;
3185
- getEditorInfo(): string;
3186
- formatCode(): void;
3187
- validateSyntax(): void;
3188
- applyChanges(): void;
3189
- discardChanges(): void;
3190
- copyToClipboard(): void;
3191
- downloadDsl(): void;
3192
- toggleLineNumbers(): void;
3193
- toggleWordWrap(): void;
3194
- toggleMinimap(): void;
3195
- showErrorDetails(): void;
3196
- hideErrorDetails(): void;
3197
- goToError(error: any): void;
3198
- private formatDslCode;
3199
- private validateDslSyntax;
3200
- private updateSyntaxHighlighting;
3201
- static ɵfac: i0.ɵɵFactoryDeclaration<DslViewerComponent, never>;
3202
- static ɵcmp: i0.ɵɵComponentDeclaration<DslViewerComponent, "praxis-dsl-viewer", never, { "dsl": { "alias": "dsl"; "required": false; }; "editable": { "alias": "editable"; "required": false; }; "language": { "alias": "language"; "required": false; }; "theme": { "alias": "theme"; "required": false; }; }, { "dslChanged": "dslChanged"; "validationChanged": "validationChanged"; }, never, never, true, never>;
3203
- }
3204
-
3205
2602
  declare class JsonViewerComponent implements OnInit, OnChanges {
3206
2603
  private snackBar;
3207
2604
  json: any;
@@ -3236,40 +2633,6 @@ declare class JsonViewerComponent implements OnInit, OnChanges {
3236
2633
  static ɵcmp: i0.ɵɵComponentDeclaration<JsonViewerComponent, "praxis-json-viewer", never, { "json": { "alias": "json"; "required": false; }; "editable": { "alias": "editable"; "required": false; }; }, { "jsonChanged": "jsonChanged"; }, never, never, true, never>;
3237
2634
  }
3238
2635
 
3239
- declare class RoundTripTesterComponent implements OnInit {
3240
- private roundTripValidator;
3241
- private ruleBuilderService;
3242
- private snackBar;
3243
- private cdr;
3244
- private nodeRegistry;
3245
- isRunning: boolean;
3246
- showTestCases: boolean;
3247
- lastTestResult: RoundTripValidationResult | null;
3248
- testSuiteResults: any;
3249
- defaultTestCases: RoundTripTestCase[];
3250
- hasCurrentRule: boolean;
3251
- constructor(roundTripValidator: RoundTripValidatorService, ruleBuilderService: RuleBuilderService, snackBar: MatSnackBar, cdr: ChangeDetectorRef, nodeRegistry: RuleNodeRegistryService);
3252
- ngOnInit(): void;
3253
- private loadDefaultTestCases;
3254
- private checkCurrentRule;
3255
- runCurrentRuleTest(): void;
3256
- runTestSuite(): void;
3257
- clearResults(): void;
3258
- private buildCompleteRuleTree;
3259
- getCurrentRuleType(): string;
3260
- getCurrentRuleLabel(): string;
3261
- getTestCaseColor(testCase: RoundTripTestCase): 'primary' | 'accent' | 'warn';
3262
- getResultSummary(): string;
3263
- getStatusClass(result: RoundTripValidationResult): string;
3264
- getStatusIcon(result: RoundTripValidationResult): string;
3265
- getStages(result: RoundTripValidationResult): any[];
3266
- getIntegrityChecks(result: RoundTripValidationResult): any[];
3267
- getSuccessRate(): number;
3268
- getSuccessRateClass(): string;
3269
- static ɵfac: i0.ɵɵFactoryDeclaration<RoundTripTesterComponent, never>;
3270
- static ɵcmp: i0.ɵɵComponentDeclaration<RoundTripTesterComponent, "praxis-round-trip-tester", never, {}, {}, never, never, true, never>;
3271
- }
3272
-
3273
2636
  interface ExportDialogData {
3274
2637
  title?: string;
3275
2638
  allowMultipleFormats?: boolean;
@@ -3326,121 +2689,6 @@ declare class ExportDialogComponent implements OnInit {
3326
2689
  static ɵcmp: i0.ɵɵComponentDeclaration<ExportDialogComponent, "praxis-export-dialog", never, {}, {}, never, never, true, never>;
3327
2690
  }
3328
2691
 
3329
- interface DslLintError {
3330
- id: string;
3331
- line: number;
3332
- column: number;
3333
- length: number;
3334
- severity: 'error' | 'warning' | 'info' | 'hint';
3335
- code: string;
3336
- message: string;
3337
- suggestion?: string;
3338
- quickFix?: DslQuickFix;
3339
- category: 'syntax' | 'semantic' | 'style' | 'performance' | 'best-practice';
3340
- tags?: string[];
3341
- }
3342
- interface DslQuickFix {
3343
- title: string;
3344
- description: string;
3345
- edits: DslEdit[];
3346
- }
3347
- interface DslEdit {
3348
- range: {
3349
- startLine: number;
3350
- startColumn: number;
3351
- endLine: number;
3352
- endColumn: number;
3353
- };
3354
- newText: string;
3355
- }
3356
- interface DslLintStats {
3357
- totalErrors: number;
3358
- totalWarnings: number;
3359
- totalInfos: number;
3360
- totalHints: number;
3361
- complexity: number;
3362
- maintainabilityIndex: number;
3363
- lastLintTime: Date;
3364
- lintDuration: number;
3365
- }
3366
- interface DslLintRule {
3367
- id: string;
3368
- name: string;
3369
- description: string;
3370
- category: string;
3371
- severity: 'error' | 'warning' | 'info' | 'hint';
3372
- enabled: boolean;
3373
- configurable: boolean;
3374
- config?: any;
3375
- }
3376
- declare class DslLinterComponent implements OnInit, OnDestroy {
3377
- private ruleBuilderService;
3378
- private specificationBridge;
3379
- private cdr;
3380
- dsl: string;
3381
- autoLint: boolean;
3382
- lintDelay: number;
3383
- errorSelected: EventEmitter<DslLintError>;
3384
- quickFixApplied: EventEmitter<{
3385
- error: DslLintError;
3386
- fix: DslQuickFix;
3387
- }>;
3388
- ruleToggled: EventEmitter<{
3389
- rule: DslLintRule;
3390
- enabled: boolean;
3391
- }>;
3392
- private destroy$;
3393
- private lintSubject;
3394
- isLinting: boolean;
3395
- activeTabIndex: number;
3396
- allErrors: DslLintError[];
3397
- filteredErrors: DslLintError[];
3398
- selectedSeverities: string[];
3399
- selectedCategories: string[];
3400
- stats: DslLintStats;
3401
- lintRules: DslLintRule[];
3402
- constructor(ruleBuilderService: RuleBuilderService, specificationBridge: SpecificationBridgeService, cdr: ChangeDetectorRef);
3403
- ngOnInit(): void;
3404
- ngOnDestroy(): void;
3405
- private setupSubscriptions;
3406
- private initializeLinting;
3407
- private triggerLinting;
3408
- runLinting(): void;
3409
- private performLinting;
3410
- private analyzeDsl;
3411
- private checkSyntaxRules;
3412
- private checkSemanticRules;
3413
- private checkStyleRules;
3414
- private checkPerformanceRules;
3415
- private checkBestPracticeRules;
3416
- private isRuleEnabled;
3417
- private getRuleConfig;
3418
- private updateStats;
3419
- private calculateComplexity;
3420
- private calculateMaintainabilityIndex;
3421
- toggleAutoLint(): void;
3422
- onSeverityFilterChange(event: MatSelectChange): void;
3423
- onCategoryFilterChange(event: MatSelectChange): void;
3424
- private applyFilters;
3425
- trackByErrorId(index: number, error: DslLintError): string;
3426
- getSeverityIcon(severity: string): string;
3427
- translateSeverity(severity: string): string;
3428
- translateCategory(category: string): string;
3429
- getComplexityClass(complexity: number): string;
3430
- getMaintainabilityClass(maintainability: number): string;
3431
- getIssueDistribution(): any[];
3432
- getMostCommonIssues(): any[];
3433
- getRuleCategories(): any[];
3434
- navigateToError(error: DslLintError): void;
3435
- applyQuickFix(error: DslLintError): void;
3436
- ignoreError(error: DslLintError): void;
3437
- toggleRule(rule: DslLintRule, change: MatSlideToggleChange): void;
3438
- configureRule(rule: DslLintRule): void;
3439
- openLinterSettings(): void;
3440
- static ɵfac: i0.ɵɵFactoryDeclaration<DslLinterComponent, never>;
3441
- static ɵcmp: i0.ɵɵComponentDeclaration<DslLinterComponent, "praxis-dsl-linter", never, { "dsl": { "alias": "dsl"; "required": false; }; "autoLint": { "alias": "autoLint"; "required": false; }; "lintDelay": { "alias": "lintDelay"; "required": false; }; }, { "errorSelected": "errorSelected"; "quickFixApplied": "quickFixApplied"; "ruleToggled": "ruleToggled"; }, never, never, true, never>;
3442
- }
3443
-
3444
2692
  /**
3445
2693
  * Placeholder Visual Rule Builder Component
3446
2694
  *
@@ -3538,7 +2786,6 @@ declare class TemplateEditorDialogComponent implements OnInit {
3538
2786
  data: TemplateEditorDialogData;
3539
2787
  private fb;
3540
2788
  private templateService;
3541
- private bridgeService;
3542
2789
  private snackBar;
3543
2790
  basicInfoForm: FormGroup;
3544
2791
  rulesForm: FormGroup;
@@ -3558,7 +2805,7 @@ declare class TemplateEditorDialogComponent implements OnInit {
3558
2805
  previewNodes: RuleNode[];
3559
2806
  detectedVariables: string[];
3560
2807
  get nodeCount(): number;
3561
- constructor(dialogRef: MatDialogRef<TemplateEditorDialogComponent>, data: TemplateEditorDialogData, fb: FormBuilder, templateService: RuleTemplateService, bridgeService: SpecificationBridgeService, snackBar: MatSnackBar);
2808
+ constructor(dialogRef: MatDialogRef<TemplateEditorDialogComponent>, data: TemplateEditorDialogData, fb: FormBuilder, templateService: RuleTemplateService, snackBar: MatSnackBar);
3562
2809
  ngOnInit(): void;
3563
2810
  private createBasicInfoForm;
3564
2811
  private createRulesForm;
@@ -3638,6 +2885,7 @@ declare class RuleListComponent {
3638
2885
  getPrimaryEffectLabel(item: RuleListItem): string;
3639
2886
  getEffectDetail(item: RuleListItem): string;
3640
2887
  getSummary(item: RuleListItem): string;
2888
+ private hasConfiguredCondition;
3641
2889
  getRelativeTime(item: RuleListItem): string | null;
3642
2890
  getTargetPreview(item: RuleListItem): string[];
3643
2891
  t(key: string, fallback: string): string;
@@ -3657,5 +2905,5 @@ declare class RuleListComponent {
3657
2905
  static ɵcmp: i0.ɵɵComponentDeclaration<RuleListComponent, "praxis-rule-list", never, { "rules": { "alias": "rules"; "required": false; }; "selectedRuleId": { "alias": "selectedRuleId"; "required": false; }; "nodeMap": { "alias": "nodeMap"; "required": false; }; "validationErrors": { "alias": "validationErrors"; "required": false; }; }, { "ruleSelected": "ruleSelected"; "ruleDeleted": "ruleDeleted"; "ruleDuplicated": "ruleDuplicated"; "ruleAdded": "ruleAdded"; "aiRequested": "aiRequested"; }, never, never, true, never>;
3658
2906
  }
3659
2907
 
3660
- export { ArrayFieldAnalyzer, CollectionValidatorEditorComponent, ConditionalValidatorEditorComponent, ConditionalValidatorType, ConfigurationError, ContextError, ContextManagementService, ConversionError, ConverterFactoryService, DslError, DslLinterComponent, DslViewerComponent, ErrorCategory, ErrorHandler, ErrorSeverity, ExportDialogComponent, ExportIntegrationService, FIELD_TYPE_OPERATORS, FieldConditionEditorComponent, FieldSchemaService, FieldType, InternalError, JsonViewerComponent, MetadataEditorComponent, OPERATOR_LABELS, PraxisVisualBuilder, RegistryError, RoundTripTesterComponent, RoundTripValidatorService, RuleBuilderService, RuleCanvasComponent, RuleConversionService, RuleEditorComponent, RuleListComponent, RuleNodeComponent, RuleNodeRegistryService, RuleNodeType, RuleTemplateService, RuleValidationService, SpecificationBridgeService, TemplateEditorDialogComponent, TemplateGalleryComponent, TemplatePreviewDialogComponent, ValidationError as VBValidationError, ValidationCategory, ValidationSeverity, VisualBuilderError, VisualRuleBuilderComponent, WebhookIntegrationService, createError, getArrayItemFieldPaths, globalErrorHandler, isArrayFieldSchema };
3661
- export type { ArrayCollectionValidationRule, ArrayFieldSchema, ArrayValidationContext, ArrayValidationError, BooleanGroupConfig, CardinalityConfig, CircularReference, CleanupResult, CollectionValidationConfig, CollectionValidatorConfig, ConditionalValidatorConfig, ConditionalValidatorPreview, ContextEntry, ContextScope, ContextValue, ContextVariable, ContextualConfig$1 as ContextualConfig, ContextualTemplateConfig, ConversionStatistics, ConversionValidationResult, ConverterStatistics, CustomConfig, CustomFunction, DslEdit, DslLintError, DslLintRule, DslLintStats, DslQuickFix, EnhancedFieldSchema, ErrorInfo, ErrorStatistics, ExportDialogData, ExportFormat, ExportOptions, ExportResult, ExpressionConfig, ExternalSystemConfig, FieldConditionConfig, FieldFormat, FieldOption, FieldSchema, FieldSchemaContext, FieldToFieldConfig, FieldUIConfig, FunctionCallConfig, FunctionParameter, ImportOptions, IntegrationEndpoint, IntegrationResult, MemoryStats, OptionalFieldConfig, PropertyRuleConfig, RegistryIntegrityResult, RegistryValidationResult, RoundTripTestCase, RoundTripValidationResult, RuleBuilderConfig, RuleBuilderSnapshot, RuleBuilderState, RuleNode, RuleNodeConfig, RuleNodeTree, RuleNodeTypeString, RuleTemplate, RuleValidationResult, SpecificationContextualConfig, TemplateApplicationResult, TemplateCategory, TemplateDisplayMode, TemplateEditorDialogData, TemplateEditorResult, TemplateMetadata, TemplatePreviewDialogData, TemplateSearchCriteria, TemplateSortOption, TemplateStats, TemplateValidationResult, ValidComparisonOperator, ValidationConfig, ValidationContext, ValidationError$1 as ValidationError, ValidationIssue, ValidationResult, ValidationRule, ValueType, WebhookConfig, WebhookDelivery, WebhookEvent, WebhookStats };
2908
+ export { ArrayFieldAnalyzer, CollectionValidatorEditorComponent, ConditionalValidatorEditorComponent, ConditionalValidatorType, ConfigurationError, ContextError, ContextManagementService, ConversionError, ErrorCategory, ErrorHandler, ErrorSeverity, ExportDialogComponent, ExportIntegrationService, ExpressionError, FIELD_TYPE_OPERATORS, FieldConditionEditorComponent, FieldSchemaService, FieldType, InternalError, JsonViewerComponent, MetadataEditorComponent, OPERATOR_LABELS, PraxisVisualBuilder, RegistryError, RuleBuilderService, RuleCanvasComponent, RuleEditorComponent, RuleListComponent, RuleNodeComponent, RuleNodeRegistryService, RuleNodeType, RuleTemplateService, RuleValidationService, TemplateEditorDialogComponent, TemplateGalleryComponent, TemplatePreviewDialogComponent, ValidationError as VBValidationError, ValidationCategory, ValidationSeverity, VisualBuilderError, VisualRuleBuilderComponent, WebhookIntegrationService, createError, getArrayItemFieldPaths, globalErrorHandler, isArrayFieldSchema };
2909
+ export type { ArrayCollectionValidationRule, ArrayFieldSchema, ArrayValidationContext, ArrayValidationError, BooleanGroupConfig, CardinalityConfig, CircularReference, CleanupResult, CollectionValidationConfig, CollectionValidatorConfig, ConditionalValidatorConfig, ConditionalValidatorPreview, ContextEntry, ContextScope, ContextValue, ContextVariable, ContextualConfig, ContextualTemplateConfig, CustomConfig, CustomFunction, DocumentationLink, EnhancedFieldSchema, ErrorInfo, ErrorStatistics, ExportDialogData, ExportFormat, ExportOptions, ExportResult, ExpressionConfig, ExternalSystemConfig, FieldConditionConfig, FieldFormat, FieldOption, FieldSchema, FieldSchemaContext, FieldToFieldConfig, FieldUIConfig, FunctionCallConfig, FunctionParameter, ImportOptions, IntegrationEndpoint, IntegrationResult, MemoryStats, OptionalFieldConfig, PropertyRuleConfig, RegistryIntegrityResult, RegistryValidationResult, RuleBuilderConfig, RuleBuilderSnapshot, RuleBuilderState, RuleContextProvider, RuleFunctionRegistry, RuleNode, RuleNodeConfig, RuleNodeTree, RuleNodeTypeString, RuleTemplate, RuleValidationResult, SpecificationMetadata, TemplateApplicationResult, TemplateCategory, TemplateDisplayMode, TemplateEditorDialogData, TemplateEditorResult, TemplateMetadata, TemplatePreviewDialogData, TemplateSearchCriteria, TemplateSortOption, TemplateStats, TemplateValidationResult, ValidComparisonOperator, ValidationConfig, ValidationContext, ValidationError$1 as ValidationError, ValidationIssue, ValidationResult, ValidationRule, ValueType, WebhookConfig, WebhookDelivery, WebhookEvent, WebhookStats };