@praxisui/visual-builder 9.0.5-rc.8 → 9.0.5
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/README.md
CHANGED
|
@@ -135,6 +135,7 @@ Boundary rules:
|
|
|
135
135
|
- effects must be constrained by target property schemas and `RULE_PROPERTY_SCHEMA`
|
|
136
136
|
- `dsl.roundTrip.validate` validates the JSON export/import path currently implemented by `RuleBuilderService`; form-config import remains supported but is not advertised as a round-trip export target by this operation
|
|
137
137
|
- field-to-field comparisons are part of the supported visual subset; context-variable and function-result operands in field conditions remain planned until a canonical JSON Logic shape exists
|
|
138
|
+
- field operands wrapped by the canonical Praxis `coalesce` operator round-trip without semantic loss; the editor preserves that nullish-value transform while fields or operators are changed
|
|
138
139
|
- component-specific configuration belongs to child component manifests
|
|
139
140
|
|
|
140
141
|
## Legacy Note
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": "1.0.0",
|
|
3
|
-
"generatedAt": "2026-08-
|
|
3
|
+
"generatedAt": "2026-08-18T02:12:19.525Z",
|
|
4
4
|
"packageName": "@praxisui/visual-builder",
|
|
5
|
-
"packageVersion": "9.0.5
|
|
5
|
+
"packageVersion": "9.0.5",
|
|
6
6
|
"sourceRegistry": "praxis-component-registry-ingestion",
|
|
7
7
|
"sourceRegistryVersion": "1.0.0",
|
|
8
8
|
"componentCount": 1,
|
|
@@ -1545,7 +1545,10 @@ class RuleBuilderService {
|
|
|
1545
1545
|
return null;
|
|
1546
1546
|
}
|
|
1547
1547
|
return {
|
|
1548
|
-
[operator]: [
|
|
1548
|
+
[operator]: [
|
|
1549
|
+
this.buildFieldOperand(cfg.fieldName, cfg.fieldValueTransform),
|
|
1550
|
+
this.buildConditionRightOperand(cfg),
|
|
1551
|
+
],
|
|
1549
1552
|
};
|
|
1550
1553
|
}
|
|
1551
1554
|
if (node.type === RuleNodeType.AND_GROUP || node.type === RuleNodeType.OR_GROUP) {
|
|
@@ -1957,18 +1960,26 @@ class RuleBuilderService {
|
|
|
1957
1960
|
return undefined;
|
|
1958
1961
|
}
|
|
1959
1962
|
const [left, right] = normalizedArgs;
|
|
1960
|
-
|
|
1963
|
+
const leftOperand = this.parseFieldOperand(left);
|
|
1964
|
+
if (!leftOperand) {
|
|
1961
1965
|
return undefined;
|
|
1962
1966
|
}
|
|
1963
1967
|
const config = {
|
|
1964
1968
|
type: 'fieldCondition',
|
|
1965
|
-
fieldName:
|
|
1969
|
+
fieldName: leftOperand.path,
|
|
1966
1970
|
operator: builderOperator,
|
|
1967
1971
|
value: right,
|
|
1968
1972
|
};
|
|
1969
|
-
if (
|
|
1973
|
+
if (leftOperand.transform) {
|
|
1974
|
+
config['fieldValueTransform'] = leftOperand.transform;
|
|
1975
|
+
}
|
|
1976
|
+
const rightOperand = this.parseFieldOperand(right);
|
|
1977
|
+
if (rightOperand) {
|
|
1970
1978
|
config['valueType'] = 'field';
|
|
1971
|
-
config['compareToField'] =
|
|
1979
|
+
config['compareToField'] = rightOperand.path;
|
|
1980
|
+
if (rightOperand.transform) {
|
|
1981
|
+
config['compareToFieldValueTransform'] = rightOperand.transform;
|
|
1982
|
+
}
|
|
1972
1983
|
}
|
|
1973
1984
|
return {
|
|
1974
1985
|
id: v4(),
|
|
@@ -2091,10 +2102,34 @@ class RuleBuilderService {
|
|
|
2091
2102
|
if (cfg['valueType'] === 'field' &&
|
|
2092
2103
|
typeof cfg['compareToField'] === 'string' &&
|
|
2093
2104
|
cfg['compareToField'].trim()) {
|
|
2094
|
-
return
|
|
2105
|
+
return this.buildFieldOperand(cfg['compareToField'].trim(), cfg['compareToFieldValueTransform']);
|
|
2095
2106
|
}
|
|
2096
2107
|
return this.normalizeConditionValue(cfg['value']);
|
|
2097
2108
|
}
|
|
2109
|
+
buildFieldOperand(path, transform) {
|
|
2110
|
+
const variable = { var: path };
|
|
2111
|
+
return transform === 'coalesce' ? { coalesce: [variable] } : variable;
|
|
2112
|
+
}
|
|
2113
|
+
parseFieldOperand(value) {
|
|
2114
|
+
if (this.isVarExpression(value)) {
|
|
2115
|
+
return { path: this.extractVarPath(value.var) };
|
|
2116
|
+
}
|
|
2117
|
+
if (!value ||
|
|
2118
|
+
typeof value !== 'object' ||
|
|
2119
|
+
Array.isArray(value) ||
|
|
2120
|
+
!('coalesce' in value)) {
|
|
2121
|
+
return null;
|
|
2122
|
+
}
|
|
2123
|
+
const args = value.coalesce;
|
|
2124
|
+
const normalizedArgs = Array.isArray(args) ? args : [args];
|
|
2125
|
+
if (normalizedArgs.length !== 1 || !this.isVarExpression(normalizedArgs[0])) {
|
|
2126
|
+
return null;
|
|
2127
|
+
}
|
|
2128
|
+
return {
|
|
2129
|
+
path: this.extractVarPath(normalizedArgs[0].var),
|
|
2130
|
+
transform: 'coalesce',
|
|
2131
|
+
};
|
|
2132
|
+
}
|
|
2098
2133
|
isJsonLogicExpressionCandidate(value) {
|
|
2099
2134
|
return !!value && typeof value === 'object' && !Array.isArray(value);
|
|
2100
2135
|
}
|
|
@@ -5463,6 +5498,8 @@ class FieldConditionEditorComponent {
|
|
|
5463
5498
|
valueType,
|
|
5464
5499
|
compareToField: valueType === 'field' ? formValue.compareToField : '',
|
|
5465
5500
|
contextVariable: '',
|
|
5501
|
+
fieldValueTransform: this.config?.fieldValueTransform,
|
|
5502
|
+
compareToFieldValueTransform: valueType === 'field' ? this.config?.compareToFieldValueTransform : undefined,
|
|
5466
5503
|
};
|
|
5467
5504
|
this.configChanged.emit(config);
|
|
5468
5505
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@praxisui/visual-builder",
|
|
3
|
-
"version": "9.0.5
|
|
3
|
+
"version": "9.0.5",
|
|
4
4
|
"description": "Visual rule and expression builder for Praxis UI with JSON Logic authoring, validation and context variables.",
|
|
5
5
|
"peerDependencies": {
|
|
6
6
|
"@angular/common": "^21.0.0",
|
|
@@ -8,10 +8,10 @@
|
|
|
8
8
|
"@angular/cdk": "^21.0.0",
|
|
9
9
|
"@angular/material": "^21.0.0",
|
|
10
10
|
"@angular/forms": "^21.0.0",
|
|
11
|
-
"@praxisui/settings-panel": "^9.0.5
|
|
12
|
-
"@praxisui/ai": "^9.0.5
|
|
13
|
-
"@praxisui/core": "^9.0.5
|
|
14
|
-
"@praxisui/metadata-editor": "^9.0.5
|
|
11
|
+
"@praxisui/settings-panel": "^9.0.5",
|
|
12
|
+
"@praxisui/ai": "^9.0.5",
|
|
13
|
+
"@praxisui/core": "^9.0.5",
|
|
14
|
+
"@praxisui/metadata-editor": "^9.0.5",
|
|
15
15
|
"rxjs": "~7.8.0"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
@@ -42,6 +42,7 @@ interface SpecificationMetadata {
|
|
|
42
42
|
* Value types for rule configuration
|
|
43
43
|
*/
|
|
44
44
|
type ValueType = 'literal' | 'field' | 'context' | 'function';
|
|
45
|
+
type FieldOperandTransform = 'coalesce';
|
|
45
46
|
/**
|
|
46
47
|
* Valid comparison operators supported by the visual builder
|
|
47
48
|
*/
|
|
@@ -112,6 +113,10 @@ interface FieldConditionConfig {
|
|
|
112
113
|
valueType?: ValueType;
|
|
113
114
|
/** Field to compare against (for field-to-field comparisons) */
|
|
114
115
|
compareToField?: string;
|
|
116
|
+
/** Canonical JSON Logic transform applied to the left field operand. */
|
|
117
|
+
fieldValueTransform?: FieldOperandTransform;
|
|
118
|
+
/** Canonical JSON Logic transform applied to a field-valued right operand. */
|
|
119
|
+
compareToFieldValueTransform?: FieldOperandTransform;
|
|
115
120
|
/** Context variable to use as value */
|
|
116
121
|
contextVariable?: string;
|
|
117
122
|
/** Optional metadata for error messages and UI hints */
|
|
@@ -1304,6 +1309,8 @@ declare class RuleBuilderService {
|
|
|
1304
1309
|
private jsonLogicOperatorToBuilderOperator;
|
|
1305
1310
|
private normalizeConditionValue;
|
|
1306
1311
|
private buildConditionRightOperand;
|
|
1312
|
+
private buildFieldOperand;
|
|
1313
|
+
private parseFieldOperand;
|
|
1307
1314
|
private isJsonLogicExpressionCandidate;
|
|
1308
1315
|
private isVarExpression;
|
|
1309
1316
|
private extractVarPath;
|
|
@@ -2958,4 +2965,4 @@ declare class RuleListComponent {
|
|
|
2958
2965
|
}
|
|
2959
2966
|
|
|
2960
2967
|
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, PRAXIS_VISUAL_BUILDER_AUTHORING_MANIFEST, PRAXIS_VISUAL_BUILDER_COMPONENT_METADATA, 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, providePraxisVisualBuilderMetadata };
|
|
2961
|
-
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, VisualBuilderMode, WebhookConfig, WebhookDelivery, WebhookEvent, WebhookStats };
|
|
2968
|
+
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, FieldOperandTransform, 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, VisualBuilderMode, WebhookConfig, WebhookDelivery, WebhookEvent, WebhookStats };
|