@praxisui/visual-builder 9.0.0-beta.20 → 9.0.0-beta.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": "1.0.0",
|
|
3
|
-
"generatedAt": "2026-06-
|
|
3
|
+
"generatedAt": "2026-06-25T18:12:49.520Z",
|
|
4
4
|
"packageName": "@praxisui/visual-builder",
|
|
5
|
-
"packageVersion": "9.0.0-beta.
|
|
5
|
+
"packageVersion": "9.0.0-beta.21",
|
|
6
6
|
"sourceRegistry": "praxis-component-registry-ingestion",
|
|
7
7
|
"sourceRegistryVersion": "1.0.0",
|
|
8
8
|
"componentCount": 1,
|
|
@@ -1735,10 +1735,19 @@ class RuleBuilderService {
|
|
|
1735
1735
|
return { ok: true, value: this.sanitizeStructuredValue(def.name, value) };
|
|
1736
1736
|
}
|
|
1737
1737
|
return { ok: false };
|
|
1738
|
+
case 'array':
|
|
1739
|
+
return Array.isArray(value)
|
|
1740
|
+
? { ok: true, value: this.sanitizeStructuredArray(def.name, value) }
|
|
1741
|
+
: { ok: false };
|
|
1738
1742
|
default:
|
|
1739
1743
|
return { ok: false };
|
|
1740
1744
|
}
|
|
1741
1745
|
}
|
|
1746
|
+
sanitizeStructuredArray(name, value) {
|
|
1747
|
+
return value.map((item) => item && typeof item === 'object' && !Array.isArray(item)
|
|
1748
|
+
? this.sanitizeStructuredValue(name, item)
|
|
1749
|
+
: item);
|
|
1750
|
+
}
|
|
1742
1751
|
sanitizeStructuredValue(name, value) {
|
|
1743
1752
|
if (name === 'options') {
|
|
1744
1753
|
const normalizeItems = (items) => items
|
|
@@ -4451,12 +4460,12 @@ class PropertyEffectEditorComponent {
|
|
|
4451
4460
|
clearValue(entry, branch) {
|
|
4452
4461
|
if (branch === 'true') {
|
|
4453
4462
|
entry.value = null;
|
|
4454
|
-
entry.jsonValue = entry.type
|
|
4463
|
+
entry.jsonValue = this.isStructuredJsonType(entry.type) ? '' : entry.value;
|
|
4455
4464
|
entry.error = undefined;
|
|
4456
4465
|
}
|
|
4457
4466
|
else {
|
|
4458
4467
|
entry.valueWhenFalse = null;
|
|
4459
|
-
entry.jsonValueWhenFalse = entry.type
|
|
4468
|
+
entry.jsonValueWhenFalse = this.isStructuredJsonType(entry.type) ? '' : entry.valueWhenFalse;
|
|
4460
4469
|
entry.errorWhenFalse = undefined;
|
|
4461
4470
|
}
|
|
4462
4471
|
this.emitChange();
|
|
@@ -4474,8 +4483,8 @@ class PropertyEffectEditorComponent {
|
|
|
4474
4483
|
entry.type = def.type;
|
|
4475
4484
|
entry.value = def.type === 'boolean' ? true : undefined;
|
|
4476
4485
|
entry.valueWhenFalse = undefined;
|
|
4477
|
-
entry.jsonValue = def.type
|
|
4478
|
-
entry.jsonValueWhenFalse = def.type
|
|
4486
|
+
entry.jsonValue = this.isStructuredJsonType(def.type) ? '' : undefined;
|
|
4487
|
+
entry.jsonValueWhenFalse = this.isStructuredJsonType(def.type) ? '' : undefined;
|
|
4479
4488
|
}
|
|
4480
4489
|
entry.error = undefined;
|
|
4481
4490
|
entry.errorWhenFalse = undefined;
|
|
@@ -4526,11 +4535,11 @@ class PropertyEffectEditorComponent {
|
|
|
4526
4535
|
return;
|
|
4527
4536
|
const entry = this.createEntry(def);
|
|
4528
4537
|
entry.property = name;
|
|
4529
|
-
entry.value = def.type
|
|
4530
|
-
entry.valueWhenFalse = def.type
|
|
4531
|
-
entry.jsonValue = def.type
|
|
4538
|
+
entry.value = this.isStructuredJsonType(def.type) ? undefined : props[name];
|
|
4539
|
+
entry.valueWhenFalse = this.isStructuredJsonType(def.type) ? undefined : propsFalse[name];
|
|
4540
|
+
entry.jsonValue = this.isStructuredJsonType(def.type) ? this.stringifyValue(props[name]) : undefined;
|
|
4532
4541
|
entry.jsonValueWhenFalse =
|
|
4533
|
-
def.type
|
|
4542
|
+
this.isStructuredJsonType(def.type) ? this.stringifyValue(propsFalse[name]) : undefined;
|
|
4534
4543
|
entries.push(entry);
|
|
4535
4544
|
});
|
|
4536
4545
|
if (!entries.length && this.properties.length) {
|
|
@@ -4549,8 +4558,8 @@ class PropertyEffectEditorComponent {
|
|
|
4549
4558
|
type: def.type,
|
|
4550
4559
|
value: def.type === 'boolean' ? true : undefined,
|
|
4551
4560
|
valueWhenFalse: undefined,
|
|
4552
|
-
jsonValue: def.type
|
|
4553
|
-
jsonValueWhenFalse: def.type
|
|
4561
|
+
jsonValue: this.isStructuredJsonType(def.type) ? '' : undefined,
|
|
4562
|
+
jsonValueWhenFalse: this.isStructuredJsonType(def.type) ? '' : undefined,
|
|
4554
4563
|
};
|
|
4555
4564
|
}
|
|
4556
4565
|
buildConfigFromEntries() {
|
|
@@ -4578,7 +4587,7 @@ class PropertyEffectEditorComponent {
|
|
|
4578
4587
|
}
|
|
4579
4588
|
normalizeValue(entry, branch) {
|
|
4580
4589
|
const type = entry.type;
|
|
4581
|
-
const raw = type
|
|
4590
|
+
const raw = this.isStructuredJsonType(type)
|
|
4582
4591
|
? branch === 'true'
|
|
4583
4592
|
? entry.jsonValue
|
|
4584
4593
|
: entry.jsonValueWhenFalse
|
|
@@ -4610,8 +4619,9 @@ class PropertyEffectEditorComponent {
|
|
|
4610
4619
|
}
|
|
4611
4620
|
case 'string':
|
|
4612
4621
|
return { ok: true, value: String(raw) };
|
|
4622
|
+
case 'array':
|
|
4613
4623
|
default: {
|
|
4614
|
-
const parsedResult = this.parseObject(raw, entry.property);
|
|
4624
|
+
const parsedResult = this.parseObject(raw, entry.property, type === 'array' ? 'array' : 'object');
|
|
4615
4625
|
if (!parsedResult.ok) {
|
|
4616
4626
|
return { ok: false, error: parsedResult.error || 'JSON inválido' };
|
|
4617
4627
|
}
|
|
@@ -4619,7 +4629,7 @@ class PropertyEffectEditorComponent {
|
|
|
4619
4629
|
}
|
|
4620
4630
|
}
|
|
4621
4631
|
}
|
|
4622
|
-
parseObject(raw, propertyName) {
|
|
4632
|
+
parseObject(raw, propertyName, expectedType = 'object') {
|
|
4623
4633
|
let value = raw;
|
|
4624
4634
|
if (typeof raw === 'string') {
|
|
4625
4635
|
try {
|
|
@@ -4629,6 +4639,11 @@ class PropertyEffectEditorComponent {
|
|
|
4629
4639
|
return { ok: false, error: 'JSON inválido' };
|
|
4630
4640
|
}
|
|
4631
4641
|
}
|
|
4642
|
+
if (expectedType === 'array') {
|
|
4643
|
+
return Array.isArray(value)
|
|
4644
|
+
? { ok: true, value }
|
|
4645
|
+
: { ok: false, error: 'Informe uma lista' };
|
|
4646
|
+
}
|
|
4632
4647
|
if (propertyName === 'options') {
|
|
4633
4648
|
if (Array.isArray(value)) {
|
|
4634
4649
|
return { ok: true, value: { items: value } };
|
|
@@ -4652,6 +4667,9 @@ class PropertyEffectEditorComponent {
|
|
|
4652
4667
|
return '';
|
|
4653
4668
|
}
|
|
4654
4669
|
}
|
|
4670
|
+
isStructuredJsonType(type) {
|
|
4671
|
+
return type === 'object' || type === 'array';
|
|
4672
|
+
}
|
|
4655
4673
|
signature(config) {
|
|
4656
4674
|
try {
|
|
4657
4675
|
return JSON.stringify(config || {});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@praxisui/visual-builder",
|
|
3
|
-
"version": "9.0.0-beta.
|
|
3
|
+
"version": "9.0.0-beta.21",
|
|
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,11 +8,11 @@
|
|
|
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.0-beta.
|
|
11
|
+
"@praxisui/settings-panel": "^9.0.0-beta.21",
|
|
12
12
|
"@angular/platform-browser-dynamic": "^21.0.0",
|
|
13
|
-
"@praxisui/ai": "^9.0.0-beta.
|
|
14
|
-
"@praxisui/core": "^9.0.0-beta.
|
|
15
|
-
"@praxisui/metadata-editor": "^9.0.0-beta.
|
|
13
|
+
"@praxisui/ai": "^9.0.0-beta.21",
|
|
14
|
+
"@praxisui/core": "^9.0.0-beta.21",
|
|
15
|
+
"@praxisui/metadata-editor": "^9.0.0-beta.21",
|
|
16
16
|
"rxjs": "~7.8.0"
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
@@ -1291,6 +1291,7 @@ declare class RuleBuilderService {
|
|
|
1291
1291
|
private validateFormRulesPayload;
|
|
1292
1292
|
private sanitizeRuleProperties;
|
|
1293
1293
|
private coerceRulePropertyValue;
|
|
1294
|
+
private sanitizeStructuredArray;
|
|
1294
1295
|
private sanitizeStructuredValue;
|
|
1295
1296
|
private formRulesToBuilderState;
|
|
1296
1297
|
private inferRuleTypeFromFormRule;
|